A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [F8] Defining a Numbers bit length??

  1. #1
    Senior Member
    Join Date
    Jun 2002
    Location
    Manchester, UK
    Posts
    2,357

    [F8] Defining a Numbers bit length??

    Hey guys & girls,

    I was wondering if it was possible in F8 to define a Numbers bit length..for example: I might want a number to go up to a maximum hex value 0xFF, which is a total of 8 bits "11111111", but if I was to increment the value it would become "100000000", I was wondering whether the Number could stay at a length of 8 bits thus resetting it to 0x00. It doesn't appear that this is possible without using the '&' operator but it would be faster for something i'm testing out!

    Any ideas?? Cheers

  2. #2
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    You could just "watch" that value, then when set if the number is greater than 2^8 or whatever, return 0. Or else return value.

  3. #3
    Script kiddie VENGEANCE MX's Avatar
    Join Date
    Jun 2004
    Location
    England
    Posts
    2,590
    Quote Originally Posted by RipX
    Hey guys & girls
    On Flash Kit?

    ...

    Where?
    http://www.birchlabs.co.uk/
    You know you want to.

  4. #4
    Heli Attack! iopred's Avatar
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    923
    I think you solved your own puzzle, theres no way I know to specifically limit the size of Number. uint and int are a bit smaller in AS3, but apart from that, just & your number with binary 1111 to keep your number at 4 bits etc.
    Christopher Rhodes
    squarecircleco.

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