Chronic
06-01-2007, 02:10 PM
Having trouble with fire in Flash? Dont worry, because this is a neat way to do it with some ActionScript. You'll have to be a little familiar with how some things work to get this right.
Ok, open up a new Flash 8 document. To make this easy on your eyes, got PROPERTIES, and change the background to black.
First, make a new MovieClip (Ctrl+F8). The name doesn't really matter, but lets call this MovieClip FIRE_ALL. Now insert two frames (not Keyframes) into this MovieClip. Now make another MovieClip and call this one FIRE_ACT.
Once Agian, add in two frames. This time, add another Layer to FIRE_ACT. To do this, rightclick on Layer 1, and press Insert Layer. You should now have two layers in FIRE_ACT.
Goto the new layer and make it have three Keyframes. Right Click on the first of these frames, and goto Actions. Now copy and paste this ActionScript into the panel:
i = 1;
max = 60;
x = getProperty("fire", _x);
Alright, now goto the Acitons panel of the second Keyframe, and put in this ActionScript:
if (Number(i)<=Number(max)) {
duplicateMovieClip("fire", "fire" add i, i);
i = Number(i)+1;
}
Finally, goto the last Keyframe, and put in this ActionScript:
if (Number(i)<=Number(max)) {
duplicateMovieClip("fire", "fire" add i, i);
i = Number(i)+1;
}
gotoAndPlay(2);
Now comes the part where you make the fire.
Make another MovieClip. Call it FIRE_TWEEN. Draw a small circle and get rid of the outline. Make the fill a RADIAL GRADIANT, with white on the inside, and any color with zero alpha on the outside. It should look like this:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_1.jpg
Now right click on the circle you've just made, and make it a Graphic. Call this one FIRE_BALL.
So now FIRE_BALL should be in the MovieClip FIRE_TWEEN. Make sure you're still in FIRE_TWEEN. Click on FIRE_BALL and open up its Properties. Goto the part that says Color, and change the None to Tint. Goto th little color box, and pick a light orange. You should also see a small box with a percent in it. Change that number to 100%.
Should now look like this:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_2.jpg
Be sure you're in FIRE_TWEEN. Goto the Timeline, and RightClick on Frame 30. Select Insert Keyframe.
Have Frame 30 selected, and click on FIRE_BALL. Move it up about four inches. Use the Free Transform tool, and make th circle about twice as big. Now goto the Properties panel, and change Tint to Alpha. Set the percentage to zero. When you changed the Alpha, the ball should no longer be visible.
Make sure you're in FIRE_TWEEN. Go back to Frame 1. RightClick the frame, and select Create motion Tween. The frames should turn blue, and an arrow pointing from Frame 1 to Frame 30 should appear. If you press Enter to watch the movement, the ball should be moving up and slowly dissappearing.
We're not done yet.
Goto Frame 5, and insert a Keyframe. Click on FIRE_BALL, and goto its propertis again. Change the Tint to Yellow.
Should now be this:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_3.jpg
Next, goto Frame 15, and insert another Keyframe. This time, change the Tint to Red.
Should be This:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_4.jpg
Finally, goto Frame 25, and insert another Keyframe. This time, change the Tint to a very dark grey. The ball should be just barely visible:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_5.jpg
If you press Enter to watch the whole thing, it should look something like this:
height=400 width=250
Ok, your almost done.
Make sure you're still in FIRE_TWEEN. Goto the first frame and add this ActionScript:
scale = Number(random(50))+30;
setProperty(_target, _x, Number(../:x)+Number(random(12))-6);
setProperty(_target, _yscale, scale);
Ok, now goto the blue BACK arrow just above the timeline, and click until your back to the regular stage. You'll notice that nothing's there. Not for long.
Press Ctrl+L to open the Library. You'll see a list of all your MovieClips and stuff. Click on FIRE_ALL and drag it onto the stage. All you'll see is a white dot. Double click on the dot so your inside FIRE_ALL.
Once your in, open the Library again. This time, take FIRE_ACT and drag it to the stage. You'll want it to be relativly close to the center. Now, double click FIRE_ACT so your in that.
Open the Library once more, and drag FIRE_TWEEN onto the stage. Make sure that it is on the frames WITHOUT the ActoinScript.
Your very close to being done. Click on (not DoubleClick) FIRE_TWEEN. Goto its properties. Click the box that says <Instance Name>. Change this to:
fire
And press Enter.
Now press the Back button until your back to the regular stage, where FIRE_ALL should be. This is the final step. Goto Fileand then Publish Settings. Open the tab that says Flash and goto the box that says Version:. Chanage this to Flash Player 5.
I don't know why, but it only works with 5. So if you use it in a movie, it has to be 5.
Press OK, and preview your movie. (Ctrl+Enter)
BAM!! Instant Fire! Now simply take FIRE_ALL and put it in your movie for fire.
height=400 width=550
You can change the frame rate to make it go faster, so you can find what looks best for you.
I hope this tut helped anyboby, as I made it as simple as I could.
Peace
--Chronic
Ok, open up a new Flash 8 document. To make this easy on your eyes, got PROPERTIES, and change the background to black.
First, make a new MovieClip (Ctrl+F8). The name doesn't really matter, but lets call this MovieClip FIRE_ALL. Now insert two frames (not Keyframes) into this MovieClip. Now make another MovieClip and call this one FIRE_ACT.
Once Agian, add in two frames. This time, add another Layer to FIRE_ACT. To do this, rightclick on Layer 1, and press Insert Layer. You should now have two layers in FIRE_ACT.
Goto the new layer and make it have three Keyframes. Right Click on the first of these frames, and goto Actions. Now copy and paste this ActionScript into the panel:
i = 1;
max = 60;
x = getProperty("fire", _x);
Alright, now goto the Acitons panel of the second Keyframe, and put in this ActionScript:
if (Number(i)<=Number(max)) {
duplicateMovieClip("fire", "fire" add i, i);
i = Number(i)+1;
}
Finally, goto the last Keyframe, and put in this ActionScript:
if (Number(i)<=Number(max)) {
duplicateMovieClip("fire", "fire" add i, i);
i = Number(i)+1;
}
gotoAndPlay(2);
Now comes the part where you make the fire.
Make another MovieClip. Call it FIRE_TWEEN. Draw a small circle and get rid of the outline. Make the fill a RADIAL GRADIANT, with white on the inside, and any color with zero alpha on the outside. It should look like this:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_1.jpg
Now right click on the circle you've just made, and make it a Graphic. Call this one FIRE_BALL.
So now FIRE_BALL should be in the MovieClip FIRE_TWEEN. Make sure you're still in FIRE_TWEEN. Click on FIRE_BALL and open up its Properties. Goto the part that says Color, and change the None to Tint. Goto th little color box, and pick a light orange. You should also see a small box with a percent in it. Change that number to 100%.
Should now look like this:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_2.jpg
Be sure you're in FIRE_TWEEN. Goto the Timeline, and RightClick on Frame 30. Select Insert Keyframe.
Have Frame 30 selected, and click on FIRE_BALL. Move it up about four inches. Use the Free Transform tool, and make th circle about twice as big. Now goto the Properties panel, and change Tint to Alpha. Set the percentage to zero. When you changed the Alpha, the ball should no longer be visible.
Make sure you're in FIRE_TWEEN. Go back to Frame 1. RightClick the frame, and select Create motion Tween. The frames should turn blue, and an arrow pointing from Frame 1 to Frame 30 should appear. If you press Enter to watch the movement, the ball should be moving up and slowly dissappearing.
We're not done yet.
Goto Frame 5, and insert a Keyframe. Click on FIRE_BALL, and goto its propertis again. Change the Tint to Yellow.
Should now be this:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_3.jpg
Next, goto Frame 15, and insert another Keyframe. This time, change the Tint to Red.
Should be This:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_4.jpg
Finally, goto Frame 25, and insert another Keyframe. This time, change the Tint to a very dark grey. The ball should be just barely visible:
http://i122.photobucket.com/albums/o244/Stickeroth/EX_5.jpg
If you press Enter to watch the whole thing, it should look something like this:
height=400 width=250
Ok, your almost done.
Make sure you're still in FIRE_TWEEN. Goto the first frame and add this ActionScript:
scale = Number(random(50))+30;
setProperty(_target, _x, Number(../:x)+Number(random(12))-6);
setProperty(_target, _yscale, scale);
Ok, now goto the blue BACK arrow just above the timeline, and click until your back to the regular stage. You'll notice that nothing's there. Not for long.
Press Ctrl+L to open the Library. You'll see a list of all your MovieClips and stuff. Click on FIRE_ALL and drag it onto the stage. All you'll see is a white dot. Double click on the dot so your inside FIRE_ALL.
Once your in, open the Library again. This time, take FIRE_ACT and drag it to the stage. You'll want it to be relativly close to the center. Now, double click FIRE_ACT so your in that.
Open the Library once more, and drag FIRE_TWEEN onto the stage. Make sure that it is on the frames WITHOUT the ActoinScript.
Your very close to being done. Click on (not DoubleClick) FIRE_TWEEN. Goto its properties. Click the box that says <Instance Name>. Change this to:
fire
And press Enter.
Now press the Back button until your back to the regular stage, where FIRE_ALL should be. This is the final step. Goto Fileand then Publish Settings. Open the tab that says Flash and goto the box that says Version:. Chanage this to Flash Player 5.
I don't know why, but it only works with 5. So if you use it in a movie, it has to be 5.
Press OK, and preview your movie. (Ctrl+Enter)
BAM!! Instant Fire! Now simply take FIRE_ALL and put it in your movie for fire.
height=400 width=550
You can change the frame rate to make it go faster, so you can find what looks best for you.
I hope this tut helped anyboby, as I made it as simple as I could.
Peace
--Chronic