This may be a little bit long. But as long as you're familiar with how actionscript works (somewhat) this shouldn't be too hard.
-----------------------------------------------------------------
OK, first off, lets do the easy part: making the fairy (Navi).
At the top menu, go to Insert > New Symbol, and make it a movieclip. Name it whatever you want.
For the body, make a circle with an orb gradient type thing for the color, then go to the color mixer window (Window > Color Mixer) select the orb, and then in the color mixer window select one of the squares on the part for the gradient fill and go Alpha = 0% (make sure it's the correct square) and the other one as white.
Make sure that the circle is centered on the little plus sign.
For the wings, that's just using lines, then filling them with the right gradient. Then using scaling to make them appear as if they're beating.
----------------------
Next, we'll make the particle, which is much more complicated. Exit your current movieclip, and make sure to drag it out of the library and onto the stage.
Next, insert a new movieclip, maybe a name along the lines of "particle1" or something like that. For the drawing, just do the exact same thing you did with Navi's body.
Create another layer, this will be used for actionscript (because its best to seperate the drawings and the script). Make both layers two frames long, but make the scripting layer into two keyframes.
on the first keyframe, you will have to put in this scripting:
this._x = _root._xmouse;
this._y = _root._xmouse;
life = 70;
this make it so the particles follow the mouse, and last 70 frames. Next, put in this actionscript:
onEnterFrame = function {
this will be just a basic particle generator, like the blue one on my page. This coding loops everything that comes after the opening bracket { and before the closing bracket } every frame. Next, we have to decrease the life, so put this in:
life -= 1;
every frame, life goes down one. Next we'll turn this into a percentage for use in later things that require one. Type in this:
PercentLife = (life/70)*100;
just like figuring out your percentage on a test. Here's what it will be used for (type this in):
this._alpha = PercentLife;
this._xscale = PercentLife;
this._yscale = PercentLife;
this makes it so the particle gets scaled down and gradually disappears (_alpha) as the percentage goes down. Next, to remove the movieclip, which will become quite important in a moment. Type this script in:
if (life <= 0) {
this.removeMovieClip();
}
}
this makes it so that it removes the whole thing after it's gone, freeing up space and not causing any lag afterwards. You may now exit the movieclip, and as with Navi, take it from your Library and place it anywhere on the stage.
----------------------------
Next part won't take very long. But, in order to do it, you must give each movieclip an instance name. You can do this by selecting each clip, going to Properties, and typing in an easy to remember instance name, preferably whatever you named the clip (if possible). I'll use particle1 for the particle and Navi1 for Navi (creative, right?).
Create another layer in the timeline, which will be used for actionscript. Type in the following script:
stop()
N = 1;
particle1._visible = false;
This is kind of self-explanatory, and N = 1; I'll get to in a moment. It will be used to avoid a problem called "depth". Put this stuff in:
onEnterFrame = function () {
N += 1;
duplicateMovieClip("particle1", "particle2", N);
SWITCH1 = _xmouse;
onMouseMove = function () {
SWITCH2 = _xmouse;
if (SWITCH1 < SWITCH2) {
Navi1._xscale = -100;
} else {
Navi1._xscale = 100;
}
}
}
looping, we've been over that. N+= 1. Every time it enters the frame, N goes up by one. VERY IMPORTANT for depth problems. As for: duplicateMovieClip("particle1", "particle2", N), I will now explain what each part is. "particle1" refers back to the instance name so that we know what we're duplicating. "particle2" is used as the new name for the particle we just duplicated. and N refers to it's "depth".
What is depth? Everything in flash has x and y values, so depth is like a z value. And, only one clip can be in each depth. So that's why it is N += 1, that way it's never the same depth. Otherwise it would just automatically remove the previous particle.
Both SWITCH variables have to do with when Navi looks a different way. Basically, SWITCH registers where the mouse is at one point in time, and SWITCH2 registers where the mouse is when you move it. So, if you moved to the right, SWITCH2 one would be bigger then SWITCH1 because your x value would have increased. So, with the if statement, it tests this. And if it's true, it says to flip Navi. The else statement says that if that isn't true, then Navi must be moving the other way, so it makes sure that Navi is facing that way. Depending on which way you made her face, you may have to switch these.
----------------------------------------------
Almost forgot something. To make Navi follow the mouse, go into Navi's movieclip, create another layer, and type in this script:
onEnterFrame = function () {
onRollOver = function () {
Mouse.hide()
}
this._x = _root._xmouse
this._y = _root._ymouse
}
this also hides the mouse when it's positioned over Navi.
And that's all there is to it. I can't help you much from here, but I can put you in the right direction. If you're having any troubles, you can go to dA's chat section, and find #Flashers. I'm in there at times, and there are always plenty of other people there who may be able to help you. Hopefully they won't all be away working on flash :) But many of them are a thousand times better than me, and know quite a bit more.













Devious Comments
Comments
--
-You're in my dreams The Darkness in my heart The rapture in their screams Black Goddess Rise..-
thanks loads for putting this up its fantastically explained
--
you have 3 second exactly 3 fucking seconds to wipe that stupid looking grin off your face, OR I WILL GOUGE OUT YOUR EYEBALLS AND SKULL FUCK YOU!!!!!
[link]
I originally started out on buttons, and moved up in actionscript when I decided that I was going to design games or something like them. I steadily taught myself as much as possible, learning the basic format and all that, until all the small mistakes and tiny details I used to overlook became a thing of the past. Memorizing sections of code, placement of code, special loop sequences and the like, all to become better.
Make sure to tell me when you come out with something
Thanks very much for the watch, too
--
you have 3 second exactly 3 fucking seconds to wipe that stupid looking grin off your face, OR I WILL GOUGE OUT YOUR EYEBALLS AND SKULL FUCK YOU!!!!!
[link]
--
No shit Sherlock. Keep searching.
Previous PageNext Page