0

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?

4

2 回答 2

1

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.

于 2012-09-10T18:55:43.260 回答
1

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.

于 2012-09-11T05:18:41.943 回答