-
[AS3] <between> command?
i'm pretty sure there is no <is in between this number give or take 5 values> command, so how would i say:
Actionscript Code:
_root.mcMain.y <is in between> this.y <plus or minus> 5
thanks for all help -- much appreciated!
-
Code:
if (_root.mcMain.y>this.y-5&&_root.mcMain.y<this.y+5) {
// do whatever
}
-
ahh yes thank you! i feel dumb now -- i was using || instead of &&
thanks again
-
Senior Member
if (Math.abs (_root.mcMain.y - this.y) < 5) would work too
-
ahh yes that's what i was looking for, but i couldn't get it to work lol so i tried the other suggestion and screwed it up with || not &&. but thanks!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|