Thread: Place 35 movie clips in random order on stage in specific XY coordinates
Started 1 month, 3 weeks ago by mercuryfx
I have 35 movie clips named mcMyObject1, mcMyObject2, etc. to mcMyObject35
Each time the playhead enters the frame this code sits on, I want all of these 35 movie clips to be placed on the stage in random order
I want each one of these 35 movie clips to land on one of these X coordinates: 57, 187, 317, 447, 577, 707, 837 and on one of these Y coordinates: 53, 183, 131, 443, 573. (It's a 7 x...
Hi mate,
First you have a variable called setNewLocations and a function called setNewLocations() this will lead to problems. Second your trace (that returns NaN) is because you can't times two arrays.
Can i ask why you were * the arrays?
Also what are the names of the stage objects?
Quote:
Originally Posted by cjke.7777
Hi mate,
First you have a variable called setNewLocations and a function called setNewLocations() this will lead to problems. Second your trace (that returns NaN) is because you can't times two arrays.
Can i ask why you were * the arrays?
Also what are the names of the stage objects?...
No worries...it does work
Not surprised your script didn't work as there were a host of syntax/logic errors in addition to those already highlighted:
this["mcFindObject"+1].Number - there is no built-in Number property for MovieClips and no indication that you've assigned your own property anywhere
this["mcFindObject"+((i-1)*7+j)].newXLoc - Same as above
this.newXLoc - no variable ...
Quote:
Originally Posted by glosrfc
No worries...it does work
Not surprised your script didn't work as there were a host of syntax/logic errors in addition to those already highlighted:
this["mcFindObject"+1].Number - there is no built-in Number property for MovieClips and no indication that you've assigned your own property ...
The script was commented so you should be able to follow it. If I'm around,
it'll be in here so feel free to post...if I'm not around, there are plenty
of others who'll provide assistance.
Quote:
Originally Posted by glosrfc
The script was commented so you should be able to follow it. If I'm around, it'll be in here so feel free to post...if I'm not around, there are plenty of others who'll provide assistance.
Fair enough. Thanks again!
Quote: Originally Posted by glosrfc The script was commented so you should be able to follow it. If I'm around, it'll be in here so feel free to post...if I'm not around, there are plenty of others who'll provide assistance. Fair enough. Thanks again!
The script was commented so you should be able to follow it. If I'm around, it'll be in here so feel free to post...if I'm not around, there are plenty of others who'll provide assistance.
Hi mate, First you have a variable called setNewLocations and a function called setNewLocations() this will lead to problems. Second your trace (that returns NaN) is because you can't times two arrays. Can i ask why you were * the arrays? Also what are the names of the stage objects?
Thread profile page for "Place 35 movie clips in random order on stage in specific XY coordinates" on http://www.kirupa.com.
This report page is a snippet summary view from a single thread "Place 35 movie clips in random order on stage in specific XY coordinates", located on the Message Board at http://www.kirupa.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity