A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Loading Color from external txtFile

  1. #1

    Loading Color from external txtFile

    Hi,

    I'm trying to load the value of a color (for a background MC) from an external txtFile.
    In the file there's something like
    Code:
    _root.theColor=0x1F1229
    In the AS:
    code:

    backColor = new Color(_root.mcBack);
    backColor.setRGB(_root.theColor);



    Pitty, does not work. How should I do this?
    It works fine when I give the value of the color in the AS...

    thx for helping,
    Genius
    Genius is one percent inspiration and 99 percent perspiration.

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    in the text file you should have:
    Code:
    &theColor=0x1F1229&
    , if you use loadVariables() or loadVariablesNum().

    You have to preload the variables, to make sure it's avaiable when you try to use it.
    I suggest you read loading variables

    Here's an example with LoadVars(), the preferred way...
    Attached Files Attached Files

  3. #3
    thx, works perfect !
    Genius is one percent inspiration and 99 percent perspiration.

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