ActionScript 3.0 :: Can't Get A Simple GotoAndPlay To Work
Jan 13, 2012
I'm not familiar with AS3 at all.I'm working on a simple 2 minute presentation. For testing purposes, I have a layer named "label" that I am using to set a label called "test" (currently it's on frame 1445)I'm trying to put an action in the timeline, frame 1, that will cause the play head to automatically jump to the "test" label so as I build the presentation and test it, I don't have to sit through the entire thing just to see if my latest animations are working as expected. I'd like to move this "test" label down the timeline as I continue to build new parts of the presentation. I would expect this code to jump the play-head to where ever I put that "test" label..Instead, it either doesn't work at all, or it jumps to some other random spot around frame 160. NO other labels are being used in this presentation (I'm using the FlashEff component plugin for effects, in case that info is necessary)
View 2 Replies
Similar Posts:
Jan 25, 2005
I have a scene for the title screen and a scene for the game itself. On the title screen i have a start button, that when clicked it is supposed to go to the game scene; but for some reason this wont work.
actions for startclick (start)
on(release){
gotoAndPlay("Game", 1);
}
View 8 Replies
Nov 9, 2007
For some reason i'm having problems swapping scenes in my flash movie. At first i put the action in a "actions" named layer and a link to a button. So basicly when scene1 loads the frame 1 action is "stop ();". The viewer clicks on button1 which has a code of;
[Code]...
View 1 Replies
Sep 10, 2010
For some reason, the gotoAndPlay command in one of my frames won't work properly (I think that's the problematic command, but maybe it's another one in the movie).
Frame 1 consists of a button instance named "menu", which is a text reading "menu". When pressed, the animation starts playing and several menu options appear in a frame-by-frame animation, which lasts up to frame 7 where the movie stops.When the "menu" instance is pressed again, the playhead is released and the movie plays another frame-by-frame animation (from frames 8 to 16) of the menu options disappearing.So, in frame 16 there appears only the "menu" instance - just like in frame 1.
All of the above works fine.What I want to do is tell the player to go back to frame 1 as soon as it reaches frame 16, so the menu can open up again when the instance is pressed.I put this code in frame 16:gotoAndPlay(1)and it seems to be working fine, but when I press the "menu" instance for the third time (meaning, after it has already opened up and closed one time), the movie starts playing from frame 8 for some reason.
View 4 Replies
Dec 18, 2010
I made simple banner which consists of pictures and symbols. Now I want it to jump from the last frame to first one. I tried to put simply gotoandplay(1); but that dooesn't work. What's wrong?
View 8 Replies
Nov 21, 2010
I have made a simple animation using only the timeline. The animation is covered by a button "Knapp" (alpha 0) wich activates the actions. The whole thing works fine the first time. The last action says go to and play frame 2, wich has two actions: stop + go to and play frame 4. But this action does not work the second time. I tried to set the action to frame 3 instead of 2 and the same problem occured on another action on the timeline as well.
Here is the last action on my timeline:
Knapp.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_11);
function fl_ClickToGoToAndPlayFromFrame_11(event:MouseEvent):void{ gotoAndPlay(2);}
[Code]....
View 7 Replies
Jan 14, 2009
my gotoAndPlay does not seem to be working. On frame 1 I have this for testing purposes:
trace("frame 1")
and on frame 2 I have:
gotoAndPlay(2);
and I get "frame 1" traced out continually. It's going back to frame 1 for some reason.
View 2 Replies
Oct 28, 2010
Why with AS3 when i create button with gotoAndPlay(2); in movie with 2 frames it does not work? Its because its last frame. What would be work around?
ActionScript Code:
stop();
movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame);
[code]....
View 1 Replies
May 18, 2005
I have a button that makes a movieclip in the main timeline go to the prevous frame... . Here is the code
on(release){
_root.pregunticas.gotoAndStop(prevFrame);
}
It shows no errors in the output panel...
View 3 Replies
Jul 12, 2009
When a variable reaches 0 gotoAndPlay frame 4
ActionScript Code:
//Variable Name: ammo
if(_root.ammo = 0;
_root.gotoAndPlay(4);
Doesn't work maybe?
View 1 Replies
Nov 21, 2008
XML text to be used as a link within my flash site.What I mean by this is I have a XML file with a list of shows and at the end of each title and short description and I would like to have a link to the show's dedicated page.I know how to do a URL link but a gotoAndPlay / Stop link doesn't seem to work the same way.. Here is an example of what I mean:
Show Name 1:
Short description
link to dedicated 'page'[code]....
View 1 Replies
Jul 7, 2009
I am just testing out how to place a button to go to a scene.I have 2 scenes named, one and two and 2 buttons...One on each scene to get them back to the other scene.The instance names on the buttons are scen1_btn and scene2_btn.My Functions are just called scene1 and scene 2.The code I have below is what I wrote, and I thought would work, but isn't.[code]
View 5 Replies
Oct 24, 2010
I have this little slideshow, it is for practise for my students. It always worked well in as 2.0, 5 slides, and two buttons: back and next.The script in2.0 has: prevFrame and nextFrame in the code and for the exceptions in frame 1, and frame 5 we made a new frame 1 in the actions layer, and coded the back button, gotoAndStop(5); and a new frame 5, and coded the next button: gotoAndStop(1); Works.
Now I put the thing over tot as 3.0: And I can not get it to work properly....the buttons work, but when I am on frame 5, and go back to 4, it will go no further than 4, evenso when I go back to frame 1 from 5, I can not go further up than frame 1.
import flash.events.MouseEvent;
stop();
next_btn.addEventListener(MouseEvent.CLICK, volgendFrame);//next_btn.addEventListener(MouseEvent.CLICK,[code].....
View 5 Replies
Jan 14, 2010
I'm an AS2 guy finally being drug into the AS3 world and finding it difficult.I just want to make a simple rollover effect.[code]I noticed the first line in the code, do I have to import something? Either way my text in the button doesn't move when I rollover. It moves upon render but then it stops.URl...
View 2 Replies
Feb 18, 2006
I am using Flash 8, and for some reason, my if statement won't work. I have a scrollbar which scrolls a movieclip (that contains AS loaded material (eg. attachmovie). I want it so that only when the material is longer than the scrollbar do I see the scroll bar.For some reason, it doesn't work. The traces don't even work!
if (scrollbar._height < menu_mc._height) {
scrollbar._alpha = 100;
trace("works");[code].....
View 2 Replies
Nov 30, 2009
I am having trouble getting a hitTest to work. My two MCs are lines, one horizontal, one slanted. When the horizontal line gets within the "bounding box" of the slanted line the hitTest is true, but it's not touching the slanted line yet. I saw that the shapeFlag property comes into play here, but only when using coordinates... I'm not sure how to apply it to these two lines. I want the hitTest to be true only when the lines actually touch. I have attached a simple FLA of the problem.
View 1 Replies
Mar 16, 2009
What I'm Trying To Do: Modify the y coordinate of a MovieClip on the stage from an external .as File, simple as that.If someone could tell me why its not working and how I can go about fixing it without modifying the existing class structure
(ChildOfMain must subclass MainClass).
Download
Source Files 6 kB
For those of you who don't want to download the source files (I thought it would make it easier if you could handle it yourself)
Document Class For Project: Main Class
Objects In Project Library
platform (movieclip)
subjectMovieClip (movieclip)
[code]....
View 6 Replies
Feb 12, 2010
I'm trying to get a simple random SWF loader to work. and I'm close...I have 10 movies saved as movie1.swf to movie10.swf saved in a directory.For my index file (swf file that will load one of the 10 movies randomly) I have one single frame with this in the actions:
stop();
var movieArray : Array = ['movie1','movie2','movie3','movie4','movie5','movi e6','movie7','movie8','movie9','movie10'];
var loader : Loader = new Loader();
loader.load(new URLRequest(movieArray[Math.round( Math.random() * movieArray.length-1 )] + '.swf'));
addChild(loader);
For the most part it works. But every now and then the screen comes up empty on a refresh. My guess is the math might be slightly off and is calling a file that is not there.
View 9 Replies
Mar 23, 2005
I boggled with this simple script.This script is on the MC. Everything works except the last onRelase function which just won't go to "disable". If I change "disable" to "fadein" it will work. Please see the attached timeline pic to get better idea and please do let me know what I'm doing wrong.[code]
View 14 Replies
Jul 20, 2011
I do not know action script, and, have created a button in flash that pops up information when you rollover the button.The button works fine, but, the entire area - where the information pops - is also poping up when I rollover that area.
View 4 Replies
Feb 1, 2009
I am having trouble getting a simple event listener class to work. The class is:
Code:
package {
import flash.display.Sprite;
import flash.events.*;
[code]...
and I have the ClassPath pointing to the folder that contains this .as file. I do get the trace "In setUp" but I'm not getting seeing any Keyboard events. There also aren't any errors showing up in output so I am kind of stumped.
View 1 Replies
Oct 11, 2004
I've been trying to get a simple fade out of a logo to work. I converted the logo to a movieclip called logo_mc I click on the logo_mc movieclip and insert this actionscript.
onClipEvent (load) {
if (this._alpha>0) {
this._alpha -= 5;
}
}
I have also tried putting the code on the main timeline without any success.
If I understand correctly this should see if the alpha is greater than 0 and if it is it should decrease the value by five increments until it reaches 0.
View 3 Replies
Mar 19, 2009
I've been trying to write a hittest that will work for rounded walls on my RPG. But I've been epic phailing.
Heres my code:
onClipEvent(load){speed=10;
}onClipEvent(enterFrame){if(Key.isDown(Key.UP)){this._y-=speed;this.gotoAndStop(5);
}if(Key.isDown(Key.DOWN)){this._y+=speed;
this.gotoAndStop(6);}
if(Key.isDo wn(Key.RIGHT)){this._x+=speed;this.gotoAndStop(7);
}if(Key.isDown(Key.LEFT)){this._x-=speed;this.gotoAndStop(8);}
View 2 Replies
Sep 1, 2009
I'm using Flash to create a simple profile on a recording artist for work. I'm trying to embed a minute-long .mov file into Flash, so when someone clicks the "watch" button I created, it changes frames and plays this .mov file. I have everything uploaded, but the .mov file only shows up on certain computers when someone actually clicks the "watch" button. It works on my Mac, a friend's Mac, but on the three PCs I've tested, it won't show up. The Flash file itself works, but the .mov file won't show up on the frame when it is accessed.The flash file containing the .mov is embedding onto a .php page made in Dreamweaver. On all computers, when the .swf is accessed directly, the .mov file will work properly. On the PCs, when the .php page is accessed and the Flash loads, the .mov will not load.URL...
View 1 Replies
May 19, 2010
I'm searched and searched and tested this, but I can't seem to get a simple scroll pane to work correctly. I have a bare-bones file, with dummy text here:[URL]..
Can someone download this and put the dummy text inside a scrollpane for me (using the ruler guidelines as a guide)? I'll even send you $10 via PayPal if you can get the text to look right inside the scrollpane...
I can't believe I have to resort to this, but I'm about to pull my hair out,
View 1 Replies
Mar 28, 2011
I've got 2 AS3 files going here, the document file "Main" and a "Fence" file..[code]For some reason the ping comes up, but the pong doesn't, it's starting to bug me now that the "onFenceAdded" wont even work, what have I missed? Is there some way to check if Flash is compiling correctly? I often find these weird problems where I'm sure I've done it all correct, but when I try to compile and run a swf it wont work!
View 11 Replies
Feb 26, 2011
I am trying to create a simple animation, juste a picture that need to move from left to write while rotating around the vertical axis.I tried just to have the first position normal and the final position scaled at -100% in width but it also distort and move up and down.I already did that in acstionscript but not just graphicaly.
View 2 Replies
May 10, 2011
Im trying to make password checker but in some reason my code doesn't work. I have one input text field "inTxt", one output text field "outTxt" and submit button "btn". My code checks if the text in the input field is same that is in the "pass" variable and if it is, it should print "Correct." in the outTxt output text field and if it's not it should print "Incorrect." But for some reason it prints "Incorrect." all the time.
ActionScript Code:
btn.addEventListener(MouseEvent.CLICK, test);
inTxt.displayAsPassword = true;
var pass:String = "dog";
[Code].....
View 5 Replies
Sep 12, 2011
The MovieClip art Gallery is added to the stage just fine, but it's .as class can't even display a simple image 'elephant.jpg'.
ActionScript Code:
package
{
import flash.display.MovieClip;
[Code].....
View 3 Replies
Oct 11, 2004
I'm new to the forums and to actionscript. I've been trying to get a simple fade out of a logo to work. I converted the logo to a movieclip called logo_mc I click on the logo_mc movieclip and insert this actionscript.
[Code]...
I have also tried putting the code on the main timeline without any success. If I understand correctly this should see if the alpha is greater than 0 and if it is it should decrease the value by five increments until it reaches 0.
View 6 Replies