| home | about | time | appearance | space | other | tips & tricks |
Simple Fade InFirst step in order to obtain the background for the flame is to know how to fade in the background. As you can see in the Movie, the background is black so create a new Flash file and chose black in the Properties Panel of the Stage, or draw a black rectangle, and make sure it covers all the work area. Import the desired Image in the Stage, and convert it into a Movie Clip. Open the Clip for edit (double click), convert the image into another Movie Clip (we will use some of this object's properties), create a new Keyframe in the second frame and copy/paste the first. The result will now be two identical frames. Add "stop();" on each frame. In the first frame we will create the engine for the beginning of the Movie (the actual fade in this example) and the second will serve as the default state for the Movie. Now in the second frame the image remains unchanged, but the first one needs some Action Script.
![]() The script must be added on the Movie Clip because we use: onClipEvent(load); onClipEvent(enterFrame);
The advantage of using these special statements for the Movie Clip is the fact that it simulates a frame by frame loop as long as the Clip is visible in the Timeline. So on the first frame click the Symbol and add:
onClipEvent( load ) {
this._alpha=0; //transparency set to 0
}
onClipEvent( enterFrame ) {
if( this._alpha == 100 ) _parent.play(); //invoked when the fade ends
else this._alpha += 5; //creates the fading impression
}
The property that defines the transparency in Flash is "_alpha" which can be set to a value between 0 and 100 (0= you can't see the object, 100 the object has no transparency), the default being 100. We set the transparency of the Symbol to 0 before it starts playing (inside the "onClipEvent(load)" special function). Each time the movie enters a new frame, we add 5 to the "_alpha" value of the clip. Before doing this, we verify is "_alpha" has reached its top value (100), and if so we jump on the second frame. There are two main reasons why we use a second frame instead of just one (the "_alpha" parameter will not jump any higher than 100, so the Image will be fully visible). In the first place the Flash file will do some unnecessary thinking because nothing will change in the stage but we are still verifying conditions, and second, from our experience, after few minutes you will experience some strange anomalies in some browsers. No random effects in this example, so press next chapter to see what we changed to the Clip above to make it way cooler. |
| Copyright © 2010 WebArticles.org. All rights reserved. Privacy Policy. |
| FlashRandomEffects.WebArticles.Org is not affiliated with Adobe Systems Incorporated, USA. Adobe Flash is a registered trademark of Adobe Systems, Inc in the United States of America and/or other countries. The purpose of this website is to provide information for mastering Adobe Flash and creating Flash effects. |