View Full Version : Simple Script help
farvan
05-03-2008, 10:26 PM
For a script where I have it rotation and stopping at certain points
The problem: if (dir < stophere) {
When stophere is greater than Dir the thing automatic switches over to the next one instantly.
I've tried
if (dir = stophere) {
But that just makes it switch over instantly to the next one.
How do I make it work?
onClipEvent (enterFrame) {
if(go>200) {
dir -= direction1
if (dir < stophere) {
dir = stophere
}
}
}
farvan
05-05-2008, 02:26 PM
N/M
figured it out.
all I needed to do was put === instead of =
Careful, === is used for strict equality, it returns true if both objects have same type and same value. What you want is == it returns true if both objects have same value only.
farvan
05-06-2008, 01:13 PM
i've tried == and it gave me the same as =
But to my luck they both are the same type.
I also changed the
dir = stophere
to direction1 = 0
so I stop the movement not the rotation.
i've tried == and it gave me the same as =
But to my luck they both are the same type.
I also changed the
dir = stophere
to direction1 = 0
so I stop the movement not the rotation.
== should work just fine maybe that means there's more problem with your code. Post the whole code or the fla if you want us to take a look.
farvan
05-07-2008, 12:59 PM
== should work just fine maybe that means there's more problem with your code. Post the whole code or the fla if you want us to take a look.
n/m
== does work.
I guess when I changed the speed of the rotation and not the rotation its self it works.
Maybe there is something you can help me with.
Using Attachmovieclip but giving the attachedmovie properties.
like _x += 5 or hitTest commands
This has always a bit beyond my understanding.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.