A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: loading variables from swf directly to the txt

  1. #1
    Member
    Join Date
    Apr 2006
    Posts
    32

    loading variables from swf directly to the txt

    hey. Please tell me how can i load variables (or vars) in txt file, for example from the inputtext box, if i have both txt and swf file on a local computer

  2. #2
    Graphic Guy
    Join Date
    Dec 2006
    Posts
    39
    mmmm, the easyest way is to use the shared object, read help arround forums.
    Dario [3D Animation Filmmaker, Graphic Designer (Artist?)]

  3. #3
    Member
    Join Date
    Apr 2006
    Posts
    32
    sorry, i don't exactly understand what do you mean could you give me a link of that place?

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    the simplest example of loading a variable from a text file is -
    Code:
    //new movie -- frame#1
    lv = new LoadVars(); // create a LoadVars Object
    
    lv.onLoad = function(){  // function called when txt file load is complete
    trace(lv.test); // output - this is a test
    myTextField.text = lv.test; // myTextField - instance name of textfield
    };
    
    lv.load("test.txt");  // load the txt file into the LoadVars Oject
    
    /* --test.txt--
    &test=this is a test&
    */

  5. #5
    Member
    Join Date
    Apr 2006
    Posts
    32
    thank you very much, but i suppose, this is the script of loading variables into swf from txt, but i need the reversed function, loading vars into txt file from dynamic textbox or something like that



    sorry this script doesn't even work, i created txt document test.txt in the same directory and wrote inside "gamarjoba", but it doesn't even make a trace action
    Last edited by zazuna; 12-24-2006 at 06:17 PM.

  6. #6
    Graphic Guy
    Join Date
    Dec 2006
    Posts
    39
    ok, the a_modified_dog's example does work but you need to read what it says to understand what to do, you know the par that says
    Code:
    /* --test.txt--
    &test=this is a test&
    */
    goes within the txt file named test.txt

    tou're right abot it loads vars into flash, what you want to do can't be done without an external script or program, but if you don't mean if it is not a txt file use shared objects.

    here's a link that may help you:
    http://livedocs.macromedia.com/flash...=00002661.html
    please, read ALL the document and try to understand it before come back and ask again, not as you did with a_modified_dog's example.

    Good luck.
    Dario [3D Animation Filmmaker, Graphic Designer (Artist?)]

  7. #7
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    this thread might help if you are saving data to a server side file

    http://board.flashkit.com/board/show...ht=save+server

  8. #8
    Member
    Join Date
    Apr 2006
    Posts
    32
    Quote Originally Posted by darioco
    ok, the a_modified_dog's example does work but you need to read what it says to understand what to do, you know the par that says
    Code:
    /* --test.txt--
    &test=this is a test&
    */
    goes within the txt file named test.txt

    tou're right abot it loads vars into flash, what you want to do can't be done without an external script or program, but if you don't mean if it is not a txt file use shared objects.

    here's a link that may help you:
    http://livedocs.macromedia.com/flash...=00002661.html
    please, read ALL the document and try to understand it before come back and ask again, not as you did with a_modified_dog's example.

    Good luck.
    ok i did it so, how there is written in the a_modified_dog-s example and why does it not work?
    Last edited by zazuna; 12-26-2006 at 10:18 AM.

  9. #9
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    hope the attached file will help

  10. #10
    Member
    Join Date
    Apr 2006
    Posts
    32
    oh now i understand, thanks a lot, you're super

  11. #11
    Banned
    Join Date
    Dec 2006
    Posts
    18

    Re:

    I also happens to me. I would appriciate your help too.


    ========================
    video applications,
    there're people who say
    they can see visions
    with tarot reading
    www.tarotcard-psychic.com
    i would like to stream that

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