views:

377

answers:

1

I have a Flash CS4 movie that uses a standard Flash combobox. This works fine, as long as I don't use the resulting SWF embedded on a HTML page. When I do embed it, the combobox doesn't show up, doesn't dispatch mouse events, it's just as if it doesn't exist. However, if I switch to fullscreen, the combobox appears and functions normally, even if I switch back from fullscreen.

I think this is a bug in the component, Flash CS4 or the Flash player itself, since it also happens on an empty movie with just the combobox there. All I've found when I googled is someone with the same problem, but no solution.

Can anyone suggest a fix or workaround?

+4  A: 

I have found that setting the wmode attribute in the <embed> tag to window (it was set to transparent before) solves the problem. Why this causes problems with the combobox (and just the combobox, afaict), I have no idea, but I'm glad I solved this problem.

EDIT: I've found a workaround in code, so I'm still able to use the transparent wmode. Apparently, the problem is that Flash player doesn't dispatch Event.RENDER events when it's in wmode transparent. The trick is to dispatch that event manually, on key moments. This is my solution:

private function renderStage(e:Event=null){
 stage.dispatchEvent(new Event(Event.RENDER));
}

myComboBox.addEventListener(ListEvent.ITEM_CLICK, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_DOUBLE_CLICK, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_ROLL_OUT, renderStage);
myComboBox.addEventListener(ListEvent.ITEM_ROLL_OVER, renderStage);
myComboBox.addEventListener(Event.CHANGE, renderStage);

This appears to work.

Sietse