
Welcome Guest
|
#1
|
|||
|
|||
|
Shuffle code
I am using the following code to shuffle MC's in a puzzle
Actionscript:
on (release) {
for (var i = 1; i<16; i++) {
with (this["p"+i]) {
_x = Math.floor(Math.random()*400)+180;
_y = Math.floor(Math.random()*400)+60;
_rotation = Math.floor(Math.random()*2)*90;
}
}
}It works fine except when you move pieces and then hit the shuffle button. In testing the following error message pops up: Error: A 'with' action failed because the specified object did not exist. In play, all MC's shuffle except any that were dragged prior to hitting the shuffle button. Why would moving an MC a few pixels cause this? The MC hasn't been 'removed' from the main movie.
|
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Code to make Flash movie clips shuffle | thevibe | Flash CS4 |
1 | 10-27-2009 10:14 AM |
| optimizing code | orderofout | Actionscript 2.0 |
3 | 10-25-2007 02:39 PM |
| Adobe's code only, still not compiling | saumya | ActionScript 3.0 |
3 | 04-26-2006 03:54 PM |
| Slide In Background (Need Advice on Code) | TymeAw8z | Flash MX |
5 | 07-25-2005 03:55 PM |
| Problems with XML code from reference book. | PUP100 | XML & Sockets | 0 | 01-07-2005 12:07 PM |




