A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: loadVariables and data types

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    21
    Is there a way to use loadVariables and get expressions rather than literal strings?

  2. #2
    Junior Member
    Join Date
    Jun 2001
    Posts
    1
    Yeah, I'm having problems with this as well, loading a variable from an external text file:-

    value=1

    brings it into Flash as value="1"

  3. #3
    Junior Member
    Join Date
    Jan 2001
    Posts
    21

    bah

    I cannot understand why Flash does it by default. To me it seems a lot easier to define the variables as expressions by default, since putting " " around a variable in the text file defines it as a string very easily.

  4. #4
    Junior Member
    Join Date
    Jan 2001
    Posts
    21

    Smile ahah!

    Just after writing my last post I found a roundabout way of making the string into a number. Calling the variable value=1 from the text file info.txt, the newNumber command can be used to make it into a numerical expression. Ignoring the loading time, here's the overall code you need to get the variable out of the text file as a number.

    Code:
    loadVariables ("info.txt", _root);
    truevalue = newNumber ( value );
    If anyone has a way of putting the variables into the text file in such a way that Flash will automatically make it into an expression when loaded from the text file, it would be appreciated.

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