Welcome, Guest
  • Author Topic: Dynamic movie clip/image...so close..yet so far...  (Read 577 times)

    James Marsh

    • Server what's that
    • *
    • Posts: 13
    • Digital Interactive Media & Music
      • View Profile
      • MetaMedia Independent
      • Email
    I have a button (meetArt_btn) when clicked should make some text dissapear, create an empty movie clip named (artistsPick_mc) and bring a jpeg image (JennyThumb.) into it.  The action script is in the first frame on a layer named actions and refers to the button being clicked.  The text alpha value change works but I am not sure if a new movie clip is being made and it is definately not bringing in the jpeg. The code is pasted below.


    //setup function for meet the artists button
    meetArt_btn.onRelease = function() {
    // make aboutText dissapear
    aboutText_txt._alpha = 0
    // Create movie clip for image
    this.createEmptyMovieClip("artistsPick_mc", 1);
    artistsPick_mc._x = 100;
    artistsPick_mc._y = 200;
    //load image
    artistsPick_mc.loadMovie("JennyThumb.jpg");
    };
    Time flies like an arrow but fruit flies like bananas…

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Dynamic movie clip/image...so close..yet so far...
    « Reply #1 on: 04/07/03, 01:31 »
    Use this in the path to load the jpg:

    this.artistsPick_mc.loadMovie("JennyThumb.jpg");

    Also check that the jpg is a standard jpg (not optimized or progressive)

    Jorge

    James Marsh

    • Server what's that
    • *
    • Posts: 13
    • Digital Interactive Media & Music
      • View Profile
      • MetaMedia Independent
      • Email
    Re:Dynamic movie clip/image...so close..yet so far...
    « Reply #2 on: 04/07/03, 11:15 »
    Thanks Jorge,
    Well, I wasn't able to get the jpeg to load, but I was able to get a SWF to load.  I want to fade it in using action script from the main movie so I added the code below, it shows up with the initial alpha value of +5 but stops there.  Also I want a button (jennyB_btn) within "artistsPick_mc" to create another empty movie clip and open a swf into it called "jennyBpage" when clicked so I added the code below but to no avail-I think it may be a path issue.  Any help is appreciated.



    //setup function for meet the artists button
    meetArt_btn.onRelease = function() {
       // make about text dissapear
       aboutText_txt._alpha = 0;
       // Create movie clip for image
       createEmptyMovieClip("artistsPick_mc", 1);
       //Position the movie clip on the stage
       artistsPick_mc._x = 160;
       artistsPick_mc._y = 270;
       //load artists movie into the clip
       artistsPick_mc.loadMovie("artists.swf", 1);

       //fade in artists pick swf
       artistsPick_mc._alpha = 0;
       artistsPick_mc._alpha += 5
    };
    //jennyB_btn opens movie
    jennyB_btn.onRelease = function() {
       createEmptyMovieClip("jennyBpage_mc", 1);
       jennyBpage_mc.loadMovie("jennyBae.swf", 1);
    };
    Time flies like an arrow but fruit flies like bananas…

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re:Dynamic movie clip/image...so close..yet so far...
    « Reply #3 on: 04/11/03, 01:41 »
    Hi. Try this:

    [script]
    //setup function for meet the artists button
    meetArt_btn.onRelease = function() {
      // make about text dissapear
      aboutText_txt._alpha = 0;
      // Create movie clip for image
      var n = createEmptyMovieClip("artistsPick_mc", 1);
      //Position the movie clip on the stage
      n._x = 160;
      n._y = 270;
      //load artists movie into the clip
      n.loadMovie("artists.swf", 1);
      n._alpha = 0;
      //fade in artists pick swf using onEnterFrame event until reach 100
      this.onEnterFrame = function(){
         if(n.getBytesLoaded()==n.getBytesTotal()&&n.getBytesLoaded()>4) {
               n._alpha += 5;
               if(n._alpha>=100) delete this.onEnterFrame
         }
      }
    };
    //jennyB_btn opens movie
    jennyB_btn.onRelease = function() {
      createEmptyMovieClip("jennyBpage_mc", 2);
      jennyBpage_mc.loadMovie("jennyBae.swf", 1);
    };
    [/script]

    Jorge