Scene to scene Problem
Hi i'm working with CS6 AS3 and i'm baffled with this. i have Scene 2 and it has an MC (Next) which when clicked takes you to Scene 3
That works fine and Scene 3 works perfectly. now when i have another option for Scene 2 to go to Scene 3 which is
(frame 2192 is the end of an MC in Scene 2)
with this code it goes to scene 3 but scene 3 is frozen and i cannot click on any of the buttons. Any ideas why this is happening?
Thanx in advance for any help.
there's a few problems i see, not the least being using large complicated timeline navigation.
i'll assume you are not using Classes, and that all code is written in the ActionScript panel and IS in all one place.
using 'this' and also 'root' can be tricky. you have to be very careful and certain what they are referring to.
with the second set of code, when you test it, does it thorw errors?( i bet it does) if so, what does it say?
QUOTE: ... (frame 2192 is the end of an MC in Scene 2) ...
this is telling , because your event listener is on 'isPlayingMC211' . the function written says
if it did work, it would direct it to
are you sure what 'MovieClip(this.root)' is now referring to?
and check this line
because that is not how an ENTER_FRAME should be written. it should be written thus:
now, i don't like this code, but IF i was attempting it i would say you probably want something like this to account for your nested movieclips, since the parent movieclip has no idea of what any child movieclip is doing unless it is directed to listen for it:
note that to tell a movelclip 'B' that is nested inside movieclip 'A' to play, you write
If you want to be exact and work an absolute path, it is best to declare/cast the stage as root, then it is easier to work backwards/forwards from
then if 'B' is a movieclip inside 'A' which is on the stage, a function can reference it from anywhere with
i hope these ideas help you solve your problem
thanks for you lengthy post. maybe this would help you understand a bit more what i'm doing.
So i have 3 identical length MC's nested in the main timeline. isplaying the result of a function i use to determine which one of them is playing. takes the frame number it's on, stops it and continues whichever other one had it's corresponding button clicked on. that works fine and switches seamlessly between the MCs. but when it comes to reading the last frame to then switch to a certain scene it goes bust...i have no errors by the way when publishing
as long as you have everything else worked out, then this code can be tweaked to accomplish that
this works the same as the one i had. it goes to the specified scene but then freezes. it seems that whichever scene it goes to, it loops the first 2 frames of that scene.
but then if the command is mouse clicked, it goes to the specified scene and works fine.
any ideas why this could possibly be?
without seeing more code, or how you constructed your project, it might be harder to go any further.
however, i still think you are targetting something incorrectly.
which mc ( and exactly where is it located) are you referencing with this( quoted from my original response):
i suspect you have another movieclip withing that 'scene' that you are expecting to play, but it might not be directed to play yet.
more/full code, or posting your project can help us figure it out
this is how isPlaying is used
that's why i wanted isPlaying to determine the end of the scene to go to the next one. else i could try 3 event listeners on each mc and see from there