Example:
In the class code:
/**
*...
* @ AuthorHttp://as63.net
* @ Version 0.1
*/
Package {
Import flash. Text. TextField;
Public class main {
Private var my_txt: TextField;
Public Function main (_ STR: TextField ){
My_txt = _ Str;
My_txt.text = "hello ";
}
}
}
The FLA the Code:
VaR my_main: Main = new main (txt );
--------------------------------------------------------
This method is easier. No document added to the Code. Directly modify the FLA publish settings.
Cancel automatic statement stage instance in front of the hook.
Example:
In the class code:
/**
*...
* @ AuthorHttp://as63.net
* @ Version 0.1
*/
Package {
Import flash. display. Sprite;
Import flash. Text. TextField;
Public class Main extends sprite {
Public var txb: TextField;
Public Function Main (){
Txb. Text = "Welcome to AS on-Http://as63.net";
}
}
}
And then the FLA in document Class Name box direct input document class name.
Source File Download: as3getinstance.rar