-
[CS3] Random Positioning
Is there a simple way to randomly position buttons on a stage. I have a 1024x768 project and would like to insert several (i.e. 3 or 4) "Easter eggs" (buttons with a blank first frame) that randomly position themselves every time the file is accessed. Is there a simple way to do this? TIA.
-
you'll need a function to return random numbers for the _x and _y position. Check the Math.random() method. Function in example in that link.
gparis
-
trace("AKA: Biro Barna");
yourButton.x = stage.stageWidth * Math.random();
yourButton.y = stage.stageHeight * Math.random();
| Windows MSN: birobarna [at] hotmail [dot] com | Skype: barna.biro | WebLog: http://blog.wisebisoft.com/ |
| Software Developer / Flash & Flex Developer | Student ( Computer Science ) | Interested in: Sharing Knowledge |
| Romanian Adobe Flash, Flex, AIR Forum: http://www.flashforum.ro/ | By perseverance the snail reached the ark. |
-
PlenaryCreation, AS3 answers should be posted in the AS3 forum, unless the user specifies he's using AS3, which would anyway, put him in the wrong forum
gparis
-
trace("AKA: Biro Barna");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|