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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MC in a button's over state... how to keep it on? 1

Status
Not open for further replies.

xombii

Programmer
Mar 21, 2001
13
0
0
US
I have a button with a short mc as its "over" state.
The mc plays fine as long as the mouse is held over the button, but I'd like it to play through and stop once moused over, even if the mouse is then moved off of the button. Does that make sense?

I'm pretty good with Flash, but sometimes the obvious escapes me... its that darn middle ground between newbie and master that seems to stretch on and on and on...
 
You will not be able to have that work, if you add the mc while editing the over state of your button. Since there's no "off" state, if you will, obviously as soon as you roll off the button, the mc on the over state will dissapear. Those (button & mc) will have to be both dragged on stage from the library, the mc given an instance name, and then controlled from the button. To do that, simply right-click your button, chose Actions in the menu, and in the Object Actions box that'll come up, just add an action like this:

on(rollover){
_root.yourmcthisinstance'sname.play();
}

This will have the mc play on condition that you had a stop action on it's first frame (preferably on a blank keyframe - so that the mc is invisible when your movie loads!), and it should stop at the end if you have added a stop action on it's last frame. If you didn't, it will loop back and start over, stopping on the first frame since there's a stop action.

Much more control is possible, but get this working before you move on.

Regards,

mywink.gif
ldnewbie
 
Thanks, I'll give that a try. I'm not to hot with the action scripting, but that one looks easy enough.

I can see why your name tops the experts list!
 
Oldnewbie

Well, I got that to work just like I was thinking it would, but now I've encountered another problem...

Here's where I'm trying to go with my end result.

Imagine a dot that appears to rise up (zoom or expand) when you mouse over it, then falls with a little "bounce" back to its regular state. That's the part I got to work doing what you suggested. Now, I want a line of dots that do that. Dragging multiple instances of the "bouncing dot" mc onto the stage didn't do it. Any one of them I touched only made the original react.

Any further ideas on how I can accomplish this?
 
If you want to use the exact same mc for several buttons, you should drag that mc from the library, as you did, but assign it a different instance's name and refer to that specific name in the actionscript of the corresponding button.
If, for some reason, you want to change the appearance of one movie clip, you should make a copy of your original mc(right-click on it in the library, and hit Duplicate), edit that one, and then drag this new one in place. If you edit the original movie clip, and for instance change the color of the dot, then all instances of this original mc (even if they have different names) will show the change.

Once you get this working, I can show you how to use reverse play, so that on a quick rollout, the dot reverses back to it's beginning position from the point it was at, rather than to have to complete the animation cycle!
If this makes any sense to you!

Regards,
mywink.gif
ldnewbie
 
Cool... okay, I won't have time to try this today, but its first on my list tomorrow. This isn't for anything in particular, I just have interesting ideas sometimes but lack the know-how to make the tangible.

My "what I want to do" is far exceeding my "what I know how to do" in Flash and unfortunately, I haven't seen many tutorials that cover anything beyond how to do the basics. Flashkit has some cool stuff, but my ideas seem to be a bit off the norm...

Thanks for your help!
 
If, for some reason, you want to change the appearance of one movie clip, you should make a copy of your original mc(right-click on it in the library, and hit Duplicate), edit that one, and then drag this new one in place. If you edit the original movie clip, and for instance change the color of the dot, then all instances of this original mc (even if they have different names) will show the change.

this is all new to me old..i have never been able to change a duplicate of a movie clip and have it not effect the original..

explain this to me?
e.gif


carlsatterwhite@endangeredgraphics.com
 
What is there to explain? You make a copy of a mc... Rename it... Edit it... Drag this new renamed copy on stage and bingo! Done!
What more explanations do you want?

Regards,
mywink.gif
ldnewbie
 
doesn't work in my flash..weird...
e.gif


carlsatterwhite@endangeredgraphics.com
 
dude are you sure?..because it is impossible..atleast on my computer..duplicated mc..renamed..edited..

because of the fact that regardless of re-naming the mc you are still modifying the same symbol inside the mc..

and after saying that what i did find out ( just went and checked ) is that if ya want to duplicate the mc and re-use it you have to also duplicate all of the symbols inside the clip and re-place them with the duplicated..

so thanks for making me think...i think!
e.gif


carlsatterwhite@endangeredgraphics.com
 
Don't understand what you're saying!
When you duplicate a movie clip, you're duplicating all of it's content. If you edit this new copy and change one or more objects in it, it shouldn't affect any instance of the original movie clip. Obviously, if you go in your project and edit an instance of the original movie clip, it will affect all instances of the original mc.

Send me a short .fla example of where you can't change an instance of a new copied mc without changing all instances of the oiginal mc... I'd like to have a look at it!

Regards,
mywink.gif
ldnewbie
 
old just trust me bro..if you have any faith at all in your prodigy, i'm telling ya, atleast for me, i cannot just duplicate a mc and then edit the duplicated re-named version...without first duplicating the symbols inside that mc and replace with the new one's..
e.gif


carlsatterwhite@endangeredgraphics.com
 
If you say so man!
When you say symbols inside that mc, are you by any chance, talking about other nested mcs and/or other objects like back or close window buttons of which you've used other instances of elsewhere?

Regards,
mywink.gif
ldnewbie
 
dude i give up!!

off for vacation for a couple days..you guys have fun!!

e.gif


carlsatterwhite@endangeredgraphics.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top