A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Weird Stuff, possible glitch

  1. #1
    I have a small button and I want the user to be able to scratch it away with their mouse. every time they put they mouse over it, it should decrease the alpha slightly.

    here is my code

    on (rollover)
    {
    if (this._alpha == 100)
    {
    this._alpha = 75
    _root.percentx = 75
    }
    else if(this._alpha == 75)
    {
    this._alpha = 60
    _root.percentx = 60
    }
    else
    {
    this._alpha = 0
    _root.percentx = 0
    }
    }

    percentx is just a varialbe I use to test it. This code works fine the glitch comes when i try to change the 75, if i change it to 80 or 85 or any number higher than 75 it skips the 60. It goes straight from 100 to 80 to 0. WEIRD.

    also If i try to use a const variable instead of the 75's and 60's it wont work at all? any ideas on how i can get that 75 to a higher numbwer like 80 or 85?


  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    148
    Stick this on the button:

    on (rollover)
    {
    this._alpha -= 10
    }

    change '10' to whatever you want (depending on how quickly you want to to change)

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