Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: programming problem with mc's growing in size
From: Anthony Smith
Date: Thu, 22 Feb 2001 06:59:26 -0000


heya peoples .. weve got a coding problem here.. were making a site that
uses a mc following the mouse, and it is suppposed to follow perspecitve as
you drag the mouse.. ie when the mouse is at the bottom of the screen the mc
is big.. when its at the top of the screen the mc is small.. check here if
your confused.. http://www.lowercase.com.au/lowercase1.htm

the problem is that over time the movie clip grows and grows ( slowly but
gradually ) even tho the code is working fine.. any ideas whats wrong?



here's the code

_root.hidden.mousex is the x position of a hidden movie that is being
dragged. This piece of code loops.

posx1 = getProperty("/dragobject", _x)-_root.hidden.mousex;
if (Number(posx1)>0) {
accelx = -(posx1*posx1)/1000;
} else {
accelx = (posx1*posx1)/1000;
}
posy1 = getProperty("/dragobject", _y)-_root.hidden.mousey;
if (Number(posy1)>0) {
accely = -(posy1*posy1)/1000;
} else {
accely = (posy1*posy1)/1000;
}
speedx = (Number(speedx)+Number(accelx))*.9;
speedy = (Number(speedy)+Number(accely))*.5;
setProperty ("_root.dragobject", _x, Number(getProperty("_root.dragobject",
_x))+Number(speedx));
setProperty ("_root.dragobject", _y, Number(getProperty("_root.dragobject",
_y))+Number(speedy));
setProperty ("_root.dragobject", _xscale,
Number(getProperty("_root.dragobject", _xscale))+(Number(speedy)));
setProperty ("_root.dragobject", _yscale,
Number(getProperty("_root.dragobject", _yscale))+(Number(speedy)));

any help would be greatly appreciated!!

8_b!t_b@y




[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]