Evil Panda – example of gotoAndPlay frame label tip with Flash Lite 1.1

February 20th, 2008 by Scott Janousek
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

Evil Panda - example of gotoAndPlay frame label tip with Flash Lite 1.1

Faisal 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.

5 Responses to “Evil Panda – example of gotoAndPlay frame label tip with Flash Lite 1.1”

  1. Dale Says:

    Evil Panda – perhaps an adversary of Dojo Monkey??

  2. Scott Janousek Says:

    Could be …

  3. chall3ng3r Says:

    Hey,

    Nice’n simple use of the tip. A good example for beginners.

    Let me link this on original post.

    // chall3ng3r //

  4. Scott Janousek Says:

    Sure.

  5. jw Says:

    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?

Leave a Reply



Readers who viewed this page, also viewed:

Entries (RSS) and Comments (RSS).

© Copyright 1995-2006 scottjanousek.com. All Rights Reserved.
Graphics & Design by Scott Janousek. (Some) icons by Kevin Potts.