Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-31-2010, 08:05 PM   #1
mena__99
Member
 
Join Date: Jul 2010
Posts: 56
Exclamation [AS3] hitTestObject Not Working

hello guys , iam makeing a new project ... iam tring to make the Player's car not to touch the side road , what should it do ? ..


PlayerCar_mc >>> inside this movie clip there is a ActionScript layer have all the car movement ..... the car activates ones i click on it.

the point is when i made a rectangle and called it "Building" and tried the hitTestObject ... it gave me an error said that "Parameter hitTestObject must be non-null' error" i dont even know what null means , plz help me ...


ActionScript Code:
if (this.carMC.hitTestObject(this.Buildings_mc)) {     trace ("working"); }


Not Working >>>> Failed!! ...

Error :
--------------------------------------------------------------------
TypeError: Error #2007: Parameter hitTestObject must be non-null. ^
at flash.display:isplayObject/_hitTest() ^
at flash.display:isplayObject/hitTestObject() ^
at 7_fla::MainTimeline/frame1713() ^
--------------------------------------------------------------------




What should i do .. why its not working , is there is any other method ? ... if there is plz Let me know i will really appraciate it .


Thank you alot .
mena__99 is offline   Reply With Quote
Old 07-31-2010, 08:33 PM   #2
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,682
Send a message via Skype™ to henke37
Default

I recomend learning what an object refference is. And then reading my first article.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 is online now   Reply With Quote
Old 07-31-2010, 08:35 PM   #3
mena__99
Member
 
Join Date: Jul 2010
Posts: 56
Default

Quote:
Originally Posted by henke37 View Post
I recomend learning what an object refference is. And then reading my first article.
ok i will try that .. but first plz tell me where is ur article ?
mena__99 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:48 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.