# Random Dr.Al-Mothana Gasaymeh. الرقم العشوائي بين 0 و 1 stop(); myButton2.addEventListener(MouseEvent.CLICK, myButtonClick2); function myButtonClick2(event:MouseEvent):void.

## Presentation on theme: "Random Dr.Al-Mothana Gasaymeh. الرقم العشوائي بين 0 و 1 stop(); myButton2.addEventListener(MouseEvent.CLICK, myButtonClick2); function myButtonClick2(event:MouseEvent):void."— Presentation transcript:

Random Dr.Al-Mothana Gasaymeh

الرقم العشوائي بين 0 و 1 stop(); myButton2.addEventListener(MouseEvent.CLICK, myButtonClick2); function myButtonClick2(event:MouseEvent):void { var someNumber:Number = Math.random(); q.text =String(someNumber); }

الرقم العشوائي بين 0 و 0 1 stop(); myButton2.addEventListener(MouseEvent.CLICK, myButtonClick2); function myButtonClick2(event:MouseEvent):void { var someNumber:Number = Math.random*10(); q.text =String(someNumber); }

للتخلص من الكسور var someNum:Number = Math.floor(Math.random()*5); // gives you 0, 1, 2, 3, or 4 by "flattening" the decimal number var someNum:Number = Math.ceil(Math.random()*5); // gives you 1, 2, 3, 4, or 5 by raising the decimal number var someNum:Number = Math.round(Math.random()*5); // gives you 0, 1, 2, 3, 4, or 5 by rounding the decimal number up or down

صمم لعبة الأرقام العشوائية

Download ppt "Random Dr.Al-Mothana Gasaymeh. الرقم العشوائي بين 0 و 1 stop(); myButton2.addEventListener(MouseEvent.CLICK, myButtonClick2); function myButtonClick2(event:MouseEvent):void."

Similar presentations