View Full Version : Make movie-clip visible on mouseover
DimFish
06-04-2007, 01:13 PM
Hi,
I am fairly rusty with Flash....just can't think/remember how I can do this. I have a flash movie, and have made a little movieclip to. So I want the movie clip to be hidden and just become visible when the user mouseovers anywhere on the movie. The whole movie will be the link.
How do it set that up?
Thanks for any help!
_Aerospace_Eng_
06-04-2007, 01:32 PM
This should point you in the right direction
clip2._visible = false;
clip1.onRollOver = function()
{
clip2._visible = true;
}
clip1.onRollOut = function()
{
clip2._visible = false;
}
clip1 is the instance name of the larger movie clip, and clip2 is the instance name of the smaller movie clip.
DimFish
06-04-2007, 04:48 PM
Thanks AE.
I'm not sure...do I just put that into an action on the keyframe where my movieclip has been placed?
Also, have realised, what I need is this:
On mouse-over of my main Movie (RDindexmovie), clip2 becomes visible and starts.
On mouse-off of my main Movie, clip2 becomes invisible and stops/resets to beginning.
My Movie plays on regardless.
At the moment I have:
button._visible = false;
RDindexmovie.onRollOver = function()
{
button._visible = true;
}
RDindexmovie.onRollOut = function()
{
button._visible = false;
}
Doesn't do anything. What am I doing wrong?
Thanks for your help AE.
akastar
06-04-2007, 05:43 PM
On a new layer in the time line you can paste this code, it can be independant of the objects, but will only work if the objects appear on the same frame number as the code.
/////////////////////////
clip2._visible = false
RDindexmovie.onRollOver = function(){
clip2._visible = true
clip2.gotoAndPlay(1)
}
RDindexmovie.onRollOut = function(){
clip2._visible = false
clip2.gotoAndStop(1)
}
/////////////end code
remember if nothing works then check the instance name because it is what links everything together, you can use the target icon in the actionscrip panel to help you get the correct path to the objects.
DimFish
06-04-2007, 06:31 PM
Thanks Akastar.
I gave that a try but doesn't seem to work.
My clip is called arrow. Main movie called RDindexmovie.fla. I have:
arrow._visible = false
RDindexmovie.onRollOver = function(){
arrow._visible = true
arrow.gotoAndPlay(1)
}
RDindexmovie.onRollOut = function(){
arrow._visible = false
arrow.gotoAndStop(1)
}
Arrow clip is visible at outset and just plays as normal. No rolloever effect. I have the code above on a keyframe in frame2 in main movie, the arrow clip is dropped in from keyframe 1 onwards on lower layer. Sound ok?
_Aerospace_Eng_
06-04-2007, 07:57 PM
Make a new layer, call it actions, lock this layer and put your actionscript there. If that doesn't work then you are likely doing something else wrong and we would need to see your .fla file.
akastar
06-06-2007, 02:20 PM
I used the code to construct what I believe you are looking for and compressed the FLA (8 and mx) it into a Zip file, its also available on this hosting site if the attachment doesn't work
http://www.mediafire.com/?4tl0izkyjwm
please note arrow is a resevered word and was replaced with mcArrow.
-Aka
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.