8 Replies Latest reply on Jan 9, 2013 4:57 PM by ggaarde

    Video fading in, but not out in movie clip.




      I need to run a video which I can turn off and on on top of other flash content.


      Since I also need to add sub titles I decided to import the video clip into a movie clip. The movie clip now has as many frames as the video.

      I added the subtitles by keyframing a text line in the movie clip and synched it up with the movie. (this was not real easy..)


      I placed an instance of the movie clip on my main stage in frame 10. I added an on and and off button that simply would take you to a later frame without the movie clip instance, and back to frame 10 again if you want to see the video again. This worked well. 


      To make the transistions elegant I wanted to fade the video in and out. So on the main stage in frame 10 I placed this action script:

      (+ gave my movieclip the instance name mc)



      import mx.transitions.Tween;

      import mx.transitions.easing.*;

      var myTween:Tween = new Tween (mc,"_alpha",Strong.easeIn,0,100,2,true);


      which nicely fades the video in when the playhead gets to frame 10.


      There is another part of the script that should be able to tell the upcoming end of the movie clip and fade it out:


      myTween.onMotionFinished = function () {

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



      This however I can not get to work:


      1)  If I place this code in frame 10, the video first fades in but immideately fades out again.

      2)  I tried to put the code 15 frames from the end of the movie clip, and that did not work.

      3)  I tried to put the code 15 frames from the end of the movie clip and add _parent.  and that did not work either.


      Can this be made to work, and if so how?


      If not, please let me know if you have any other proven approach to suggest.