A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: variables in embedded .swf s

  1. #1
    Junior Member
    Join Date
    May 2004
    Location
    Isle of Man
    Posts
    14

    variables in embedded .swf s

    Can anyone help me with this - PLEASE.

    I'm using a master .swf with navigation code to control a number of slave movies. If only!

    I've stripped it down into two simple .swfs and I still can't get it to work.

    In my master I have an empty movieclip and I want to load a slave .swf into it. This bit works fine with code of the form

    holder_mc.loadMovie("slaveMovie.swf");

    In my slave movie there is a frame label "blue" and a test variable. I want the master movie to be able to access the variable and move the slave movie to the "blue" frame:

    // below currently returns undefined and goto is ignored
    trace ("holder_mc.testVariable = "+holder_mc.testVariable);
    holder_mc.gotoAndStop("blue");

    in the slaveMovie are the actions:

    var testVariable:String = "success";
    stop();

    Please could someone have a look at the files and tell me how I could make them work. The success of my project rather hinges on .swfs being able to talk to each other.

    Thanks lots.
    Attached Files Attached Files

  2. #2
    disMemberEd Skorp|oN's Avatar
    Join Date
    Mar 2001
    Location
    Romania
    Posts
    167
    Ok, here's your problem: you tell Flash to load the swf, then right away ask him about the variables, and he looks for them faster than it can load the swf, even from the harddrive. For a simple test, insert a couple of more frames and put the trace actions on the last keyframe (and a stop on it). That should clear you up.
    "On a long enough timeline, the survival rate drops to zero."
    "The Flash timeline is long enough."

  3. #3
    Junior Member
    Join Date
    May 2004
    Location
    Isle of Man
    Posts
    14
    That did the trick! You're a star - really appreciate it.

  4. #4
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Last edited by nunomira; 05-28-2004 at 01:08 AM.

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