scusa, io ho il seguente codice per creare il mc:
codice:
function disegnaBarra(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(0, 0);
lineTo(boxWidth, 0);
lineTo(boxWidth, boxHeight);
lineTo(0, boxHeight);
lineTo(0, 0);
endFill();
}
}
this.createEmptyMovieClip("barra", 10);
_root.barra._visible = false;
//CENTRO LA BARRA IN X E Y
barra._x = (Stage.width / 2) - (_root.imageWidth / 2);
barra._y = (Stage.height / 2) - (_root.imageHeight / 2);
//DISEGNO IL RETTANGOLO GRANDE QUANTO L'IMMAGINE CHE CARICHERO'
_root.disegnaBarra(barra, _root.imageWidth, _root.imageHeight, 0x333333, 50);
tu dici che devo intervenire sulla funzione di disegno disegnaBarra, cioè così?
codice:
function disegnaBarra(target_mc:MovieClip, boxWidth:Number, boxHeight:Number, fillColor:Number, fillAlpha:Number):Void {
with (target_mc) {
beginFill(fillColor, fillAlpha);
moveTo(-_width/2 , -_height/2);
lineTo(boxWidth, 0);
lineTo(boxWidth, boxHeight);
lineTo(0, boxHeight);
lineTo(0, 0);
endFill();
}
}