Skip to main content
September 19, 2011
Answered

ComboBox.name property

  • September 19, 2011
  • 1 reply
  • 654 views

I want a combo box to display a description of the information in the combo box. The name property is a good way to do this in my opinion "comboBox.name = This is what I named this Box". I have a text field ("textDescription") set to display the name of the comboBox on MOUSE_OVER, but only on the edges does the actual name of the comboBox appear. When in the middle, the textDescription displays "instance #" where # is an actual number. See pics please.... Is there some kind of container placed over the combo box or something??

This topic has been closed for replies.
Correct answer Ned Murphy

Try changing the one line from...

textDescription.text = e.target.name;

to

textDescription.text = e.currentTarget.name;

1 reply

Ned Murphy
Legend
September 19, 2011

What code are you using for the textfield?

September 19, 2011

///////////////////////////////CODE////////////////////////////////

function DisplayDescription(e:MouseEvent):void{

     var myFormat:TextFormat = new TextFormat();

          myFormat.font = "arial";

 

          textDescription.defaultTextFormat = myFormat;

          textDescription.x = mouseX;

          textDescription.y = mouseY;

          textDescription.height = 20

          textDescription.autoSize = "left"

          textDescription.text = e.target.name;

          textDescription.background = true

          textDescription.alpha = 0;

 

          var tween:Tween = new Tween(textDescription, "alpha",None.easeNone,0,1,1,true)

     this.setChildIndex(textDescription, this.numChildren - 1)

          textDescription.border = true;

}

////////////////////////END CODE/////////////////////////////////

Ned Murphy
Ned MurphyCorrect answer
Legend
September 19, 2011

Try changing the one line from...

textDescription.text = e.target.name;

to

textDescription.text = e.currentTarget.name;