Skip to main content
November 6, 2009
Question

SWF loading another SWF problem

  • November 6, 2009
  • 1 reply
  • 1394 views

Problem: Subsequently loaded SWF files retain the same run time as the first one run even though their duration is different.

This seems like it should be quite a simple task; replacing one SWF with another when the current has finished.

This worked with fine in AS2 and it does also with AS3 but the problem is that the run time of all subsequent SWFs is the same as the duration of the first. This is not a problem if all of the SWFs are of the same length but loading SWFs with different durations produces undesired results.

Examples:

For testing swfFive is 5 seconds long, swfTen is 10 seconds long, and swfFifteen is 15 seconds long.

swfFive loads swfTen,

swfTen loads swfFifteen,

swfFifteen loads swfFive.

During testing we have tried various sequences.

Example 1 (staring the sequence with swfFive):

  • swfFive plays for 5 seconds then loads swfTen
  • swfTen plays for 5 seconds then loads swfFifteen
  • swfFifteen plays for 5 seconds then loads swfFive and so on.

Example 2 (staring the sequence with swfTen):

  • swfTen plays for 10 seconds then loads swfFifteen
  • swfFifteen plays for 10 seconds then loads swfFive
  • swfFive runs and repeats continuously forever because it never gets to the 10 second frame.

We have also tried putting the SWFs into containers (either a SWF that loads the various other SWFs or rotating them into a movie clip) but the same results occur.

This is the code being used in the last frame of each SWF to load the next SWF (with the name of the file to be loaded pointing to the next file).

****

var movieLoader:Loader = new Loader();

movieLoader.load(new URLRequest("swfTen.swf"));

stage.addChild(movieLoader);

stage.removeChildAt(0);

stop();

Any help will certainly be appreciated.

Frank

This topic has been closed for replies.

1 reply

Inspiring
November 6, 2009

Are all clips have same fps?

November 6, 2009

Yep... they are all the same.

Frank

Ned Murphy
Legend
November 6, 2009

How is the initial swf loaded?