A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Easy question

  1. #1
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    Cant load in colour variable from either flast text file or database.
    eg:
    say I want use setRGB and so load in 0xFF6600 , no matter what I try this will not work.
    The question therefore is , how do I explode this string into a readable number.
    ?????????????????????????????????????????????????? ?????
    I know its stupidly easy but it just wont work.

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    I think
    Number(rgbval.substr(2), 16)
    should work.


    Musicman

  3. #3
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    Thanks musicman,
    Ithought about that one but because i'm using 0xRRGGBB setRGB system it will not evaluate it to a number. I presume that if I set the color using the full setTransform method it would do it because these only use numbers. I really wanted to do it with the 0xRRGGBB system.
    The call just wont work inside any "" or text fields.
    I figured this must be a way for MM to disallow the process. ( Or am I overly SUS),
    Any other ideas-- normally a good ole eval should do the trick but Nay.

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    it should really work this way...
    I just checked with the F5 manual, and there it is parseInt()
    so split off the 0x, and then use parseInt('RRGGBB', 16)
    I believe MX accepts the number base on both Number and parseInt functions

    Musicman

  5. #5
    go blues ! audas's Avatar
    Join Date
    Oct 2000
    Location
    london ,piccadily circus!
    Posts
    665
    Thanks Music man
    This sounds like it

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