Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to use a <strong>Loader</strong> instead of the <strong>navigateToURL</strong> function. You can create a Main movie to load each external swf and add in the main stage when the download complete.</p> <p>Use the following code to automate the process:</p> <pre><code>import flash.display.Loader; import flash.events.Event; import flash.events.MouseEvent; // Vars var currentMovieIndex:uint = 0; var currentMovie:Loader; // Put your movies here var swfList:Array = ["swf1.swf", "swf2.swf", "swf3.swf"]; // Add the event listener to the next and previous button previousButton.addEventListener(MouseEvent.CLICK, loadPrevious); nextButton.addEventListener(MouseEvent.CLICK, loadNext); // Loads a swf at secified index function loadMovieAtIndex (index:uint) { // Unloads the current movie if exist if (currentMovie) { removeChild(currentMovie); currentMovie.unloadAndStop(); } // Updates the index currentMovieIndex = index; // Creates the new loader var loader:Loader = new Loader(); // Loads the external swf file loader.load(new URLRequest(swfList[currentMovieIndex])); // Save he movie reference currentMovie = loader; // Add on the stage addChild(currentMovie); } // Handles the previous button click function loadPrevious (event:MouseEvent) { if (currentMovieIndex) { // Fix the limit currentMovieIndex--; // Decrement by 1 loadMovieAtIndex(currentMovieIndex); } } // Handles the next button click function loadNext (event:MouseEvent) { if (currentMovieIndex &lt; swfList.length-1) { // Fix the limit currentMovieIndex++; // Increment by 1 loadMovieAtIndex(currentMovieIndex); } } // Load the movie at index 0 by default loadMovieAtIndex(currentMovieIndex); </code></pre> <p>Dowload the demo files here: <a href="http://cl.ly/Lxj3" rel="nofollow">http://cl.ly/Lxj3</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload