i´m doing a loop to attribute the values to _x property, and use it to make random movimets with movieclips
i´ve got 16 movieclips in my stage, named
b1, b2, b3…b16
and the code is
count = 0
chama = setInterval(function () {
count++
for (a=1; a<=16; a++) {
eval("b"+a).xp = random(68)+11
eval("b"+a).yp = random(68)+11
eval("b"+a).onEnterFrame = function() {
this._x = this._x + (this.xp-this._x)/10
this._y += (this.yp-this._y)/10
if (_root.count == 3) {
clearInterval(chama)
setInterval(cPos, 1000)
}
};
}
},2000)
so… after 3 time that setinterval execute this function, i´d like to call a function to get this movieclips, in their current positions and take them in especifics positions on stage
so I created an Array and I´m trying to use this code to define variables with values from the Array, and make a moviment to the especifics positions
xC = [63.9, 16.95, 45.85, 65.55, 18.75, 26.2, 55.85, 55.25, 28.85, 21.95, 36.6, 35.75, 14.7, 45.7, 14.45, 60.75]
function cPos () {
for (a=1; a<=16; a++) {
eval("b"+a).onEnterFrame = function() {
this._x = this._x + (_root.xC[a+1]-this._x)/10
}
}
}
but it´s not working
why???
what can I do to Take the variables inside the array and use them to respectives movieclips b1, b2…b16???
thanks
Chan