/************************************************************************************** Program: AlphaTween Version: 0.5 Author : Petit Publications http://petitpub.com Usage : This Actionscript 2.0 should be included in the first frame of the *.fla file to run the show. Purpose: To test the Tween class in tweening transperancy of a PNG image. **************************************************************************************/ // Import the Tween class and the easing package import mx.transitions.Tween; import mx.transitions.easing.*; // Global variables var mc:MovieClip; // The movieclip used as a holder for the image var alphaStart = 20; // Start with an alpha value of 20% // create a movieclip to load the photo into function getImage(){ mc = _root.createEmptyMovieClip("photo", i); // position the clip mc._x = 1; mc._y = 1; // create a movieclip so that our onPress isn't overwritten by the jpg mc.createEmptyMovieClip("jpgHolder", 1); // and load the jpeg into it mc.jpgHolder.loadMovie("images/petit.jpg"); // Default start value for alpha mc._alpha = alphaStart; // add the onPress handler to the movieclip mc.onPress = doTween; } // Do the alpha tween on the MovieClip function doTween(){ // trace(mc._alpha); // check for access // mc._alpha = 20; // works nicely var mcTween:Tween = new Tween(mc, "_alpha", Strong.easeOut, 20, 100, 5, true); }; function main(){ getImage(); }