Forum Topic: ActionScript Help Moi

(262 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

starBlinky

Reply To Post Reply & Quote

Posted at: 6/14/06 10:56 PM

starBlinky NEUTRAL LEVEL 06

Sign-Up: 09/24/04

Posts: 488

if (!_root.land.hitTest(_x+x, _y+y, true))

..is the code I need help with. I essentially took this code from another program. I am an intermediate c++ programmer but new to AS.

Heres my question
What does the following code do..
" (_x+x, _y+y, true) "
in this statement..
if (!_root.land.hitTest(_x+x, _y+y, true))


Note:
So this code is in a MC. Pseudocode as follows:
if this MC is not hitting another MC with instance name 'land' and..this.. (_x+x, _y+y, true)??...
Then do whats in the curley braces following the statement.


None

StarCleaver

Reply To Post Reply & Quote

Posted at: 6/14/06 11:04 PM

StarCleaver LIGHT LEVEL 29

Sign-Up: 01/03/03

Posts: 10,103

That code is saying will execute when _root.land is in contact with the point (_x+x,_y+y). The "true" part is saying that _root.land's actual graphics will be used to calculate the hitTest, not the bounding box for _root.land. Make sense?

I could surely die
If I only had some pie
Club-a-Club Club, son

BBS Signature

None

starBlinky

Reply To Post Reply & Quote

Posted at: 6/14/06 11:21 PM

starBlinky NEUTRAL LEVEL 06

Sign-Up: 09/24/04

Posts: 488

Yes it does. Thank you that helps :)


None

starBlinky

Reply To Post Reply & Quote

Posted at: 6/15/06 12:59 AM

starBlinky NEUTRAL LEVEL 06

Sign-Up: 09/24/04

Posts: 488

At 6/14/06 11:04 PM, Star_Cleaver wrote: That code is saying will execute when _root.land is in contact with the point (_x+x,_y+y). The "true" part is saying that _root.land's actual graphics will be used to calculate the hitTest, not the bounding box for _root.land. Make sense?

Are you sure that it executes when _root.land is in contact with that point? And its not the MC that is housing this code? _root.land is a none moving MC. So it's not all of a sudden going to be at point _x+x,_y+y. Its position is constant.

Also you said the code IS executed when its in contact with that point, however; the code is preceded by a ! symbol, so dont you mean the code WONT execute when its in contact with that point?


None

starBlinky

Reply To Post Reply & Quote

Posted at: 6/15/06 11:08 AM

starBlinky NEUTRAL LEVEL 06

Sign-Up: 09/24/04

Posts: 488

plz reply


None

CorkySurprise

Reply To Post Reply & Quote

Posted at: 6/15/06 11:12 AM

CorkySurprise EVIL LEVEL 09

Sign-Up: 02/25/05

Posts: 73

You are correct, the ! sign means if it is NOT true.


All times are Eastern Standard Time (GMT -5) | Current Time: 07:59 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!