Saturday, May 26, 2012

[Action Script] Problem with class definitions May,2012

Hello , I'm with a problem in class definition . The compiler presents the following errors :
...\Welcome.as(23): col: 4 Error: The private attribute may be used only on class property definitions.
...\Welcome.as(30): col: 4 Error: The public attribute can only be used inside a package.
...\Welcome.as(57): col: 4 Error: The public attribute can only be used inside a package.

I use the last version of the FlashDevelop, FP 11.2 , and AIR 3.2...

What the problem?
Thanks advance...

The code is the follow:

ActionScript Code: package screens {    import starling.display.Button;    import starling.display.Image;    import starling.display.Sprite;    import starling.events.Event;        public class Welcome extends Sprite     {        private var bg:Image;        private var title:Image;        private var hero:Image;                private var playBtn:Button;        private var aboutBtn:Button;                        public function Welcome()         {            //super();            this.addEventListener(starling.events.Event.ADDED_TO_STAGE, onAddedToStage);                        private function onAddedToStage(event:Event):void             {                trace ("WelcomeScreen to initialized");                                drawScreen();            }                        public function drawScreen():void            {                bg = new Image(Assets.getTexture("BgWelcome"));                this.addChild(bg);                                title = new Image(Assets.getTexture("WelcomeTitle"));                title.x = 440;                title.y = 20;                this.addChild(title);                                hero = new Image(Assets.getTexture("WelcomeHero"));                this.addChild(hero);                hero.x = -hero.width;                hero.y = 100;                                playBtn  = new Button(Assets.getTexture("WelcomePlayBtn"));                this.addChild(playBtn);                playBtn.x = 500;                playBtn.y = 260;                                aboutBtn = new Button(Assets.getTexture("WelcomeAboutBtn"));                this.addChild(aboutBtn);                aboutBtn.x = 410;                aboutBtn.y = 380;                                            }                        public function initialize():void                  {                this.visible = true;                                hero.x = -hero.width;                hero.y = 100;            }        }    }}
Problem with class definitions

Related Post



0 comments: