PDA

View Full Version : [fmx] Help! It Snows In All My Scenes!



meili
May 5th, 2003, 12:41 AM
I added the snow effect to one of my movies, it plays from the time you add
the action script, to the end of the movie. I only want it to play in certain
scenes, is there any way to do that?

Tank You

I got the action script from:
http://www.kirupa.com/developer/mx/snow.htm

:love:

lostinbeta
May 5th, 2003, 01:46 AM
Create the snow effect inside a movie clip symbol in your scene.

After you got the snow working within a movie clip symbol go to your code where you change scenes.

Right before your code to change scenes use a removeMovieClip() command on the clips instance name. So let's say you give it the instance name "snowStorm" you will remove it like snowStorm.removeMovieClip(); In theory this should work, never tried it though.


Oh yeah.. and keep in mind that since your code and all snow clips are going inside the movie clip symbol the targetting will change. That means in this code..
for (k=0; k<50; k++) {
duplicateMovieClip(_root.snow, "snow"+k, k);
}

Remove _root so that it just says "snow" (no quotes), or you can use this.snow.



And to keep dragging this out I have a few questions...

Snow in the Spring/Summer season? Live in a snowy area eh?...lol

And as a little tip... as you get more comfortable with Flash, try and steer away from scenes as much as you can, it will be good for you as Flash kinda sucks with scenes, and putting everything into one file seriously beefs up file size... that was why loadMovie() was created :)

λ
May 5th, 2003, 02:31 AM
I don't think you can use removeMovieClip when you make the movieclip in the authoring tool. You have to attach the movieclip using attachMovie(); or duplicateMovieClip .

kode
May 5th, 2003, 04:16 AM
yeah... that's right, njs.

however, if the MovieClip snowStorm is not placed in that frame, there will be no snow. ;)

λ
May 5th, 2003, 07:06 AM
Yeah, or you could set its _visible property to 0. Anyway, I hope in the next version Macromedia fix scenes, or take them out. It's one of the most buggy things in Flash at the moment.

meili
May 5th, 2003, 12:00 PM
I tried setting the visible prop to zero, but it still plays the snow from the scene before.

lostinbeta
May 5th, 2003, 12:15 PM
FRIGGIN FRAGGIN!!!!! I have been coder retarded for weeks now, this is the longest funk i've been in with AS.... it makes me sad :(

kode
May 5th, 2003, 12:22 PM
Originally posted by lostinbeta
FRIGGIN FRAGGIN!!!!! I have been coder retarded for weeks now, this is the longest funk i've been in with AS.... it makes me sad :(
it won't last forever. ;)

senocular
May 5th, 2003, 01:06 PM
Originally posted by njs12345
I don't think you can use removeMovieClip when you make the movieclip in the authoring tool. You have to attach the movieclip using attachMovie(); or duplicateMovieClip .

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12937 ;)


Originally posted by njs12345
Yeah, or you could set its _visible property to 0. Anyway, I hope in the next version Macromedia fix scenes, or take them out. It's one of the most buggy things in Flash at the moment.

its not as buggy as much as it is misunderstood. They are what they are, but arent quite what they intuitively should be. :-\



... I think Lost had it closest with

Originally posted by lostinbeta
Create the snow effect inside a movie clip symbol in your scene

If you put the effect in a clip and just run it through that, then when that clip is no longer on the timeline of the scene, it will be removed, despite whatever attaching has been going on within it. Because its all contained within that clip and not being maintained within the main timeline itself (which applies to all scenes) then when the clip is gone, so is the effect. If you ever go back to that scene, the clip will be reinstated and reactivated bringing back the snow. The removeMovieclip shouldnt be necessary since its handled by the timeline.

lostinbeta
May 5th, 2003, 03:45 PM
Well at least I got SOMETHING right in what I said....lol. :crazy: :hangover:

kode
May 5th, 2003, 06:58 PM
Originally posted by senocular
If you put the effect in a clip and just run it through that, then when that clip is no longer on the timeline of the scene, it will be removed, despite whatever attaching has been going on within it. Because its all contained within that clip and not being maintained within the main timeline itself (which applies to all scenes) then when the clip is gone, so is the effect. If you ever go back to that scene, the clip will be reinstated and reactivated bringing back the snow. The removeMovieclip shouldnt be necessary since its handled by the timeline.
and that's exactly what i meant to say... the only difference is that you explained it. :P

meili
May 7th, 2003, 06:20 PM
thanks for everyones help.
I finally got it to work! yeah!

:love: