sorry, new to the AS3 thing, what am I doing wrong? the text field wont follow the movie?
package com.equ.Interface{
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.*;
public class Tabs extends MovieClip {
public function Tabs() {
var tabs=new Array ;
tabs.push("1. Body");
tabs.push("2. Face");
tabs.push("3. Hair");
tabs.forEach(drawTab);
}
private function drawTab(element:String,index:int,array:Array):void {
var tab:MovieClip=new MovieClip;
tab.graphics.beginFill(0xFCD323);
tab.graphics.drawRoundRect(index*144,0,143,40,0,0);
tab.graphics.endFill();
tab.buttonMode=true;
tab.addEventListener(MouseEvent.CLICK,onClick);
addChild(tab);
var textLabel:TextField=new TextField ;
var format:TextFormat=new TextFormat ;
format.font="Arial";
format.size=13;
textLabel.text=element;
textLabel.x=6;
textLabel.y=16;
textLabel.selectable=false;
textLabel.setTextFormat(format);
tab.addChild(textLabel);
}
private function onClick(evt:MouseEvent):void {
trace("click");
}
}
}