Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new bie will award the person for this simple help 1

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I'm new to action scripting in Flash and think I need some help after having spent hours without a clear result.

Suppose I have four buttons and four Movie Clips with instance "one" ,"two" , "three" and "four".
Now I want when I click 1st button, the "one" movie calls and when I click 2nd button the "one" movie should go back slow to its point and then the "two" MC should come smooth on the stage. Similarly I want the same with other buttons. I have tried my best to make this action with scripting but my all efforts are in vain. Any help will be highly appreciated. Thank u.
Can anybody help please? Or does anybody have a similar .fla that I 'd have a look at?
In any case, does anybody know of a url where I'd find some action scripting tutorials?

Thank you everybody for reading this and helping me...
 
Hey I think we are reading the same page in the same book! I can not seem to get past a part in my script. Look at my fla to help you, it may or may not be the right script, I can not seem to have the MC's hidden untill called upon.


 
Here's a quick example that you might find useful -

I've put 4 buttons on the stage - each one when pressed calls up a movie which scrolls on to the stage. If you press another button the previous movie scrolls back to its starting point while the new one scrolls out, you can do this with several movies on the stage at the same time.

If you want to see it...


If you want the source...


It's pretty simple stuff - the buttons set a flag saying which movie should scroll out and then the rest of the script (in the clip marked control) checks to see where each movieClip is, scrolls them out to the centre of the stage if their flag is set or scrolls them back offstage if their flag is not set.
 
Natedeia,
I have been looking at your .fla... The main problem in your case, is a design thing. A bit stuck with the proximity of all your buttons and each of their display, which are roughly in the same area. Will keep working on it!
But it would be easier if your buttons were more of a top navigation bar, with selections that drop down from each button...

As for the visibility, that's easy stuff. Just add a keyframe with a stop action in the first frame of each of your movie clips. Then correct the scripting in your buttons as:

on (rollOver) {
_root.mchardrock._visible = "1";
_root.mchardrock.play();
}

This way, since your mchardrock is stopped, on rollover, you're simply telling it to play until it reaches the other stop action in the mc.

Come to think of it, maybe you don't even need to set the visibility of it, because your mc is in fact invisible in it's first frame, and fades up when it plays. BTW, the usual way to set up your mcs, is to leave a blank keyframe at the beginning of it, with the stop action on it!

No need to set the visibility of the other mcs, since they all stopped also!
The (rollout) can not be used here since obviously, if you roll off the button, the selections will dissapear.

Still working on it...

Will get back to you, although some people here think I don't!

Regards,


mywink.gif
ldnewbie
 
OldNewbie, the second .fla I emailed you is the one i am focusing on and I put this code on the frame which holds the MC's.

{
_root.mchardrock._visible = "0";
_root.mcalternative._visible = "0";
_root.mcbluesjazz._visible = "0";
_root.mcrbrap._visible = "0";
_root.mccountry._visible = "0";
}


This way they all load but are not visable, then the button is clicked and the code will only make one visable.

Hope you get this message, I will email it to ya. Thanks for looking at it, but if you know of a better script let me know too! All is appreciated.
 
By the way New bie, in my example to the link of the .fla, put that code above on the frame where the buttons are. Is this what you are looking for?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top