Hi, how can I adjust the _x and _y area positioning of this set of duplicate movieclips? 710 x 143 are the dimensions I would like the duplicateMovieClip to take place, but it is not the positioning. How can I fix this?
what exactly do you mean wyclef? If you mean that the _x and _y of the duplicated mcs is not getting randomised, i suggest u try this code instead of all those setProperty()s.
This goes in the object actions of the mc.
I’m on Flash MX. IT seems as though the initObject might be more appropriate for Flash MX? Is this true? I’ll have to give it a shot… but this still doesn’t address the main issue which is thta I want to control the positioning of the whole mass of the randomized MCs. Right no the _x and _y value sets the surface area from starting from _x:0 and _y:0. But what if I want to start it from _y:300?
Thanks kartik, that solved my problem. But now i’m curious about this initObject thing. I tried copying and pasting kaxs two lines but it didn’t work. What am I doing wrong and why is this a better method than set property?
the initObject is faster than assigning each property individually.
and the code works, but you still need to put the script within a loop. example:
var i, total = 100;
for (i=0; i<total; i++) {
var obj = {_x:random(710), _y:random(143), _alpha:random(100), _xscale:random(100), _yscale:random(100)};
flower.duplicateMovieClip("mc"+i, i, obj);
}
This script duplicates the MC and then randomizes them all in unison where the set property version does it randomly…you should test both versions and see,it’s cool… but how can I get the initObject version to react more like the original set property one…??? Thanks for your help
Did you try both codes? They don’t work the same. The original duplicates the MC randomly at different times where the initObject one duplicates the MC in unison.