As3 Error 1119
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring as3 compiler error 1119 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question
As3 Error 1010
x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join as3 error 1061 them; it only takes a minute: Sign up AS3 - Error 1119: Access of possibly undefined property enemyList through a reference with static type Class. up vote 3 down vote favorite I need to get access to a variable from
As3 Error 1120
another class and I keep getting error '1119: Access of possibly undefined property enemyList through a reference with static type Class.' I can't see what I do wrong since my variable is made 'public' and 'static'. class where the variable is made. 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() as3 error 119 { enemyList.push(this); ** this.x = 700; this.y = Math.random()*200 + 50; speed = Math.random()*5 + 5; } //code } } class that needs access to the 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); } //code function enterFrame(e:Event):void { this.x += speed; trace(enemy.enemyList); ** } } } Putted '**' behind the lines where the problem occurs and where the variable is made, just to make it clear. Classes are in different folders (classes > enemy & classes > ship), don't know if that has anything to do with it. Thanks in advance. actionscript-3 share|improve this question asked Jan 2 '12 at 1:17 Robbe Van Winckel 1602514 add a comment| 4 Answers 4 active oldest votes up vote 1 down vote accepted If you want to access a static property, you need to use the class it is defined in: Enemy.enemyList Also make sure the class is imported properly in your ship's class: import classes.enemy.Enemy; share|improve this answer edited Dec 3 '12 at 10:47 answered Jan 2 '12 at 1:30 Kapep 15.8k34974 I assume the lower case enemy is just a typo. If not, I will gladly expand my answer with more information. –Kapep Jan 2 '12 at 1:31 If I do that I get: 1120: Access of undefined property Enemy. –Robbe Van
here for a quick overview of the site Help Center Detailed answers to any questions
Access Of Possibly Undefined Property Text Through A Reference With Static Type Number.
you might have Meta Discuss the workings and policies of this
1120: Access Of Undefined Property
site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a http://stackoverflow.com/questions/8696709/as3-error-1119-access-of-possibly-undefined-property-enemylist-through-a-refe community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to fix error 1119 as3 up vote 1 down vote favorite I'm new to as3. And i'm struggling with the error 1119. I don't understand how to fix it. the error is: Access http://stackoverflow.com/questions/26489751/how-to-fix-error-1119-as3 of possibly undefined property text through a reference with static type flash.text:TextField. package { import flash.display.MovieClip; import flash.events.KeyboardEvent; import flash.ui.Keyboard; import flash.events.Event; import flash.utils.Timer; import flash.events.TimerEvent; import flash.text.TextField; // public function kan je ook gebruiken in een ander as. file // private function kan je alleen gebruiken in hetzelfde as. file public class firstGame extends MovieClip { public var mcPlayer:MovieClip; private var leftKeyIsDown:Boolean; private var rightKeyIsDown: Boolean; private var aMissileArray: Array; private var aEnemyArray: Array; public var scoreTxt: TextField; public var ammoTxt : TextField; public var menuEnd: mcEndGameScreen; private var tEnemyTimer : Timer; private var nScore : Number; private var nAmmo : Number; public function firstGame () { playGameAgain(null); } private function playGameAgain (e:Event) : void { //initilaiz variables aMissileArray = new Array (); aEnemyArray = new Array (); nScore = 0; nAmmo = 20; mcPlayer.visible = true; updateScoreText(); updateAmmoText(); menuEnd.addEventListener("PLAY_AGAIN", playGameAgain); menuEnd.hideScreen (); //trace("First Game Loaded"); //Listern for key presses and relesead stage.addEventListener(KeyboardEvent.KEY_UP, keyUp); stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDown); //Se
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us http://stackoverflow.com/questions/34752802/getting-the-error-1119-access-of-possibly-undefined-property-visible-through-a Learn more about Stack Overflow the company Business Learn more about hiring developers http://stackoverflow.com/questions/35398197/as3-error-1119-access-of-possibly-undefined-property-stage or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting the error 1119: Access of possibly undefined as3 error property visible through a reference with static type Class up vote -3 down vote favorite I am attempting to hide a symbol (Grill image) as soon as my animation loads. Currently I am getting the error, E:\Burger Game\DragandDrop\Dragable.as, Line 4, Column 8 1119: Access of possibly undefined property visible through a reference with static type Class. As you can probably tell, I am new to flash. package as3 error 1119 DragandDrop { Grill.visible=false; import flash.display.MovieClip; import flash.events.MouseEvent; import flash.geom.Point; public class Dragable extends MovieClip { protected var homePos:Point; var totalToBowl:int =3; var i:int = 0; public function Dragable () { homePos=new Point( x, y); buttonMode =true; addEventListener ( MouseEvent.MOUSE_DOWN, move); } //egg functions protected function move(event:MouseEvent) :void { parent.addChild(this); startDrag(); stage.addEventListener(MouseEvent.MOUSE_UP, stageUp) } //item drop function protected function stageUp(event:MouseEvent):void { stopDrag(); if (event.target.dropTarget != null &&dropTarget.parent.name == "Bowl") { scaleX=scaleY=0; alpha=0.5; y= stage.stageHeight-height -700; x=stage.stageWidth-width- 1400; buttonMode=false; removeEventListener(MouseEvent.MOUSE_DOWN, stageUp) i++ }if (i == totalToBowl){ i=10 trace(i); event.target.dropTarget.visible = false; } if (i==10 ) { dropTarget.parent.visible = false; }else{ returnToHome(); } } protected function returnToHome():void { x = homePos.x; y= homePos.y; } } Any idea why I am getting this error? Any help would be massively appreciated. Many thanks, Rob actionscript-3 flash-cs5 share|improve this question asked Jan 12 at 20:04 Rob Scarisbrick 2 It sounds like Grill is a class linked to a symbol, but visible is an instance property, not a class property (static). Where is the Grill instance in relation to Dragable? Is Dragable your document class? –Aaron Jan 12 at 21:45 @Rob - Did you find a solution? –BadFeelingAboutThis Feb 29 at 21:32 ad
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AS3 - Error 1119: Access of possibly undefined property stage up vote 0 down vote favorite I'm new to programming so I was working with procedural programming. I decided to change to object oriented programming shortly after begining this paticular code and now I keep getting this "error 1119: Access of possibly undefined property stage through a reference with static type Class." I'm trying to build a menu but the "Main.stage = stage" line keeps poping the error. I understand that It has something to do with instances that I'm not doing properly but I'm not sure what I'm doing wrong nor how to fix it. package { import flash.display.MovieClip; import flash.events.MouseEvent; public class Main extends MovieClip { var MC_screen :MovieClip = new MovieClip(); var MC_background :Background; var MC_backgroundMenu :BackgroundMenu; var MC_backgroundInstructions :BackgroundInstructions; var MC_backgroundScore :BackgroundScore; //var MC_fly :Flyy; var BT_buttonBack :ButtonBack; var BT_buttonPlay :ButtonPlay; var BT_buttonScore :ButtonScore; var BT_buttonInstructions :ButtonInstructions; public function Main() { Main.stage = stage; drawMenu(); } private function drawMenu() { addChild(MC_screen) MC_backgroundMenu = new BackgroundMenu(); MC_backgroundMenu.x = stage.stageWidth/2; MC_backgroundMenu.y = stage.stageHeight/2; MC_screen.addChild(MC_backgroundMenu); BT_buttonPlay = new ButtonPlay(); BT_buttonPlay.x = stage.stageWidth/2; BT_buttonPlay.y = 350; MC_screen.addChild(BT_buttonPlay); BT_buttonScore = new ButtonScore(); BT_buttonScore.x = stage.stageWidth/2; BT_buttonScore.y = 500; MC_screen.addChild(BT_buttonScore); BT_buttonInstructions = new ButtonInstructions(); BT_buttonInstructions.x = stage.stageWidth/2; BT_buttonInstructions.