5 Replies Latest reply on Aug 8, 2007 12:39 PM by kglad

    Newb-type code question

    Winston2 Level 1
      Can someone look at my code and tell me where I might be going wrong? I'm trying to load a background, create a movie holder and create a button to launch a movie. When I test the movie the button does not show. The background loads fine. I'm using Flash Professional 8. Thank you very much.





      //Loads a background jpg from the jpg directory
      var mc:MovieClip = this.createEmptyMovieClip("mc", this.getNextHighestDepth());
      mc.loadMovie("jpg/beam.jpg");

      //Movie clip that holds the movie to be viewed
      var inner_mc:MovieClip=this.createEmptyMovieClip("inner_mc", this.getNextHighestDepth());
      inner_mc._x=181.5;
      inner_mc._y=75;
      inner_mc.moveTo(0,0);
      inner_mc.lineTo(640,0);
      inner_mc.lineTo(640,480);
      inner_mc.lineTo(0,480);
      inner_mc.lineTo(0,0);


      //Example 1
      this.createClassObject(mx.controls.Button, "my_button", this.getNextHighestDepth(), {label:"Example 1"});
      my_button.move(20,20);

      function whenMouseIsClicked() {
      //loads movie into inner_mc
      loadMovie("swf/insertingDateInWord.swf", "inner_mc");
      }
      my_button.addEventListener("click", whenMouseIsClicked);