Actionscript
AS2 Game Card Base Deck
by webmasterjunkie on Sep.27, 2010, under Actionscript, Programming
I made a flash based holdem game for a friend a while ago, and had this posted on my old blog, so figured I would repost the whole thing.
First, create the card arrays.
1 2 | var cardSuits:Array = new Array ("Hearts", "Clubs", "Diamonds", "Spades"); var cardSigns:Array = new Array ("A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"); |
AS2 MovieClip Proximity to Mouse
by webmasterjunkie on Sep.26, 2010, under Actionscript, Programming
Here’s another neat little script that I had to piece together because there was no good resource available on the Internet. I have quite a few more helpful little scripts that I will post soon.
1 2 3 4 5 6 7 | function get_proximity (clip:MovieClip):Number { var mouseyX:Number = _root._xmouse; var mouseyY:Number = _root._ymouse; var clipX:Number = clip._x; var clipY:Number = clip._y; return Math.sqrt ((mouseyX - clipX) * (mouseyX - clipX) + (mouseyY - clipY) * (mouseyY - clipY)); } |
AS2 Random Number Generator
by webmasterjunkie on Sep.26, 2010, under Actionscript, Programming
I remember having to scour the Internet in order to get the code pieced together just right in order to do this. So, in case you were looking, here you go.
1 2 3 | function get_random (lowNumber:Number, highNumber:Number):Number { return Math.ceil (Math.random () * (highNumber - lowNumber + 1)) + (lowNumber - 1); } |

Connect
Enter your WordPress.com blog URL
http://.wordpress.com
Proceed