Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


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

1 Random Dr.Al-Mothana Gasaymeh

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

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

4 للتخلص من الكسور 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

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


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

Similar presentations


Ads by Google