actionscript 3 - Global variables in action script 3 -


i'm new in action script 3. intend use global variable.

here way this , this

i download simple banner here

create file globe.as in same directory test_banner_actionscript_3.fla. globe.cs contains next code

package  {   public class main    {      public static var mypencil:number = 3;   } } 

banner code looks

mybanlink.addeventlistener(mouseevent.click, mybanlinkclicklistener);  function mybanlinkclicklistener(e:mouseevent):void {     trace(main.mypencil); //3     var url:string="http://www.web-article.com.ua";     var urlrequest:urlrequest=new urlrequest(url);     navigatetourl(urlrequest); } 

but

error: 1120: access of undefined property main 

interesting intellisense suggests "mypencil" when typing "main."

what's wrong?

you possibly forgot import main in begin of banner code. remember, when use class, check class imported.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -