package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.MouseEvent; import flash.text.TextField; public class IOSExtensionTest extends Sprite { private var ext:IOSExtension; private var txt:TextField; public function IOSExtensionTest() { stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; ext = new IOSExtension(); txt = new TextField(); txt.width = 200; txt.height = 200; addChild(txt); stage.addEventListener(MouseEvent.CLICK, onClick); } protected function onClick(event:MouseEvent):void { // random negative or positive value var minus1:Number = int(Math.random()*2) - 1 | 1; var minus2:Number = int(Math.random()*2) - 1 | 1; var num1:Number = (Math.random()*100|0)/10*minus1; var num2:Number = (Math.random()*100|0)/10*minus2; var int1:int = int(num1); var int2:int = int(num2); var uint1:uint = uint(Math.abs(int1)); var uint2:uint = uint(Math.abs(int2)); var str1:String = "Hello"; var str2:String = "World"; var bool:Boolean = true; txt.text = "sum: "+num1+"+"+num2+"="+ext.sum(num1,num2)+"\n"; txt.text += "subtract: "+int1+"-"+int2+"="+ext.subtract(int1,int2)+"\n"; txt.text += "multiply: "+uint1+"*"+uint2+"="+ext.multiply(uint1,uint2)+"\n"; txt.text += "concatenate: "+str1+"+"+str2+"="+ext.concatenate(str1,str2)+"\n"; txt.text += "opposite: !"+bool+"="+ext.opposite(bool)+"\n"; } } }