Evil Panda - example of gotoAndPlay frame label tip with Flash Lite 1.1
February 20th, 2008 by Scott JanousekFaisal posted about a tip (many of us, like to use) when dealing with 1.1 content (replacing tellTargets() in favor of 1-line gotoAndPlay() statements with frame label jumps).
So:
[AS]
tellTarget( “person_mc” ) {
gotoAndPlay( “moveHead” ); //– assuming there is a frame labeled ‘moveHead’ on the timeline
}
[/AS]
… can simply be:
[AS]
gotoAndPlay( “person_mc:moveHead” ); //– assuming there is a frame labeled ‘moveHead’ on the timeline
[/AS]
This works well for one liners. Works for gotoAndStop() as well. If you need more than one line; use the usual suspect, your crusty old friend: tellTarget().
Evil Panda
I put it to use in an quick example, so folks could see an example of how one might use it.
In his current state, evil panda likes to do two things … he either likes to eat or get angry. Unforunately, he is a really moody panda bear … and not your “cute, like-able furball kind”.
Perhaps he just needs some attention? … or perhaps is angry because there is no Flash, yet on the iPhone. Who knows …
[AS]
//– assign states
state0 = “angry”;
state1 = “eating”;
state3 = “roar”;
if (state != 3 ) {
//– pick one to play randomly
state = random( 2 );
}
//– move the parts
gotoAndPlay( “/mouth_mc:” add eval( “state” add /:state ) );
gotoAndPlay( “/eyes_mc:” add eval( “state” add /:state ) );
gotoAndPlay( “/nose_mc:” add eval( “state” add /:state ) );
[/AS]
“Evil Panda”/Creepy Panda is not currently distributing, but he will be soon … He just needs a catchy brand name and some more interactivity which I have yet to reveal. Contact me if interested.
Print This Post




February 20th, 2008 at 7:47 pm
Evil Panda - perhaps an adversary of Dojo Monkey??
February 20th, 2008 at 8:19 pm
Could be …
February 21st, 2008 at 8:49 pm
Hey,
Nice’n simple use of the tip. A good example for beginners.
Let me link this on original post.
// chall3ng3r //
February 24th, 2008 at 8:32 pm
Sure.
August 11th, 2008 at 5:36 pm
Nice explanation.
Im new to flash lite 1.1 and have some difficulties jumping to frames, maybe someone want to have a look at my code and tell me why it’s not working?
for (i = 1; i < 4; i++) {
newName = “foto” add i;
duplicateMovieClip(”foto”, newName,i);
eval(”foto” add i)._x=10
tellTarget(”foto” add i){
gotoAndPlay(i)
}
}
When i replace gotoAndPlay(i) with gotoAndPlay(2) it jumps to frame 2, why not with i?