|
package
{
import flash.display.*;
import flash.events.Event;
public class Main extends MovieClip
{
public function Main() // Constructor
{
// Register the listener method that will be executed when the Document Class is added to the Stage.
addEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
}
private function handleAddedToStage(e:Event):void
{
// Release the registered event listener after use to prevent potential malfunctions.
removeEventListener(Event.ADDED_TO_STAGE, handleAddedToStage);
// To do :
// Set the text of tfMain that is to be displayed on the screen.
// The tfMain that is created in the Stage is automatically included in the Document Class.
tfMain.text = "Hello ActionScript";
}
}
}
|