A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: loadVariables and MIME

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    21
    Using the loadVariables command, the data in the text file must be in the MIME format. Although I am able to write a basic file with as many variables as I need, I was wondering if there was an operators other than '&' and '+', that would make other things possible with the files. For example, being able to make the variables as an expression, rather than a string, when you load them into Flash.

  2. #2
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    The text file stores variable value as string.

    I wonder why do you want to store expression to a text file ? Can you give me an example ?

  3. #3
    Junior Member
    Join Date
    Jan 2001
    Posts
    21
    I want my variable as an expression so that I can perform math functions on it and numerical equalities. I am also interested in any other operators available to beused in the text file.

  4. #4
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    I think that, saving should save data only. Conversion of data type or Expression should be done in script.

    No operator is allowed in the text file except "=";

    When Flash load the text file, it parse only "&" and "=". And then do the assignment. Simple.

    If we let it do the work like compiler do, parse all keyword and operator, it would be a big job.

  5. #5
    Junior Member
    Join Date
    Jan 2001
    Posts
    21
    Perhaps you are not understanding me clearly. Using the syntax

    &myvariable=number&

    using loadVariables creates the variable as a string. It is possible to convert the string to an number expression in Flash using newNumber. I have over 1000 varaibles in my text file, being taken from a database, and I do not particularly wish to have to set up complex loops and pages of script to convert some of the variables to numberical expression and leave the others as strings. As yet I have found no answer to set data types clearly in the MIME format, but clearly it would be far easier to define the varaibles as I need them in the text file before they are loaded.

  6. #6
    Senior Member
    Join Date
    May 2001
    Posts
    1,838
    It is Flash that makes such restriction. Not MIME format.

    If you want to store a "string" of 26 characters like:
    'my number=32+n2/3 & 8-n3' into a variable myVar, there is still no problems for MIME format. Just use escape(). Of course, after loadVariables, it is still a string not expression.



  7. #7
    Junior Member
    Join Date
    Jan 2001
    Posts
    21
    Hmm.. annoying to say the least. Its a shame that Flash does import variables this way, since it requires a lot of effort to convert thousands of strings into expressions inside Flash.

    I think Flash 6 would be much better using a format of its own in drawing variables from text files. But that's just my opinion

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