Hi guys, i have the following issue:
I’m creating a button via AS but after the creation of the Mc i can’t duplicate it.
here is the code:
var mc_clip:MovieClip = this.createEmptyMovieClip("mc_clip", this.getNextHighestDepth);
//
mc_clip.lineStyle(0, 0x999999, 75);
//
_root.textoCuliao.embedFonts = true;
//
var aColors:Array = [0xFFFFFF, 0xF9F9F93];
var aAlphas:Array = [100, 100];
var aRatios:Array = [0, 255];
var aMatrix:Object = {matrixType:"box", x:0, y:0, w:100, h:250, r:Math.PI/2};
mc_clip.beginGradientFill("linear", aColors, aAlphas, aRatios, aMatrix);
//
//
drawRectangleButton(mc_clip, 100, 16, 'texto inicial');
//
//
mc_clip.endFill();
//
//
//
//
function drawRectangleButton(mcClip:MovieClip, nWidth:Number, nHeight:Number, textoCont:String):Void {
mcClip.lineTo(nWidth, 0);
mcClip.lineTo(nWidth, nHeight);
mcClip.lineTo(0, nHeight);
mcClip.lineTo(0, 0);
//
mcClip.createTextField("textoIn", this._parent.getNextHighestDepth, 5, 0, 16, 250);
mcClip.textoIn.text = textoCont;
mcClip.textoIn.autoSize = true;
mcClip.textoIn.embedFonts = true;
//
//
myformat = new TextFormat();
myformat.color = 0x333333;
myformat.font = "standard 07_51";
myformat.size = 8;
myformat.align = "_right";
//
mcClip.textoIn.setTextFormat(myformat);
//
//
anchotexto = Math.round((mcClip.textoIn._width)/2);
anchoMC = Math.round((mcClip._width)/2);
//
mcClip.textoIn._x = anchoMC-anchotexto;
}
mc_clip.onRollOver = function() {
this.textoIn.textColor = "0x666666";
};
mc_clip.onRollOut = function() {
this.textoIn.textColor = "0x333333";
};
//IF I REMOVE THIS LOOP IT WORKS, AND IF I PUT IT BACK ON NOTHING HAPPENS
for (i=0; i<5; i++) {
_root.mc_clip.duplicateMovieClip(i, i);
}
//
Also, i attached the *.fla.
theguaz