GrndMasterFlash
August 1st, 2007, 04:26 PM
i use this code to grab MC inside of the stage of a game, worked great in AS2, and im trying to get it to work in AS3, but when i do a trace it never gets past the first line "for(hitobj in stgstructure" and i think it is because im not sure what kind of var hitobj should initially be declared as, i have tried Object, String, and MovieClip(witch isn't really a var type but what the heck it was worth a shot)
function playerhit() {
for (hitobj in stgstructure) {
if (this.hitTestObject(stgstructure[hitobj])) {
if (typeof (stgstructure[hitobj]) == "movieclip") {
if (this.y>stgstructure[hitobj].y) {
this.y = stgstructure[hitobj].y;
player.jumping = false;
onground = true;
}
if (stgstructure[hitobj].leftblock == true) {
}
if (stgstructure[hitobj].rightblock == true) {
}
}
}
}
}
any ideas what i need to do, please help :crying:
function playerhit() {
for (hitobj in stgstructure) {
if (this.hitTestObject(stgstructure[hitobj])) {
if (typeof (stgstructure[hitobj]) == "movieclip") {
if (this.y>stgstructure[hitobj].y) {
this.y = stgstructure[hitobj].y;
player.jumping = false;
onground = true;
}
if (stgstructure[hitobj].leftblock == true) {
}
if (stgstructure[hitobj].rightblock == true) {
}
}
}
}
}
any ideas what i need to do, please help :crying: