Ahoi, ahoi!
Ok, here’s my issue. I have a Sprite that contains 3 dynamic textfields that act as my navigation. I populate the individual textfields from an xml document. My problem is that I want the text to be clickable by showing the hand cursor.
I can get the hand cursor to show, but I can’t get the listener to fire with the MOUSE_DOWN. If I change the event listener to be that of the Sprite object, it works, but not the way I want it.
Here’s my code
var container:Sprite = new Sprite();
container.x = container.y = 100;
container.buttonMode = true;
container.useHandCursor = true;
container.mouseChildren = false;
var mytext:TextField = new TextField();
mytext.text = "HELLO WORLD!";
mytext.name = "textBox1";
mytext.mouseEnabled = true;
mytext.selectable = false;
mytext.addEventListener(MouseEvent.MOUSE_DOWN, geturl, false, 0, false)
container.addChild(mytext);
addChild(container);
function geturl(evt:Event):void {
trace(evt.target);
}
How do I make the textfields clickable? What am I missing?
Me baffled. :puzzle: