-
actionscript HELP!
hey, i have this snow effect controlled by actionscript in the timeline of my scene, but the effect plays through all of the scenes.
can ne1 tell me how to stop this effect from playing on the other scenes?
cheers!
-
Moderator
What AS are you using for the snow ?
-
on the stage i have this actionscript on a keyframe..
"for (k=0; k<50; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}"
i also have a instance of a movieclip on the stage with this actionscript..
"onClipEvent (load) {
movieWidth = 700;
movieHeight = 140;
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;
this._xscale = this._yscale=22+Math.random()*100;
this._alpha = 75*100;
this._x = 20+Math.random()*movieWidth;
this._y = 0+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
rad += (k/180)*Math.PI;
this._x -= Math.cos(rad);
this._y += i;
if (this._y>=movieHeight) {
this._y = 20;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -40*movieWidth;
this._y = 450;
}
}"
ne suggestions?
-
1. Add you code in between [CODE] [CODE/]
2. Use // before you add commentary to the code
3. Use remotely proper grammar -- this isn't AIM >.>
It makes it much less confusing. ;-)
As far as your problem, I can't really help ya there. :-\
-
Senior Member
I added a few lines to the end of your snow script:
Code:
onClipEvent (load) {
movieWidth = 700;
movieHeight = 140;
i = 1+Math.random()*2;
k = -Math.PI+Math.random()*Math.PI;
this._xscale = this._yscale=22+Math.random()*100;
this._alpha = 75*100;
this._x = 20+Math.random()*movieWidth;
this._y = 0+Math.random()*movieHeight;
}
onClipEvent (enterFrame) {
rad += (k/180)*Math.PI;
this._x -= Math.cos(rad);
this._y += i;
if (this._y>=movieHeight) {
this._y = 20;
}
if ((this._x>=movieWidth) || (this._x<=0)) {
this._x = -40*movieWidth;
this._y = 450;
}
if (_root.noSnow) // jbum added this part
{
this.removeMovieClip();
}
}
On the frame in your main timeline where you want the snow to stop, add the following
frame script:
-- regards
-
hey jbum thanks alot you know your stuff! much appreciated
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
|