views:

299

answers:

3

I found the problem about combobox dropdown list in AS2 swf file.

My scenario is: There are multiple swf file that was compile from ActionScript2.0 and use Flex to load those swf files in swfLoader component.

There are two issue that I found and can't solve it: 1. When I load multiple as2.0 swf file in one flex application the first file that was load will work perfectly but the second and so on file have problem. When I click in their combobox component the dropdown list was not show. 2. swf file that was not first load have problem with popup window also. When the popup was show they can't work properly, I can't make any operation on it such as click button, close popup etc.

I solve it by add the empty content AS2.0 swf file in flex to be first swf file that was load and it make something weird happen: When I click button on combobox the dropdown list was appear but it appear on position (x:0, y:0) of its container.

I also add the code:

this._lockroot = true;

in every ActionScript2.0 code but it not solve the problem.

I don't know the source of problem.

Please help me.

Thank.

A: 

Sorry for my mistake this is the detail that I was implemented.

In Flex I use thes line of code to load five .swf files

swfBase = new SWFLoader(); swfBase.load("assets/base.swf"); mainView.addChild(swfBase); swfTreatmentPlan1 = new SWFLoader(); swfTreatmentPlan1.load("assets/TreatmentPlan1.swf"); swfOverview = new SWFLoader(); swfOverview.load("assets/Overview.swf"); swfTreatmentPlan2 = new SWFLoader(); swfTreatmentPlan2.load("assets/TreatmentPlan2.swf"); swfCharLib = new SWFLoader(); swfCharLib.load("assets/CharacteristicLib.swf");

When I want to swapt the .swf file to show on flex screen I use this logic:

private function menuChange(event:Event):void { var selectedNode:XML = Tree(event.target).selectedItem as XML var data:String = [email protected]();

mainView.removeChild(currSWF);

currSWF = this[data] as SWFLoader;

mainView.addChild(currSWF); }

mainView is Canvas, which use for show .swf file.

I use LocalConnection to handle communication between Flex and ActionScript2.0 swf file.

For ActionScript2.0 I will use this code to create ComboBox.

this.createClassObject( ComboBox, "selArchived", this.getNextHighestDepth() ) ; selArchived.setSize(130, 22); selArchived.move(__x+7, __y+35); selArchived.addEventListener( "change", Delegate.create(this, objArchivedChange )) ;

and I assign dataprovider for combobox like this:

this.selArchived.dataProvider = arrTmp ;

that all.

And every ActionScript2.0 code I use this simple mechanism to instantiate combobox.

Thank

him_aeng
A: 

you might want to check this article http://kb2.adobe.com/cps/000/54e2eda3.html

I am experiencing similar problem. However I am still looking for an solution.

James.G
A: 

James and other, I resolved the problem by hardcode swapDepths the container movieclip. for example if your comboBox is inside mc_container, so when you create it (or if it is already on stage) do mc_container.swapDepths(1) for as2 or mc_container.setChildIndex(mc_container, 1) for AS3

madovsky