SWFLoader Unload Problem


hi,

 

after doing searching on web still couldn't slove memory usage problem.

i have tried using unloadandstop function , tried using setting source empty, none of these worked me.

even used hack way force gc work, memory still occupied old swf.

the situation each time new swf file loaded, memory usage more , more larger.

the unload action seems never worked.

i hope 1 me problem.

the following source code.

thanks.

 

ps:1. flash player version: 10

      2. use flex builder build file.

 

 

source code:

 

   <mx:script>
        <![cdata[
            [bindable]
            public var selecteditem:object;    
            private function unloadswf(evt:mouseevent):void{
                displayitem.source = "";
            }          
            private function nullswf(evt:mouseevent):void{
                displayitem.unloadandstop();
            }           
            private function setswf(evt:event):void{               
                selecteditem=(evt.target).selecteditem;
                displayitem.load(selecteditem.module);               
            }           
        ]]>
    </mx:script>
    <mx:combobox
        width="215"
        labelfield="label"
        close="setswf(event)">
        <mx:dataprovider>
            <mx:object label="select coverage"/>       
            <mx:object
                label="life insurance"
                module="jscaller.swf"
            />
            <mx:object
                label="auto insurance"
                module="jscaller2.swf"
            />         
        </mx:dataprovider>
    </mx:combobox>

 

    <mx:panel width="100%" height="100%">
        <mx:swfloader id="displayitem" width="100%" height="100%"/>
    </mx:panel>
    <mx:hbox>
        <mx:button label="unload" click="unloadswf(event)"/>
        <mx:button label="nullify" click="nullswf(event)"/>
    </mx:hbox>

1. version of flex using?

2. have checked leaks caused styles or resource bundles?

3. please paste smallest possible code jscaller.swf not unload.

 

 

-darrell



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO