Forum Topic: actionscript question

(140 views • 9 replies)

This topic is 1 page long.

<< < > >>
None

Bomee

Reply To Post Reply & Quote

Posted at: 5/6/06 11:23 AM

Bomee FAB LEVEL 09

Sign-Up: 01/06/06

Posts: 26

I wanted to add a snow effect to my latest movie, but it continues to play in every scene... How can I make it stop where I want it to stop?

thanks in advance :)


None

joshy24

Reply To Post Reply & Quote

Posted at: 5/6/06 11:26 AM

joshy24 LIGHT LEVEL 06

Sign-Up: 11/28/04

Posts: 708

how about deleting it where you want it to stop?

Steam: imuffin101

BBS Signature

None

Bomee

Reply To Post Reply & Quote

Posted at: 5/6/06 11:27 AM

Bomee FAB LEVEL 09

Sign-Up: 01/06/06

Posts: 26

how exactly do I delete it? i tried adding a blank keyframe

*is so noob* haha


None

UknownXL

Reply To Post Reply & Quote

Posted at: 5/6/06 12:23 PM

UknownXL EVIL LEVEL 09

Sign-Up: 05/22/05

Posts: 988

Show the code.


None

Bomee

Reply To Post Reply & Quote

Posted at: 5/6/06 12:49 PM

Bomee FAB LEVEL 09

Sign-Up: 01/06/06

Posts: 26

onClipEvent(load) {
this._alpha=random(70)+20;
this._width=this._height=random(4)+4;
this._y=random(640);
this._x=random(480);
fall_speed = 1+Math.random()*2;
k=-Math.PI+Math.random()*Math.PI;
rad=0;
centerX=320;
centerY=240;
}
onClipEvent(enterFrame) {
rad+=(k/180)*Math.PI;
this._x+=Math.cos(rad)+ms;
this._y+=fall_speed;
ms=(centerX-_root._xmouse)/100;
if (this._y>480) {
this._y=0;
}
if (this._x>640) {
this._x=0;
}
if (this._x<0) {
this._x=640;
}
}


None

UknownXL

Reply To Post Reply & Quote

Posted at: 5/6/06 12:53 PM

UknownXL EVIL LEVEL 09

Sign-Up: 05/22/05

Posts: 988

Just add an if statement.
Put this on the frames you want it to snow.

_root.snow = true;

and this on the ones you dont want it to.

_root.snow = false;

onClipEvent(load) {
this._alpha=random(70)+20;
this._width=this._height=random(4)+4;
this._y=random(640);
this._x=random(480);
fall_speed = 1+Math.random()*2;
k=-Math.PI+Math.random()*Math.PI;
rad=0;
centerX=320;
centerY=240;
}
onClipEvent(enterFrame) {
if(_root.snow == true){
rad+=(k/180)*Math.PI;
this._x+=Math.cos(rad)+ms;
this._y+=fall_speed;
ms=(centerX-_root._xmouse)/100;
if (this._y>480) {
this._y=0;
}
if (this._x>640) {
this._x=0;
}
if (this._x<0) {
this._x=640;
}
}

And you might be putting the movie clip on every frame.


None

Bomee

Reply To Post Reply & Quote

Posted at: 5/6/06 01:37 PM

Bomee FAB LEVEL 09

Sign-Up: 01/06/06

Posts: 26

thank you very much. i like your zelda mini game

just one more question, when you past the root= false code, you just do it on a new layer/frame?

again thanks!


None

wesdood

Reply To Post Reply & Quote

Posted at: 5/6/06 01:40 PM

wesdood NEUTRAL LEVEL 28

Sign-Up: 04/06/05

Posts: 11,743

At 5/6/06 01:37 PM, Bomee wrote: thank you very much. i like your zelda mini game

just one more question, when you past the root= false code, you just do it on a new layer/frame?

again thanks!

you would put it on a new frame


None

UknownXL

Reply To Post Reply & Quote

Posted at: 5/6/06 02:15 PM

UknownXL EVIL LEVEL 09

Sign-Up: 05/22/05

Posts: 988

What he said above.


None

Bomee

Reply To Post Reply & Quote

Posted at: 5/6/06 02:19 PM

Bomee FAB LEVEL 09

Sign-Up: 01/06/06

Posts: 26

thanks guys. It didn't work, maybe because I'm doing something wrong, but i decided to make the snow into a movie, put it into a new layer, and use the load and unload movie commands

Thank you very much again :)


All times are Eastern Standard Time (GMT -5) | Current Time: 01:45 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!