-
Buttonless mouse over????
Hi,
I'm relatively new to Flash programming and I have a little problem here:
I'm working on a space game with a galaxy map. My map have 300 independent zones each opening another map with a lot of zones too. Each zones are simple squares.
My question is: Is there a way to get a mouse over on a zone bring some effect without having to create a button? I don't really want to create 300 buttons for the main map and then some thousands buttons for the secondary level maps!
Thanks
-
Add Roll-over to MovieClips without Buttons
Originally Posted by sevynos
Hi,
I'm relatively new to Flash programming and I have a little problem here:
I'm working on a space game with a galaxy map. My map have 300 independent zones each opening another map with a lot of zones too. Each zones are simple squares.
My question is: Is there a way to get a mouse over on a zone bring some effect without having to create a button? I don't really want to create 300 buttons for the main map and then some thousands buttons for the secondary level maps!
Thanks
You can add "rollover" interactivity to a MovieClip. If you put all the zones in a single MovieClip and call that big MovieClip "allZones" then the code below e.target method to assign your roll over state to the child clips.
allZones.addEventListener(MouseEvent.MOUSE_OVER, overIt);
allZones.addEventListener(MouseEvent.MOUSE_OUT, outIt);
function overIt(e:MouseEvent):void
{
e.target.alpha = .8;
}
function outIt(e:MouseEvent):void
{
e.target.alpha = 1;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|