Random Sparks is it possible?

just wondering if it is possible to do random sparks jumping out in all sorts of direction???

Sure it is…

It’s called a particle system and it’s widely implemented for a lot of things…

As for you… Make a movieCLip that is really small… Maybe 2 px by 2 px and color it a bluish color that kind-a looks like sparks…

Then… You have the starting point of the sparks be where you want them coming from… And then have them two random numbers…

Random x direction and random y direction, then just use an _alpha… When a spark starts it has 100% alpha… Then it’ll go down frame by frame by 1-5, whichever looks best… And then fizzle to below 0… Then just do a test… if(movieCLip._alpha <= 0)removeMovieClip(this)…

Hope this helps man :slight_smile:

when you mean movieClip are you talking about the symbol or the whole movie??? Has anyone tried this yet???

I’ve tried a similar effect like this before…

And by movieCLip I mean it as a symbol…

I’ll explain myself more tomorrow night… I’m tired, cranky, and I need to get more sleep…

Later on

try this

http://userpages.umbc.edu/~tmccau1/flash/werehere/sparks.swf
http://userpages.umbc.edu/~tmccau1/flash/werehere/sparks.fla

it was for a minimal lines of code contest so the source might be a little jumbled (I cant remember its a year or 2 old) so if you have and problems, let me know.

Nice file :slight_smile:

pares101 >> As Playamarz said: you create a very small movie clip, and you give it a linkage name, something like particle.

Then if you want to have sparks when you press the mouse button, you’ll have to attach a bunch of these movie clips onMouseDown, and then give them random speeds (random xSpeed and random ySpeed) that you’ll use in their own onEnterFrame.

pom (-:

ok i think i understood somewhat , and here is another question ive seen ton of preloaders and everything but im having a hard time just making a normal LOADING one , i downloaded the component but it loads the WHOLE movie not just 1 scene , i have about 6 scenes and everytime i want the user to go to a new scene i want the preloader to do its thing, can someone show me or the URL of a good FLASH MX preloader. can someone just put the code step by step or something?? i checked out the other tutorial by lost in beta but it loads the whole movie too! :\

You will need to use loadMovie for that one. Using scenes makes your whole movie 1 movie… hence the preloader will load the whole thing.

Create seperate .swf files and loading them in with loadMovie() or loadMovieNum() allows you to put a preloader on each individual file and keeps from loading any unviewed content. This method is the preferred method over scenes. It is more friend to dial-up users too.

Very nice sparks Sen.

well that seemed to work :slight_smile: now sometimes i see inside a movie that they have lil windows and they load the movie inside the little window how would i go about doign that??

loadMovie() again.

loadMovie loads to an empty movie clip. It attaches your loaded movies upper left corner to the empty clip. Create the movie the size you want, then load it in.

Hey guys, I think I got a better idea on loading seperate scenes:

In flash there’s the built in variable/parameter names reffering to frames, such as: _framesloaded, _totalframes, _currentframe etc. so we can use those parameters to check out whether certain portions of the movie were loaded. For example:

If (_root._framesloaded >= 1456){
gotoAndPlay(“blahblah”);
}

If I understood correctly, you can find out what frame you’re currently on by putting this kind of code in a frame:

variablename = _currentframe;

And then you make a dynamic text box with the variablename in it, and you see the current frame number.

Now I might be mistaken about the parameters’ names, so you’ll have to check that.

Well that doesn’t just load a certain part, it just checks to see what part is loaded so far. So if you don’t load all of it at once, then the rest will be loading while you are playing your movie, which may cause lagging. I am not too fond of the frames method of preloading.

Well…

I guess I don’t need to clarify myself anymore…

Gee guys… Just take away all my fun why don’tcha!

:frowning:

lol j/k