Load color from text file...

Ask a Question related to Macromedia Flash, Design and Development.

  1. #1

    Default Load color from text file...

    I'm trying to use loadvariables to load a color from a text file like this:

    loadVariables("colors.txt",_root);
    Jan01.lblDateMemo.textcolor = color1

    The textfile reads;
    color1=0xff0000&color2=0x00f000&color3=0x0000ff

    but it doesn't matter what I set the colors to, I get black

    Any ideas?
    Fain
    Fain Cowie Guest

  2. Similar Questions and Discussions

    1. how to load embedded text file content
      I need to have some unstructured data that is contained in text files compiled into my application, and then be able to access those files from my...
    2. Load data from Text File
      Im am creating a web page and i wish to have a flash and non flash page. To make it easier on me when updating the pages i want to make them both...
    3. using text file to load my cast ......
      I have a projector file that loads a web page first and then a swf movie and then some power point slides.How can I make a text file that shows me...
    4. load a .swf file within current .swf as per value of external text file
      Hi ! I am confused at a point and need help. I just want to load a .swf file within my current .swf file as per the value the external text...
    5. Load Text from Text file with html links?
      Try http://opensource.brajeshwar.com/downloads/dynamictextscroll/ and just change it to your liking, it have html links as far as I can remember. ...
  3. #2

    Default Re: Load color from text file...

    > I'm trying to use loadvariables to load a color from a text file
    > like this:
    >
    > loadVariables("colors.txt",_root);
    > Jan01.lblDateMemo.textcolor = color1
    >
    > The textfile reads;
    > color1=0xff0000&color2=0x00f000&color3=0x0000ff
    >
    > but it doesn't matter what I set the colors to, I get black
    >
    > Any ideas? Fain Cowie
    You have to wait for the variables to load - this doesn't happen
    instantaneously. With Flash MX you can use LoadVars(). This object
    implements an onLoad() event handler.

    Have a look at the following page. Search for the paragraph "Receiving
    using LoadVars.load" you can find some advice there. Furthermore you'll
    find a link to the official information of Macromedia:

    [url]http://actionscript-toolbox.com/samplemx_loadvars.php[/url]
    [url]http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary427.html[/url]

    Best wishes, Martin ;) * [url]http://birdy1976.com/[/url] * ICQ# 237743398
    Martin Voegeli, vom Guest

  4. #3

    Default Re: Load color from text file...

    "Martin Voegeli, vom" <MartinVoegeli@gmx.ch> wrote in message news:<3F4B1126.165CB93F@gmx.ch>...
    > > I'm trying to use loadvariables to load a color from a text file
    > > like this:
    > >
    > > loadVariables("colors.txt",_root);
    > > Jan01.lblDateMemo.textcolor = color1
    > >
    > > The textfile reads;
    > > color1=0xff0000&color2=0x00f000&color3=0x0000ff
    > >
    > > but it doesn't matter what I set the colors to, I get black
    > >
    > > Any ideas? Fain Cowie
    >
    > You have to wait for the variables to load - this doesn't happen
    > instantaneously. With Flash MX you can use LoadVars(). This object
    > implements an onLoad() event handler.
    >
    > Have a look at the following page. Search for the paragraph "Receiving
    > using LoadVars.load" you can find some advice there. Furthermore you'll
    > find a link to the official information of Macromedia:
    >
    > [url]http://actionscript-toolbox.com/samplemx_loadvars.php[/url]
    > [url]http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary427.html[/url]
    >
    > Best wishes, Martin ;) * [url]http://birdy1976.com/[/url] * ICQ# 237743398
    Thanks Martin, but I don't think that is the problem (yet). All of the
    text variables are loaded from beginning to end and assigned.But flash
    seems to assign everything but the hex colors.(at the beginning of the
    text file) If I trace the color variables, they show up unassigned.
    Fain Cowie Guest

  5. #4

    Default Re: Load color from text file...

    Just my two cents here... could it be that the values are detected by
    Flash as strings and not hex numbers when you make the assignment to
    the textcolor property?

    Javi...


    On 27 Aug 2003 10:27:17 -0700, [email]cowiefr@yahoo.com[/email] (Fain Cowie) wrote:
    >"Martin Voegeli, vom" <MartinVoegeli@gmx.ch> wrote in message news:<3F4B1126.165CB93F@gmx.ch>...
    >> > I'm trying to use loadvariables to load a color from a text file
    >> > like this:
    >> >
    >> > loadVariables("colors.txt",_root);
    >> > Jan01.lblDateMemo.textcolor = color1
    >> >
    >> > The textfile reads;
    >> > color1=0xff0000&color2=0x00f000&color3=0x0000ff
    >> >
    >> > but it doesn't matter what I set the colors to, I get black
    >> >
    >> > Any ideas? Fain Cowie
    >>
    >> You have to wait for the variables to load - this doesn't happen
    >> instantaneously. With Flash MX you can use LoadVars(). This object
    >> implements an onLoad() event handler.
    >>
    >> Have a look at the following page. Search for the paragraph "Receiving
    >> using LoadVars.load" you can find some advice there. Furthermore you'll
    >> find a link to the official information of Macromedia:
    >>
    >> [url]http://actionscript-toolbox.com/samplemx_loadvars.php[/url]
    >> [url]http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary427.html[/url]
    >>
    >> Best wishes, Martin ;) * [url]http://birdy1976.com/[/url] * ICQ# 237743398
    >
    >Thanks Martin, but I don't think that is the problem (yet). All of the
    >text variables are loaded from beginning to end and assigned.But flash
    >seems to assign everything but the hex colors.(at the beginning of the
    >text file) If I trace the color variables, they show up unassigned.
    Javier Cerdas Guest

  6. #5

    Default Re: Load color from text file...

    "MOF" <mof_daddy@hotmail.com> wrote in message news:<eYb3b.61469$Kb2.2644754@news010.worldonline. dk>...
    > Nope... the Color.setRGB() support strings as well....
    >
    > These are both valid:
    > myColor.setRGB(0x00FF00);
    > myColor.setRGB("0x00FF00");
    >
    > // Morten
    >
    >
    > "Javier Cerdas" <jdc@mdtsoft.com> wrote in message
    > news:smvpkv4p5pk5oscb096neqc86q9cu5qcbm@4ax.com...
    > > Just my two cents here... could it be that the values are detected by
    > > Flash as strings and not hex numbers when you make the assignment to
    > > the textcolor property?
    > >
    > > Javi...
    > >
    > >
    > > On 27 Aug 2003 10:27:17 -0700, [email]cowiefr@yahoo.com[/email] (Fain Cowie) wrote:
    > >
    > > >"Martin Voegeli, vom" <MartinVoegeli@gmx.ch> wrote in message
    > news:<3F4B1126.165CB93F@gmx.ch>...
    > > >> > I'm trying to use loadvariables to load a color from a text file
    > > >> > like this:
    > > >> >
    > > >> > loadVariables("colors.txt",_root);
    > > >> > Jan01.lblDateMemo.textcolor = color1
    > > >> >
    > > >> > The textfile reads;
    > > >> > color1=0xff0000&color2=0x00f000&color3=0x0000ff
    > > >> >
    > > >> > but it doesn't matter what I set the colors to, I get black
    > > >> >
    > > >> > Any ideas? Fain Cowie
    > > >>
    > > >> You have to wait for the variables to load - this doesn't happen
    > > >> instantaneously. With Flash MX you can use LoadVars(). This object
    > > >> implements an onLoad() event handler.
    > > >>
    > > >> Have a look at the following page. Search for the paragraph "Receiving
    > > >> using LoadVars.load" you can find some advice there. Furthermore you'll
    > > >> find a link to the official information of Macromedia:
    > > >>
    > > >> [url]http://actionscript-toolbox.com/samplemx_loadvars.php[/url]
    > > >>
    > [url]http://www.macromedia.com/support/flash/action_scripts/actionscript_dictiona[/url]
    > ry/actionscript_dictionary427.html
    > > >>
    > > >> Best wishes, Martin ;) * [url]http://birdy1976.com/[/url] * ICQ# 237743398
    > > >
    > > >Thanks Martin, but I don't think that is the problem (yet). All of the
    > > >text variables are loaded from beginning to end and assigned.But flash
    > > >seems to assign everything but the hex colors.(at the beginning of the
    > > >text file) If I trace the color variables, they show up unassigned.
    > >
    Yipee! I stumbled on at least a temporary answer! It was sheer luck. I
    noticed in the Trace panel that the variable had an empty line behind
    it. I remembered reading somewhere that the each variable in a text
    file included a newline and a carriage return. I tried using:

    Jan01.lblDateMemo.textcolor = ParseInt(color1)

    That removes the additional symbols and returns an integer value for
    the color.

    Thanks for your input...
    Fain
    Fain Cowie Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139