A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: sending Variables from one .swf to an other

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    10
    hi,
    i have a question about flash mx and i hope you'll be able to help me.
    i have a .swf flash file with a variable and another .swf file.
    i need to send the var from one .swf file to the other.
    i tried using [ loadVars.send ] to send it to the other .swf file but it didn't work.
    i also tried sending it to a .txt file and load it with the [ loadVars.load ] from it
    but no success there...
    when i wrote the name of the var i wanted to load, in the .txt file and equaled it
    to somethnig (for example: 1), and then used [ loadVars.load ] in the .swf file
    it worked, the value "1" was in that var in the .swf file.
    the only problem i have is to send a ver from one .swf file to the other .swf file
    if it's not possible is there an other way to do so?
    anyway that's what i did:

    file1.swf (the sender):
    ----------------------

    a button on the main TimeLine:
    on (release) {
    zzz = new LoadVars();
    zzz.dan = "works";
    zzz.send("c:/file2.swf");
    }
    i also tried the same with [zzz.send("c:/file2.swf", "POST");] and with [zzz.send("c:/file2.swf", "GET");]
    didn't work...

    file2.swf:
    ----------

    the first frame of the movie on the main TimeLine:
    zzz = new LoadVars();
    zzz.dan = "not loaded";

    zzz.onLoad = function(success) {
    dann=zzz.dan;
    };

    "dann" is the var of an input text field on the main TimeLine.

    where I went wrong?
    hope you can help me.
    thanks in advanced

    dan

  2. #2
    Registered User
    Join Date
    Aug 2002
    Posts
    10

    reply

    ...

  3. #3

  4. #4
    Registered User
    Join Date
    Aug 2002
    Posts
    10
    dudovcic, thank you for your reply
    but what if i need to send the vars from one computer to an other, on the same server?
    hope for your reply,
    thanking in advanced again, dan

  5. #5
    http://www.macromedia.com/support/fl...ion.htm#domain
    Sorry for late reply (it's holyday)
    The link above talks about localConnection between domains. I've never done it but i think that's what you should investigate.

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