7 Replies Latest reply on Aug 9, 2009 10:00 AM by kglad

    Problem with thumbnail tween and event handler (movieclip wont remove from stage)

    DanDesignuk

      Hi im new to this forum thing so excuse my etiquette if its inappropriate. Im having a problem with an as2 file im making, its a simple 6 thumbnail gallery with coded tweens. Once a thumbnail is clicked then its attached larger image is meant to display on the screen, this seems to only work after the first click of a thumbnail once the image appears then is clicked it dissapears, and this function only used to work once but now it only works twice, exept the second time around the larger image cannot be removed from the stage, could it be a swapDepths issue?

       

      here is my code, i have only fully coded the first thumbnail top left. find attached my swf for the file, i really could do with some help and anything would be appreciated thanks. i am new to as so please be gentle.

       

       

      stop();

       

      import mx.transitions.Tween;

      import mx.transitions.easing.*;

       

      _root.createEmptyMovieClip("container_mc",0);

      container_mc._x = (Stage.width)/2;

      container_mc._y = (Stage.height)/2;

       

       

      thumb1._alpha = 50;

       

      thumb1.onRollOver = function() {

      new Tween(thumb1, "_alpha", Strong.easeOut, 50, 100, 0.5, true);

      }

       

      thumb1.onRollOut = function() {

      new Tween(thumb1, "_alpha", Strong.easeOut, 100, 50, 0.5, true);

      }

       

      thumb1.onRelease = function() {

       

      container_mc.attachMovie("image1", "pic1",2);

      new Tween(container_mc,"_alpha", Strong.easeOut, 0, 100, 2, true);

       

      }

       

      container_mc.onRelease = function() {

      this.enabled=false;

      var myFadeOut = new Tween(container_mc, "_alpha", Strong.easeOut, 100, 0, 2, true);

      myFadeOut.onMotionFinished = function() {

      container_mc.unloadMovie();

      }

      }

       

       

       

      thumb2._alpha = 50;

       

      thumb2.onRollOver = function() {

      new Tween(thumb2, "_alpha", Strong.easeOut, 50, 100, 0.5, true);

      }

       

      thumb2.onRollOut = function() {

      new Tween(thumb2, "_alpha", Strong.easeOut, 100, 50, 0.5, true);

      }

       

      thumb2.onRelease = function() {

      container_mc.attachMovie("image2", "pic2",0);

      new Tween(container_mc, "_alpha", Strong.easeOut, 50, 100, 0.5, true);

      }

       

      thumb3._alpha = 50;

       

      thumb3.onRollOver = function() {

      new Tween(thumb3, "_alpha", Strong.easeOut, 50, 100, 0.5, true);

      }

       

      thumb3.onRollOut = function() {

      new Tween(thumb3, "_alpha", Strong.easeOut, 100, 50, 0.5, true);

      }

       

      thumb4._alpha = 50;

       

      thumb4.onRollOver = function() {

      new Tween(thumb4, "_alpha", Strong.easeOut, 50, 100, 0.5, true);

      }

       

      thumb4.onRollOut = function() {

      new Tween(thumb4, "_alpha", Strong.easeOut, 100, 50, 0.5, true);

      }

       

      thumb5._alpha = 50;

       

      thumb5.onRollOver = function() {

      new Tween(thumb5, "_alpha", Strong.easeOut, 50, 100, 0.5, true);

      }

       

      thumb5.onRollOut = function() {

      new Tween(thumb5, "_alpha", Strong.easeOut, 100, 50, 0.5, true);

      }

       

      thumb6._alpha = 50;

       

      thumb6.onRollOver = function() {

      new Tween(thumb6, "_alpha", Strong.easeOut, 50, 100, 0.5, true);

      }

       

      thumb6.onRollOut = function() {

      new Tween(thumb6, "_alpha", Strong.easeOut, 100, 50, 0.5, true);

      }