PDA

View Full Version : Need Help With On Mouse Rollover


Coleman
10-30-2001, 07:14 AM
I want that when i rollover an image I want it to zoom so it gets bigger. I converted the image to a button so i could do some action. Anyone that knows?

And i really need to know how i do an image/text (dont care) that appears only when im over an object (Rollover)

Thanks

poab
10-30-2001, 03:29 PM
Hi,

Rollover is easy. Just rescale the image in the overstate of the button, by double clicking on it. If you want it to grow slowly, you could make a MC with a tween of the animation and place this on the overstate of the button. If that's not satisfying enough, make the entire button as an MC with an invisible button (delete everything in the upstate frame) on the bottom layer. Now, create the tween of the button growing larger but don't use the button, use the graphic for it, but the button itself stays invisible. Put a stop() action on the first frame and the final fram of the growing animation. Label frame two 'grow' and place the following code on the invisible button:

on(rollOver){
gotoAndPlay("grow");
}
on(rollOut){
gotoAndPlay("shrink")

Now you've done this the button will appear to grow. Follow the same process for the shrinking, but instead of putting a stop action on the final frame put:

gotoAndStop(1);


The invisible button should not stretch the length of the MC, rather it should occupy one frame in the three positions you have stop() actions.

The advantage this has over placing a MC on the overstate of the button is that you can have a grow and shrink animation and the animation won't stop if someone rolls off half way through, it will complete itself and then shrink immediatly.

__________________________________________________ __________

Visibility is also a doddle.

Take your image/text etc. and put it in a MC, giving it an instance name in the instance panel (for example 'hiddenMC').

On your button place the code:

on(rollOver){
hiddenMC._visible = true;
}
on(rollOut){
hiddenMC._visible = false;
}

The default of the '_visible' property is true, so somewhere along the way, before it's due to appear (like the first frame of the movie) you need the actionscript:

hiddenMC._visible = false;




If you're combining both these things then remeber the buttons are now inside MCs so you need to add _parent. to the front of the path for example:

_parent.hiddenMC._visible = true;

cheers

Coleman
10-30-2001, 04:34 PM
Im sorry im stupid but i have to ask...What the ")"" does mc mean? Movieclip or what?

geak
10-30-2001, 05:37 PM
Yes in all forums people either refer to MovieClips as MCs or just clips.

Coleman
10-30-2001, 05:52 PM
check at the end! It isnt invisible...
Thanks man. You have been alot of help but this one is
hard...Just rename the picture to *.fla!

Coleman
10-30-2001, 05:56 PM
check at the end! It isnt invisible...
Thanks man. You have been alot of help but this one is
hard...I really need your help on this one.
http://www.hogsby.net/user/coleman/movie2.fla
:cool:
If it doesnt work...Try after 2/3 minutes...Im uploading it now...
See ya!