PDA

View Full Version : [AS3] hitTestObject Not Working


mena__99
07-31-2010, 08:05 PM
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 ...


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::DisplayObject/_hitTest() ^
at flash.display::DisplayObject/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 .

henke37
07-31-2010, 08:33 PM
I recomend learning what an object refference is. And then reading my first article.

mena__99
07-31-2010, 08:35 PM
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 ?