PDA

View Full Version : movie clip newbie question. I need help controlling it


cgulotta
10-25-2005, 09:42 PM
I have a movie clip containing a simple animation. I have placed it in the main timeline but don't want it to start playing until I press a button that starts it. I am not sure what script to use.
If I put a stop(); action in the movie clip then the animation doesn't play at all.
I apologize if this is basic flash knowledge but i'm just starting out.

-christina

amen0
10-25-2005, 09:52 PM
you need to put this code in the Action panel of your button
on(release){
_root.MovieInstanceName.gotoAndPlay(2);
}

CyanBlue
10-25-2005, 09:52 PM
Howdy and Welcome... ;)

Here is the easiest one I can think of...

cgulotta
10-25-2005, 10:02 PM
it works!!! now can i use that same button to trigger a second animation to pop on top of that?

Here's my deal. I am working on a TV series where I need to simulate someone trying to crack a password. When i clicked that first button a fake password shows up. (this works!) Now I need to press hopefully that same button and have another movie clip animation appear.

any help would be appreciated.

-cg

amen0
10-25-2005, 10:43 PM
i modified CyanBlue Code a little bit see if that what you want.

cgulotta
10-25-2005, 10:55 PM
i was able to open the previous one but not the modified one. i did see the swf file and i think it will help so please send again!!

-ch

amen0
10-25-2005, 11:13 PM
soory was saved in flash8
here's one in MX2004

CyanBlue
10-25-2005, 11:19 PM
Good job, amen0... Thanks for your help at the forum... ;)
Let me delete the F8 file to reduce any unnecessary traffic...

cgulotta
10-25-2005, 11:36 PM
the file works great and i looked at your scripts
and just want to make sure i understand

"showFakePass" is a variable you created

but where does fakePass come in? am i this silly?
i'm a bit confused

chrisitna

ubergrafik
10-26-2005, 12:34 AM
"showFakePass" is the VALUE of the variable called test. It's initial value is "showFakePass".

On the second line of the script, there is a function associated with the play_btn button. The script checks to see what value the variable called test has.
Becuase the initial value is "showFakePass", the script tells the text box on the stage called fakePass, to display a piece of text that says "fakePass", and then sets the variable called test to "playAnim"

Now, any time the button is pressed again, because the variable called test has a new value, "fakePass", the script tells the movieclip animation_mc to play.

If you can understand this stuff, it will set you up for many powerful things. It is a very worthwhile thing to get to grips with, and having a piece of code to play with always helps. Please ask many questions!

Good luck.