PDA

View Full Version : simple, but buggine me


chipmandoo
08-30-2001, 09:16 PM
ok i have

on (press) {
_root:yscope = _ymouse
_root:yscopecoil = yscope -5
setProperty (scope, _y,_root:yscopecoil);
}

and what i want to do is move 'scope' up by 5 pixels when the mouse betton is pressed to add a recoil effect. i tried using the script above but when the mouse button is clicked it moves the 'scope' object to point -5, so 5 pixels from the top.

what i need it to do is move 5 pixels above the current mouse location.

Jesse
08-31-2001, 02:52 AM
on (press) {
_root.yscope = _ymouse;
_root.yscopecoil = _root.yscope-5;
setProperty (scope, _y, _root.yscopecoil);
}
You need to include the path when subtracting 5. Also note that in the code you gave the setProperty actions is being performed on whatever MC's name is stored in the variable 'scope'. If you have an MC called 'scope' which you want to setProprty, it should have quotes around it in the code.

chipmandoo
09-01-2001, 06:04 PM
ok, i changed it to

on (press) {
_root.yscope = _ymouse;
_root.yscopecoil = _root.yscope-5;
setProperty (scope, _y, _root.yscopecoil);
}

but is still doing the same thing :<. it moves it to -5 rather than moving it 5 pixels up from the mouse.

please help

Jesse
09-02-2001, 02:40 AM
then _root.yscope is prolyl 0. try using _root._ymouse instead of just _ymouse...

chipmandoo
09-03-2001, 10:09 AM
thanks so much, its sorted now :)