/ Published in: ActionScript 3
Looking forward for the most optimized solution for the same
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> <mx:Script> <![CDATA[ // 0,1,1,2,3,5,8,13 public function init():void{ var a:Number = 0; var b:Number = 1; txt.text = a.toString(); txt.text += "\n"+b; for(var i:int=2;i<10;i++){ var c:Number = a+b; a = b; b = c; txt.text += "\n"+c; } } ]]> </mx:Script> <mx:TextArea x="118" y="57" width="553" height="412" id="txt"/> </mx:Application>