Groups | Blog | Home
all groups > flash actionscript > july 2007 >

flash actionscript : Code works for Flash player 6 settings but not for 8...


Iron_Mike
7/1/2007 12:57:24 PM
Hi,

I'm pretty new to Action script and I have a problem here that I can't seem to
figure out.

I have this Action Script Code which is attached to a simple movieclip, and it
all works IF the general settings are set for Flash Player 6.

It does not work for Flash Player 7 or above, which is probably because this
is Actions Script 1 Code...

Here's the code:

onClipEvent (load) {
accel =0;
rate = 0.05;
trace(_y)
_root.ykoord=0;
}

onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

}

Do I need to change the code ?

I wanna publish for either Flash player 8 or 9.

Thanx for your help in advance !!! ;)

Mike

onClipEvent (load) {
accel =0;
rate = 0.05;
trace(_y)
_root.ykoord=0;
}

onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

}
kglad
7/1/2007 1:50:14 PM
:



onClipEvent (load) {
accel =0;
rate = 0.05;
y=0;
trace(_y)
_root.ykoord=0;
}

onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }

}
Iron_Mike
7/2/2007 12:00:00 AM
kglad,

thanx !!!

kglad
7/2/2007 1:23:06 PM
AddThis Social Bookmark Button