Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

pass variable to swf from html to load image

Guest
Mar 10, 2015 Mar 10, 2015

   var current_loader:Number = 1;

   var current_img:Number = 0;

   this.createEmptyMovieClip('img_01', 999);

   this.createEmptyMovieClip('img_02', 998);

   img_01._x = img_01._y = img_02._x = img_02._y = 20;

   var loader:MovieClipLoader = new MovieClipLoader();

   var listener:Object = new Object();

    listener.onLoadStart = function(target_mc:MovieClip) {

       }

    listener.onLoadProgress = function(target_mc:MovieClip, numBytesLoaded:Number, numBytesTotal:Number) {

          }

    listener.onLoadComplete = function(target_mc:MovieClip) {

         if(target_mc._name == 'img_01'){

            img_02._visible = false;

        } else {

            img_01._visible = false;

        }

         }

var interval:Number = setInterval(load_image, 1000);

function load_image() {

    loader.addListener(listener);

    loader.loadClip("http\\:google.com\flower.php", _root['img_0'+current_loader]);

    // set the next loader

    current_loader = current_loader == 1 ? 2 : 1;

    // set next image

    current_img = current_img == images.length - 1 ? 0 : current_img + 1;

}

// load the first image

load_image();

TOPICS
ActionScript
285
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 10, 2015 Mar 10, 2015
LATEST

to comunicate between actionscript and a html page, you can use flashvars or the externalinterface class.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines