Skip to main content
Known Participant
July 13, 2007
Question

ComboBox on RollOver

  • July 13, 2007
  • 1 reply
  • 217 views
Hi,
I have a combo displaying all Fonts available on the users system.
On click, a text field shows the selected item, the Font's name and the item is displayed in the selected font. This works fine.

ComListenerB.change = function(){
var obj = myComboB.selectedItem;
showFont.text = obj.label;
myformatFont = new TextFormat();
myformatFont.color = 0x666666;
myformatFont.font = obj.label;
myformatFont.size = 10;
myformatFont.align = "center";
showFont.setTextFormat(myformatFont);
//xx
myComboB.addEventListener("change", ComListenerB);

I would like to have the same action already on RollOver, so the client can see, which Font he is going to select.

ComListenerB.itemRollOver = function(evt:Object){
//>>put the same code here as above
//but does not work??

myComboB.addEventListener("itemRollOver", ComListenerB);

Thank you for your help.
Luciewong


This topic has been closed for replies.

1 reply

Inspiring
July 13, 2007

In the itemRollOver handler, selectedItem does not make sense for what you want to do.
in the new code, change:
var obj = myComboB.selectedItem;

to:

var obj = myComboB.getItemAt(evt.index)

and see if that works.
luciewongAuthor
Known Participant
July 14, 2007
Hi GWD,

yes, this works perfectly.
Thank you for your help.

Best regards
Luciewong