In the example below an action script file with .as extension has been imported in the main Operations.mxml file. This .as file instance is brought through the source attribute in <mx:Script> tags.
Syntax for using 'source' attribute:-
<mx:Script source = ' '> ...... </mx:Script>
In the imported action script file four functions are defined and they are called through the click attribute property of buttons in the main mxml file.
IncludedFile.as
public function addition(x:Number, y:Number):Number {
|
Operations.mxml
<?xml version = '1.0' encoding = 'ISO-8859-1'?>
|
Operations.swf

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Action Script 'source' attribute example
Post your Comment