Hello, can anybody tell me what is wrong with this code.
The problem is: everytime I press a movieClip, i -1(on the output window) should be equal to the number of the movieClip (ex: myClip17, when pressed, should produce in the output window a value of 17 for i-1).
Please copy paste this code to a flash document and you’ll see what I mean (please don’t forget that you have to have linkage in the library for a movieClip symbol that you have to create - it’s a circle only with stroke that has w=15 h=15).
Every time I click on a number it should
appear a circle on him. If the circle is already there it should disappear. But that’s not the case. Somehow every movieClip has the order to attach one of the instances of movieclip marca_mc to myClip31.
var mcAcoplado = [false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false];
var diasDoMes = 31+1;
var distEntreTexto = 10;
for (i=1; i<diasDoMes; i++) {
_root.createEmptyMovieClip(“myClip”+i, i);
myClip = _root[“myClip”+i];
myClip._x = distEntreTexto;
myClip._y = 50;
distEntreTexto += 20;
_root.myClip.createTextField(“texto”, i, -8, -10, 17, 20);
//texto = eval(“texto”+i);
if (i<10) {
_root.myClip.texto.text = “0”+i;
} else {
_root.myClip.texto.text = i;
}
}
for (i=1; i<diasDoMes; i++) {
myClip = _root[“myClip”+i];
_root.myClip.onPress = function() {
if (mcAcoplado[i-1] == false) {
myClip.attachMovie(“marca_lnk”, “marca_mc”+i, 0);
mcAcoplado[i-1] = true;
} else {
myClip[“marca_mc”+i].removeMovieClip();
mcAcoplado[i-1] = false;
}
trace(mcAcoplado[i-1]);
trace(i-1);
};
}