dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Mouse Leave Stage

  1. #1
    Senior Member
    Join Date
    Nov 2006
    Posts
    162

    Mouse Leave Stage

    I know we can track when the mouse has left the stage area in AS3.

    But, can it reset a button that would have stayed in its "on" state?

    My swf will be embedded in a web page, there are 24 buttons all around its border, and as soon as the mouse leaves the stage, they stay "on", so I want to reset them to the initial state.

  2. #2
    WohOoooooo zompo's Avatar
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    138
    Could you not just loop all the buttons and if the state is "on" set them to "off", and add that to where you track the mouse leaving the stage area.

    ______________
    www.bombwar.com - A new mass player online game (as3/php)
    blog.bombwar.com - Progress reports and more

  3. #3
    Senior Member
    Join Date
    Nov 2006
    Posts
    162
    What do you mean by loop all the buttons? I am not sure to understand...

  4. #4
    WohOoooooo zompo's Avatar
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    138
    if you have 24 buttons around the border then you could check every button when the mouse leave the stage.

    like, when adding the buttons to the stage, also add them to a array

    buttonarray.push(btn);

    then when the mouse leave the stage just

    for (var i:int = 0; i < buttonarray.length; i++)
    {
    // check if button state is "on"
    // if true, set the state to "off"
    }

    dunno if this is dumb way to do it though

    ______________
    www.bombwar.com - A new mass player online game (as3/php)
    blog.bombwar.com - Progress reports and more

  5. #5
    Senior Member
    Join Date
    Nov 2006
    Posts
    162
    thanks! It makes sense for me.

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