A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Button states-won't stick

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Location
    Hannover, Germany
    Posts
    164

    Button states-won't stick

    Hi, I've been stuck on this problem for a while and can't for the life of me figure out why I can't get it to work. I have buttons in my project that are mcs. I have rollOver, rollOut and onRelease actions on them, targeting the mc with

    mc1.onRelease=function(){
    //do this
    }
    I would also like, when pressed and released, that the buttons(mcs) stay in an "active" modus until one of the other buttons is pressed. I tried going around this by using another mc that looks like the rollover, setting the visibility to false at the beginning and then true inside of the button handlers. Then, I change the x value in the onRelease handlers. It's turning out not to be very reliable and sometimes works on the first click, sometimes not at all...IS there a reliable way to do this? I have searched the forums and haven't found anything yet. (I am on Flash MX 2004 Prof)

    Thanks,
    miakazi

  2. #2
    Senior Member
    Join Date
    Mar 2004
    Location
    Plymouth, UK
    Posts
    125
    when you say "active" modus d'you mean constantly running that function when active?
    www.joeprice.co.uk - it's me!
    www.desktopwallpapers.co.uk - Cool Desktop Wallpapers from around the world
    www.multimedia-house.co.uk - the funky multimedia house
    www.wallpaperjoe.com - my photos as desktop wallpaper

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Your workaround should be working fine...

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Although horizontal in your case, same as this vertical Macromedia example...
    Last edited by oldnewbie; 12-02-2004 at 09:29 PM.

  5. #5
    Senior Member
    Join Date
    Oct 2000
    Location
    Hannover, Germany
    Posts
    164
    Hi guys,

    Thanks, I had a function checking the visibility of the active mc and was calling it in my button onRelease function. I tossed that and just turned on visiblity of the mc instead. Now it's working perfectly. Most of the time a straightforward workaround is the best!

    mikazi

    ps: I'd still be interested in figuring out how do do this with one mc- three states and a code that is reliable! Is:
    myButton.onRelease=function(){
    if(this.hitTest(mouse._x,mouse._y)){
    //my actions
    }else{
    //other actions
    }
    }
    better than a normal onRelease? I've read different things...thanks!

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