0 Replies Latest reply on Jul 25, 2008 7:18 AM by BobMelnyk

    Load a variable at run time

    BobMelnyk
      I have the following code to load in some images and display/move them:

      this.createClassObject(mx.controls.Loader, "myLoader", 1);
      this.createClassObject(mx.controls.Loader, "myLoader2", 2);
      this.createClassObject(mx.controls.Loader, "myLoader3", 3);
      this.createClassObject(mx.controls.Loader, "myLoader4", 4);
      this.createClassObject(mx.controls.Loader, "myLoader5", 5);
      myLoader.scaleContent = false;
      myLoader2.scaleContent = false;
      myLoader3.scaleContent = false;
      myLoader4.scaleContent = false;
      myLoader5.scaleContent = false;

      var images:Array = [" http://www.mysite.com/images/image_01.jpg", " http://www.mysite.com/images/image_01.jpg", " http://www.mysite.com/images/image_01.jpg",
      " http://www.mysite.com/images/image_01.jpg",
      " http://www.mysite.com/images/image_01.jpg"

      myLoader.contentPath = images[0];
      myLoader._x = 0;
      myLoader._y = 0;
      myLoader2.contentPath = images[1];
      myLoader2._x = 320;
      myLoader2._y = 0;
      myLoader3.contentPath = images[2];
      myLoader3._x = 640;
      myLoader3._y = 0;
      myLoader4.contentPath = images[3];
      myLoader4._x = 960;
      myLoader4._y = 0;
      myLoader5.contentPath = images[4];
      myLoader5._x = 1280;
      myLoader5._y = 0;
      .
      .
      .
      This works great, but what I'm wondering is, can I load in the images array variable at run time from an external file so I could edit that file on the server in order to change images, without having to re-publish the flash file? Thanks for any help.

      Bob