Run Action Script code in Flash application

Below is an example showing how to run action script code in Flash application. By default, Flash player doesn't know which function to call. In order to let it know, you simply have to set your function name to the creationComplete attribute in the <s:Application> tag. In the example below, it is creationComplete="main()".

<?xml version="1.0" encoding="utf-8"?>
Description: Show how to run action script in Flash application.
<s:Application xmlns:fx="" 
         xmlns:mx="library://" minWidth="955" minHeight="600"
      import mx.controls.Text;
      public function main():void
        // Create the "Hello World!" text.
        var oText:Text = new Text();
        oText.text="Hello World!";
        // Add the Text element in the screen.