AS3 scene jumping

  • missshelby27
  • Novice
  • Novice
  • missshelby27
  • Posts: 21

Post 3+ Months Ago

Hi sorry I'm really new to AS3 and really confused with various functions that have changed! If you can help I would be much appreciative! :0)

I'm trying to get this script to work:
Code: [ Select ]
stop()
this.addEventListener(Event.ENTER_FRAME,EnterFrame );
function EnterFrame(event:Event):void {
gotoAndPlay(2, "Scene 1");
}
  1. stop()
  2. this.addEventListener(Event.ENTER_FRAME,EnterFrame );
  3. function EnterFrame(event:Event):void {
  4. gotoAndPlay(2, "Scene 1");
  5. }


but it tells me there is no scene 1?!

This is the error:
ArgumentError: Error #2108: Scene Scene 1 was not found.
at flash.display::MovieClip/gotoAndPlay()
at JOS_fla::JOSIntroduction_1/EnterFrame()

Any help would be MUCH appreciated! :0)

Thanks so much in advance
Moderator Remark: added code tags
  • tlacuilosound
  • Born
  • Born
  • tlacuilosound
  • Posts: 2

Post 3+ Months Ago

That missshelvy Hey, I understand your problem, chinga us to dive into the code does not change?, Looks good I just have the same probelma but easily resolved by the code you are using this button, I guess you will return to frame2 1 of the scene (assuming it is in another scene). you said that to start after a stop () must use a semicolon;

stop ();

Sometimes this causes you herrores from the beginning of the code.

What happens is that your compiler is in Spanish and the word "Scene 2" is not recognized as a single so I Replace in Spanish just as well have:

stop ();
this.addEventListener (Event.ENTER_FRAME, EnterFrame);
EnterFrame function (event: Event): void (
gotoAndPlay (2, "Scan 1");
)

And ready to work
  • tlacuilosound
  • Born
  • Born
  • tlacuilosound
  • Posts: 2

Post 3+ Months Ago

mmmmm sorry if my spelling is not ESCAN.... Scene is
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

press Shift + F2 to see the scenes that you have, in order to get the proper name.

But i would suggest that you start using movie clips instead of scenes.
Also, search for a tutorial on how to use AS3 classes,
it will be a bit more complicated at first, but then it will save you a lot of time if you intend to use flash for a longer period.
This way you will nicely separate the code from the graphics, and changing of graphics will not affect your code.
The keyword is: reuse.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 9 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.