Hi, struggling programming student here. I am making a game where you click on people to have them fall and land on a building. I can not get collision detection to work. I have 3 different people with the different instance names but its the same movieclip, they have "states" and i use a switch case break system for their moving(falling) function.
I get the TypeError: Error #1010 when I use this code to detect collision with the building movieclip, the game gets weird and wont work properly.
function DudeMove (dude:MovieClip):void
{
var gravity:Number = 0.08;
switch(dude.State)
{
case CLINGING:
[AS3] TypeError: Error #1010 when i try to detect collision
Hi, struggling programming student here. I am making a game where you click on people to have them fall and land on a building. I can not get collision detection to work. I have 3 different people with the different instance names but its the same movieclip, they have "states" and i use a switch case break system for their moving(falling) function.
I get the TypeError: Error #1010 when I use this code to detect collision with the building movieclip, the game gets weird and wont work properly.
function DudeMove (dude:MovieClip):void
{
var gravity:Number = 0.08;
switch(dude.State)
{
case CLINGING:
Ugh. What does the error say after #1010? Errors aren't just obstacles to get around, they are clues as to the nature of the problem.
I Googled your error number, and it's apparently, "A term is undefined and has no properties." So your next step is find out which term is undefined, "dude" "dude.target" or "building_MC" then check the places where you thought you were defining them, etc.