A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Colouring... Help

  1. #1
    Junior Member
    Join Date
    Nov 2002
    Posts
    25

    Colouring... Help

    Hello,

    I have the following code

    Code:
    			
    myColor = new Color (this.snow);
    myColor.setRGB(0xff0000);
    now that code works create BUT in a text file I have a varible

    &scolour=0xff0000

    now flash knows the value, because I have tested it with the trace function and it shows "0xff0000".

    now what I want is to use that varible "scolour" rather than hard coding it. but the following doesnot work.

    Code:
    			
    myColor = new Color (this.snow);
    myColor.setRGB(scolour);
    any ideas anyone, im sure its very simple I just cant get it working!

    Thanks

    Andrew

  2. #2
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    When you load it, flash thinks this Color is a String,
    so you would have to put:

    scolour=parseInt(scolour);

    in before using it as a Number.
    BUT: The Color-Object is deprecated since Flash8!
    Try testing around with the ColourTransform Object

  3. #3
    Junior Member
    Join Date
    Nov 2002
    Posts
    25

    Talking

    thats great thnx alot for the answer and the fast reply

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