1 Reply Latest reply on Aug 23, 2006 3:32 AM by 2m

    pb with loading fotos

    ritpas Level 1
      08/23/2006 11:02:30 AM
      Reply | Quote | Top | Bottom | Edit

      Hello,

      Here is a little and simple class charged of loading 2 fotos in a parent clip called "diaporama" (I expect the 2nd foto to be set 20px on the right of the first one and above it)
      You can test it yourself by saving 2 fotos called foto1.jpg and foto2.jpg into your current directory containing the swf file.
      In the .fla file you just put Diapo.Main() to launch the program.

      class Diapo {
      //clip containing all th fotos
      private static var diaporama:MovieClip;
      //foto id
      private var id:Number;
      //clip containing the loaded foto
      private var diapo:MovieClip;
      private var chargeur:MovieClipLoader;
      //CONSTRUCTOR
      private function Diapo(id:Number) {
      this.chargeur = new MovieClipLoader();
      this.id = id;
      this.diapo = diaporama.createEmptyMovieClip("diapo", id);
      this.diapo._x = (this.id-1)*20;
      this.chargeur.addListener(this);
      this.chargeur.loadClip("foto"+this.id+".jpg", diapo);
      }
      //main function chaged of displaying 3 fotos
      public static function Main() {
      diaporama = _root.createEmptyMovieClip("diaporama", 1);
      diaporama._x = 150;
      diaporama._y = 200;
      new Diapo(1);
      new Diapo(2);
      }
      private function onLoadInit() {
      trace("ok");
      }
      }

      MY PROBLEM : when I launch it, it displays only the second foto, "ok" appears only once while I expected it to appear twice.
      It seems to load only one foto (the last one). WHY?

      Thansk for your help,