A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Buttonless mouse over????

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    3

    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

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    106

    Add Roll-over to MovieClips without Buttons

    Quote Originally Posted by sevynos View Post
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center