I think I am missing something really simple.I have been spinning my wheels this afternoon trying to figure out why my embedded text disappears when I set my combobox.enabled = false;

If I use default text and disable the combobox, the text appears with some alpha effect. If I embed text and disable the combobox , the text disappears.



_Scenario using default text:_
To test, I just place a combobox in a flash page. I add a couple of items to the combobox and name the combobox test_cb.

test_cb.addEventListener(Event.CHANGE, changeHandler);

function changeHandler(event:Event):void {
      test_cb.enabled = false;
}

Everything works hunky dory. The combobox is disabled AND the selected text item is still visible.

_Scenario using embedded text:_

In my library I create a new font (in my case i used arial bold 12) and named it ComboFont. Linkage settings to be exported for actionscript and in frame 1.

In my actions layer:
// Create a new instance of the Font1 symbol from the document's library.
var myFont:Font = new ComboFont();

var myFormat:TextFormat = new TextFormat();
myFormat.font = myFont.fontName;
test_cb.setStyle("embedFonts", true);
test_cb.setStyle("textFormat", myFormat);
// Set dropdown style for comboBox
test_cb.textField.setStyle("embedFonts", true);
test_cb.textField.setStyle("textFormat", myFormat);
test_cb.dropdown.setRendererStyle("embedFonts", true);
test_cb.dropdown.setRendererStyle("textFormat", myFormat);

test_cb.addEventListener(Event.CHANGE, changeHandler);

function changeHandler(event:Event):void {
test_cb.enabled = false;
}

The font looks like it has been embedded, it is much darker.
When the combobox is disabled after an item has been selected, the text is NOT visible.

I would appreciate any help!

Thanks
Margo

--
Margo Powell
Applications Analyst
MS Computer Science
Department of Nutrition
University of North Carolina at Chapel Hill
800 Eastowne Dr, Suite 100
Chapel Hill, NC 27514
919-408-3320 ext 30
[email protected]

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to