Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 05-25-2012, 06:37 PM   #1
tassiocaique
Registered User
 
Join Date: May 2012
Posts: 3
Default Problem with class definitions

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;             }         }     } }
tassiocaique is offline   Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:06 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.