A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Flash 8 alpha value for objects is not rounded!

  1. #1
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449

    Flash 8 alpha value for objects is not rounded!

    I just noticed when I traced the alpha value for a Bitmap attached to the stage with attachBitmap that the alpha value which i set to 10 gave a value of 9.765625. When the value was set to 60 it traced 59.765625. Is that intended? It can screw up some scripts, when the alpha value is dynamically changed in increments.
    - The right of the People to create Flash movies shall not be infringed. -

  2. #2
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    alpha is handled within 256 values (0-255).

    The alpha properties work in a range of 0-100 but the end resulting alpha will be based on 0-255.

    In returning the alpha to a 0-100 range, you'll see a difference in value from what you assigned it from the conversion.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  3. #3
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Ok, thanks. Are in this flash version the true alpha values given, since this is the first time I am experiencing this in flash. As far as I remember the older flash versions always gave rounded values.
    - The right of the People to create Flash movies shall not be infringed. -

  4. #4
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    You are mistaken, it has always been like that as far as I can remember.

    If you set the alpha of a movieClip to 60, you get 59.765625 in all versions of Flash.

    Certain values like 25 will return the whole number, maybe you just got lucky and always used those few values :shrug:

    Thats why when doing fading transitions you should always check that the _alpha value is >= or <= the target value, rather than doing an absolute equality check.
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  5. #5
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    This was the first time I noticed. Thanks for the explanation. i did not know how alpha was handled.
    - The right of the People to create Flash movies shall not be infringed. -

  6. #6
    Senior Member Gloo pot's Avatar
    Join Date
    Aug 2005
    Location
    Australia Mate!
    Posts
    874
    I have used tons of absolute equality checks with alpha and i neva notice a thing in flash mx 2004 pro.... i havnt in flash 8 yet...

    I must must have bin a bit lucky, thanks for the tip tho ill remember that for next time
    92.7 Fresh FM for all your South Aussies - Doof Doof music FTW people!

  7. #7
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I think the reason why I never noticed anything is because I normally use 0 and 100, which is 0 and 100. But this time i used 60, 30 etc and then I run into problems.
    - The right of the People to create Flash movies shall not be infringed. -

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