1 person found this helpful
I am not familiar with the code snippet you mention, so seeing the code could help. Generally actionscript tweening is more flexible and probably performs better than anything you might try with a timeline tween. If the code snippet involves using the Tween class, the Tween class allows you to specify whether the tween duration is measured in time or in frames.
And most folks who deal in actionscript tweening generally recommend using third party tweening engines such as TweenLite, TweenMax, Tweener, ?etc, explaining that they are more flexible and outperform the built in Tween class.
In terms of the code, this is what gets generated when I select the snippet:
/* Fade In Movie Clip
Fades in the symbol instance by increasing its alpha property within an ENTER_FRAME event until it is fully visible.
1. To change the speed at which the symbol instance fades in, change the 0.01 value below (valid values are in the range 0.0 - 1.0). Higher values cause faster fade in.
2. The '+=' operator is a shortcut to typing 'movieClip_2.alpha = movieClip_2.alpha + 0.1'.
3. Because the animation uses an ENTER_FRAME event, it progresses only when the playhead moves to a new frame, and the speed of the animation is also affected by the frame rate of the FLA file.
movieClip_2.alpha = 0;
movieClip_2.alpha += 0.05;
if(movieClip_2.alpha >= 1)
Works fine and I can easily adjust the speed of the fade. But then the fade created by creating a tween in the timeline works fine as well. By "performs better," do you mean smoother? More reliably? Something else? No idea what the advantage is with a third party tweening engine -- what it means in practical terms to outperform the built in tween class (honestly, I'm not even sure what a "tween class" is) -- or why you'd need something like that. I'm just too new at this and I'm picking up what I can through tutorials until I can schedule some real one-on-one training. I really appreciate any light you can shed.
1 person found this helpful
That code uses the ENTER_FRAME event to manage the timing of it, which is essentially identicial to having a timeline tween since it will operate at the frame rate of the file. The Tween class allows you to specify things in terms of time rather than frames (or frames as well).
Yes, you can get much smoother results usng actionscript tweening and if you plan to get involved with Flash as a design tool for a career, then you will eventually come to learn that using tweening via actionscript is quite useful.
If you want to learn more about the Tween class, just look it up in the help documents or Google "AS3 Tween tutorial". Here's a link to one result from such a search...
And I will add that using an ENTER_FRAME coding approach similar to the snippet you showed is also useful at times.