I need to access a variable from another class, and I continue to get the error "1119: access to a possible property undefined propertyListList via a link with a static class type". I do not see what I am doing wrong, since my variable is made "public" and "static".
where the variable is executed.
package classes.enemy { imports ... public class Enemy extends MovieClip { public static var enemyList:Array = new Array(); ** var speed:Number; public function initialize() { var stageReff:Stage = this.stage as Stage; addEventListener("enterFrame", enterFrame); } public function Enemy() { enemyList.push(this); ** this.x = 700; this.y = Math.random()*200 + 50; speed = Math.random()*5 + 5; }
who needs access to a variable
package classes.ship { imports ... public class Bullet extends MovieClip { var speed:Number; public function initialize() { var stageReff:Stage = this.stage as Stage; stage.addEventListener("enterFrame", enterFrame); }
Put "**" in the lines where the problem occurs and where the variable is produced, just to make it understandable.
Classes are in different folders (classes> enemy and classes> ship), I donβt know if this has anything to do with it.
Thanks in advance.
source share