|
-
(Flash 8) Removing Snowflakes
Code:
for (var i = 0; i<amount; i++) { thisFlake =
this.attachMovie("snowflake1", "snowflake1"+i, i);
It places the movie snowflake1 on the stage in my Pre-Load Scene.
Then when I play the movie the snowflakes work right, but when the pre-loading is done there are falling snowflakes on my next scene (I understand that there aren't actually scenes when the flash runs). I have tried numerous ways to remove the clip:
Code:
this.removeMovieclip("snowflake1")
delete "snowflake1"
this.removeAll
Please help as I am getting tired of flakes where they don't belong. Thanks.
Sincerely,
Greg
-
FK'n_dog
repeat your initial code, removing instead of attaching -
for (var i = 0; i<amount; i++) {
this["snowflake1"+i].removeMovieClip();
}
hth
-
Yeah it worked - it doesn't make much sense to me though - I though if I put:
this.removeMovieClip("snowflake1");
that the rest wouldn't matter since there is no movie clip to create snowflakes from. If you could explain a little I would appreciate it.
--
Greg
-
FK'n_dog
run the file and (before you destroy the snowflakes)
use List Variables to display what you have created.
you should see something like -
Variable: _level0.snowflake10
Variable: _level0.snowflake11
Variable: _level0.snowflake12
this is the result of looping with - "snowflake1"+i
so simply removing snowflake1 has no effect 
hth
-
Thanks for the help - but that makes absolutely no sense.
"snowflake1" + i = looping??
anyways, sorry about the duplicate movies, no one was answering my question, I would have deleted the post if I had the power. Sorry to everyone that did waste their time.
--
Greg
-
FK'n_dog
but that makes absolutely no sense
your code-
for (var i = 0; i<amount; i++) {
thisFlake = this.attachMovie("snowflake1", "snowflake1"+i, i);
}
you are increasing variable i each time around the loop
1st iteration - i=0 - you make - "snowflake1"+i = _level0.snowflake10
2nd iteration - i=1 - you make - "snowflake1"+i = _level0.snowflake11
3rd iteration - i=2 - you make - "snowflake1"+i = _level0.snowflake12
and so on....
makes sense now ???
always use List Variables to display what you have created.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|