Hello, I have a menu made only with the use of dynamicTextfield and XML. How can I place Handcursor in this textfield so it look like a typical menu button?
I tried this solution and it doen’t work properly…
function createMainText(mainText:String, mainLink:String, xPosition:Number, yPosition:Number, indexNumber:Number):void {
var dynText:TextField = new TextField();
dynText.name="mainLink"+indexNumber.toString();
dynText.selectable=false;
dynText.x=xPosition;
dynText.y=yPosition;
dynText.autoSize=TextFieldAutoSize.LEFT;
dynText.text=mainText;
dynText.setTextFormat(textFormatMain);
var MC_text:MovieClip = new MovieClip();//try to attach textfiled into a movieclip
MC_text.buttonMode = true;
MC_text.useHandCursor = true;
MC_text.addChild(dynText);
addChild(MC_text);
setChildIndex(dynText,numChildren - 1); /*this line is that doesnt fit with the use of movieclip I think*/
dynText.addEventListener(MouseEvent.MOUSE_OVER, subLinksShow);
dynText.addEventListener(MouseEvent.MOUSE_OVER, buttonModeTrue);
dynText.addEventListener(MouseEvent.MOUSE_OUT, buttonModeFalse);
getChildByName("mainLink"+indexNumber.toString()).addEventListener(MouseEvent.CLICK, CallArg.create(gotoSub, mainLink));
}
I can’ t sort it out!