1 Reply Latest reply on Mar 10, 2015 11:51 AM by kglad

    pass variable to swf  from html to load image

    satyajitr18594964

         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();