Hi
im trying to figure out the as3 script to add to a frame to so that when the time line hits that frame it tells it to load a specific scene. can anyone help?
On the frame you want to load the new scene, just put in gotoAndPlay(frameNumber);
thanks but its not a frame i want to load its a scene within the fla and its as3 surly its not as simple as gotoAndPlay?
found this code which i put into the frame, so that when the timeline hits it, it will jump to the "About" scene frame "1"
stop (); this.addEventListener (Event.ENTER_FRAME, EnterFrame); EnterFrame function (event: Event): void ( gotoAndPlay (1, "About"); ) but im getting these errors....any advice? Symbol 'home_holder_mc', Layer 'actions', Frame 3, Line 3 1084: Syntax error: expecting identifier before leftparen. Symbol 'home_holder_mc', Layer 'actions', Frame 3, Line 3 1084: Syntax error: expecting leftparen before colon. Symbol 'home_holder_mc', Layer 'actions', Frame 3, Line 4 1084: Syntax error: expecting rightparen before leftparen. Symbol 'home_holder_mc', Layer 'actions', Frame 3, Line 5 1084: Syntax error: expecting identifier before rightparen.
Use a different function name. EnterFrame is sort of already a reserved syntax in AS3. In this example I renamed your function playAbout. And you need to put function before the name of your function like this:
stop ();
this.addEventListener (Event.ENTER_FRAME, playAbout); function playAbout(event: Event): void ( gotoAndPlay (1, "About");
) The syntax error is because you had the name of the function before claiming it as a function. Always say:
function whateverName(event:Event):void
Hope this helps. :)
Oh also, I just noticed you want to use curly braces not parenthesis after :void. I just copied your function so what I have up top is wrong. Here's the correct function. You can copy and paste this and it should work:
stop();
this.addEventListener(Event.ENTER_FRAME, playAbout);
function playAbout(event:Event):void{
gotoAndPlay ("About"); /// here you go to and play the frame label about. If you don't have a label then use frame number
}
sorted, much appreciated :)
|