How to make an image appear when hovering over text in Flash cs3?
Question
How would the .fla that has text and when mouse is over that text an image appears look like?
I was thinking to make the text a button and then add some script....
La solution
This is relatively simple
First, you'll need to make a MovieClip symbol containing your text.
Give that symbol instance a name (say mClip1
)
Then, import your image and create a symbol from that too. Name it (e.g. img1
)
Then, hide the image
img1.visible=false;
Next, add the MOUSE_OVER and MOUSE_OUT event listeners to mClip1
mClip1.addEventListener(MouseEvent.MOUSE_OVER, mOver);
mClip1.addEventListener(MouseEvent.MOUSE_OUT, mOut);
Finally, declare those event listeners and define them
function mOver(e:MouseEvent):void {
img1.visible=true;
}
function mOut(e:MouseEvent):void {
img1.visible=false;
}
Download the demo file (Flash CS5) from http://www.uploads.sc/download.php?file=749ce36c801a9bf18ce1b5033d8fd82f
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow