Simple 1120: Access to undefined property error
Anyone want to take a stab at what I'm sure is a simple "1120" error?
1120: Access to undefined property circle_inst.
It's in the final function: "removeChild(circle_inst);"
If I remove the offending line, everything runs fine. The "circle_inst" appears, runs through its tween, but it is not removed.
//add box
var box_inst: box = new box();
addChild(box_inst);
box_inst.x = 200
box_inst.y = 200
//fade box in and out
TweenMax.fromTo(box_inst, 1, {alpha: 0}, {alpha:1,repeat: 1,repeatDelay: 5,yoyo: true,onComplete: removeBox});
//remove box and add circle
function removeBox(): void {
removeChild(box_inst);
var circle_inst: circle = new circle();
addChild(circle_inst);
circle_inst.x = 200;
circle_inst.y = 200;
//fade circle in and out
TweenMax.fromTo(circle_inst, 1, {alpha: 0}, {alpha:1,repeat: 1,repeatDelay: 5,yoyo: true,onComplete: removeCircle});
}
//remove circle and add star
function removeCircle(): void {
removeChild(circle_inst);
var star_inst: star = new star();
addChild(star_inst);
star_inst.x = 200;
star_inst.y = 200;
TweenMax.fromTo(star_inst, 1, {alpha: 0}, {alpha:1,repeat: 1,repeatDelay: 5,yoyo: true});
}
Thanks
