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!

rollover question

Status
Not open for further replies.

manfishj

Programmer
May 30, 2002
44
US
I know there probably is a simple answer for this, but I can't seem to figure it out.

I have a page where, on the left side are thumbnails of the other pages. What I need is for the user to be able to put the mouse over a thumbnail...then on the right side of the page, I would like a bigger thumbnail to appear. What is the actionscript that I would use? I don't know if I can just have the bigger thumbnails in the library or if I actually have to have them on the stage, but invisible.

If anyone can help steer me in the right direction, I'd appreciate it. Thanks.

manfishj
 
Make the pictures on the left into Buttons and make the bigger pictures on the right into Movie Clips.
Set the alpha of the movie clips as 0% and give them whatever instance names you want.
Add actions to the buttons which say:

on (rollOver) {
setProperty (_root.thumbnail1, _alpha, "100");
}
on (rollOut) {
setProperty (_root.thumbnail1, _alpha, "0");
}


Replace thumbnail1 with whatever movie clip (instance) you want to appear.

Let me know if you need any more help.

Regards
 
You wouldn't need the setProperty part either...

on (rollOver) {
_root.thumbnail1._alpha = 100;
}
on (rollOut) {
_root.thumbnail1._alpha = 0;
}

...Less typing!
Regards,

oldman3.gif
 
Thank you both. It worked great. One more question, if you don't mind...

If, for example, I have 20 small thumbnails on the left side of the page, I would need to have 20 big thumbnails on the right side with the alpha level set to 0. Is there any way, with actionscript, to set all of the levels to 0, without doing 20 lines of script? Can I specify a range? Thanks in advance.

Also, I still haven't gotten anywhere with my "rollover state" posting from the other day. Any idea how to do that?
 
Sorry I took so long to respond, but....Thank you both. That completely solved my problem!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top