AS3 How to import a button

I am new to flash AS3. I inserted a button and gave it the name login_btn.

Now in my action script, i want to do a login_btn.visible = false; However I'm not sure what "class" i need to import into my action script file. Is it import flash.display.button or something?

Answers


It is enough to have the

login_btn.visible = false;

itself. However, for future, you could import it from flash.display packagae.

import flash.display.SimpleButton;

Hint: If you are not sure what to import, just type

var UR_VAR_NAME

then put a semi colon ( : ), flash will automatically import its class. It is feature of the AS Editor.


If you gave the button an instance name of login_btn, then you just access it from it's parent (whatever timeline you put the button on)

If the parent is a timeline and your not using a document class, then just add a keyframe to the timeline and put this code on it:

login_btn.visible = false;

If you gave it the class name of login_btn in the actionscript linkage settings. Then you instantiate it like this:

var btn:login_btn = new login_btn();

In either case, no imports are necessary as they are automatically taken care of.


Need Your Help

RabbitMQ : binding from a DLX

php rabbitmq amqp php-amqplib

I've searched for that information (including the docs) and I can't find it.

How does Git determine what objects need to be sent between repositories?

git git-push git-pull git-fetch

I have looked here but couldn't quite figure out the things I was wondering about: how does git push or git pull figure out what commit objects are missing at the other side?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.