[Action Script 3] hitTestObject is not a function
Go to solution
Solved by madknight3,
Instead of
var money:coin = new coin();var Coin:Array = new Array(money,money,money,money,money);
Try
var Coin:Array = new Array(new coin(),new coin(),new coin(),new coin(),new coin());
To make sure the problem isn't because they all reference the same coin object.
edit: Also, just noticed that you mentioned the "hitTestObject is not a function" error. I'm not really sure, but according to the documentation of hitTestObject it requires a DisplayObject type as a parameter. Does your class mario implement DisplayObject? Also, are you sure you can use it on an Array, or do you have to use it on items in the array?
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now