Loading and Unloading of swf files in SWF Loader

Hi all,
I have a doubt reg. SWF Loader.
I have created two mxml files A & B.
A. local.mxml
B. SwfSample.mxml
i have two labels and a button in A file and i have set values to those labels and have a method to handle the click event of the button. In B file i have loaded this A file and accessed the labels and methods using SystemManager Component and changed the values of the A file's label and accessed data from A file to B file.
Here comes the problem,
I have two buttons named LoadAgain and Unload
When i click the Unload button, the SWF Loader unloads its content by the method i handled for  the Unload button, after that i have clicked on the LoadAgain button to load the same content of A's mxml to the SWF Loader, it loads succesfully,but i was not able to access its Label or Method from the B mxml. Please help me to solve the issue.
local.mxml
<?xml version="1.0" encoding="utf-8"?><mx:Application 
xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
<mx:Script>
    <![CDATA[
Bindable]
    public var varOne:String = "This is a public variable";
    public function setVarOne(newText:String):void
          varOne = newText;
    ]]>
</mx:Script>
<mx:Label id="lblOne" text="I am here" x="28" y="88"/>
<mx:Label text="{varOne}" x="166" y="88"/>
<mx:Button label="Nested Button" click="setVarOne('Nested Button Pressed');" x="28" y="114"/>
SwfSample.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application 
xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
    <mx:Script>
    <![CDATA[
          import mx.controls.Alert;  
          import mx.managers.SystemManager;  
          import mx.controls.Label; 
Bindable]
          public var loadedSM:SystemManager;
          private function initNestedAppProps():void
              loadedSM = SystemManager(myLoader.content);
          public function updateLabel():void
              lbl.text = loadedSM.application[
"lblOne"].text;
          public function updateNestedLabels():void
              loadedSM.application[
"lblOne"].text = "I was just updated" ;
              loadedSM.application[
"varOne"] = "I was just updated";
          public function updateNestedVarOne():void
               local(loadedSM.application).setVarOne(
"Updated varOne");
          public function unload():void
               myLoader.content.loaderInfo.loader.unload();
          public function loadAgain():void
               myLoader.load(
"../bin-debug/local.swf");
        ]]>
     </mx:Script>
<mx:Label id="lbl" x="72" y="47"/>
<mx:SWFLoader id="myLoader" width="438" source="../bin-debug/local.swf" creationComplete="initNestedAppProps();" y="73" height="238" x="72" alpha="1.0"/>
<mx:Button label="Update Label Control in Outer Application" click="updateLabel();" x="72" y="319"/>
<mx:Button label="Update Nested Controls" click="updateNestedLabels();" x="72" y="349"/>
<mx:Button label="Update Nested varOne" click="updateNestedVarOne();" x="72" y="379"/>
<mx:Button label="Unload" click="unload();" x="72" y="409"/>
<mx:Button label="Load Again" click="loadAgain();" x="72" y="439"/>
</mx:Application>
Thanks & regards,
Sathish.K

creationComplete only fires once when the SWFLoader is created.  Therefore you never reset your variables to point to the new sub-app.  On a slow network, creationComplete may fire before the sub-app loads.  It is best to use the COMPLETE event.
Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

Similar Messages

  • How to load and unload more than one external swf files in different frames?

    I do not have much experience on Adobe Flash or Action Script 3, but I know the basics.
    I am Arabic language teacher, and I design an application to teach Arabic, I just would like to learn how to load and unload more than one external swf files in different frames.
    Thanks

    Look into using the Loader class to load the swf files.  If you want to have it happen in different frames then you can put the code into the different frames.

  • Profiling the loading and unloading of modules

    Modules appear to be the ideal solution for building complex rich internet applications but first hand experience has also shown me that they can leak memory like nothing else. I've read anything and everything I could find about modules and module loading/unloading including of Alex Harui's blog post "What We Know About Unloading Modules" that reveals a number of potential leak causes that should be considered.
    I've now created a simple soak test that repeatedly loads and unloads a specified module to help identify memory leaks using the profiler. However, even with the most basic of modules, I find that memory usage will steadily grow. What I'd like to know is what memory stuff is unavoidable flex overhead associated with the loading of modules and what memory stuff am I guilty for, for not cleaning up object references? I'd like to be able to establish some baseline values to which I will be able to compare future modules against.
    I've been following the approach suggested in the Adobe Flash Builder 4 Reference page "Identifying problem areas"
    "One approach to identifying a memory leak is to first find a discrete set of steps that you can do over and over again with your application, where memory usage continues to grow. It is important to do that set of steps at least once in your application before taking the initial memory snapshot so that any cached objects or other instances are included in that snapshot."
    Obviously my set of discrete steps is the loading and unloading of a module. I load and unload the module once before taking a memory snapshot. Then I run my test that loads and unloads the module a large number of times and then take another snapshot.
    After running my test on a very basic module for 200 cycles I make the following observations in the profiler:
    Live Objects:
    Class
    Package (Filtered)
    Cumulative Instances
    Instances
    Cumulative Memory
    Memory
    _basicModule_mx_core_FlexModuleFactory
    201 (1.77%)
    201 (85.17%)
    111756 (24.35%)
    111756 (95.35%)
    What ever that _basicModule_mx_core_FlexModuleFactory class is, it's 201 instances end up accounting for over 95% of the memory in "Live Objects".
    Loitering Objects:
    Class
    Package
    Instances
    Memory
    Class
    600 (9.08%)
    2743074 (85.23%)
    _basicModule_mx_core_FlexModuleFactory
    200 (3.03%)
    111200 (3.45%)
    However this data suggests that the _basicModule_mx_core_FlexModuleFactory class is the least of my worries, only accounting for 3.45% of the total memory in "Loitering Objects". Compare that to the Class class with it's 600 instances consuming over 85% of the memory. Exploring the Class class deeper appears to show them all to be the [newclass] internal player actions.
    Allocation Trace:
    Method
    Package (Filtered)
    Cumulative Instances
    Self Instances
    Cumulative Memory
    Self Memory
    [newclass]
    1200 (1.39%)
    1200 (14.82%)
    2762274 (13.64%)
    2762274 (62.76%)
    This appears to confirm the observations from the "Loitering Objects" table, but do I have any influence over the internal player actions?
    So this brings me back to my original question:
    What memory stuff is unavoidable flex overhead associated with the loading of modules and what memory stuff am I guilty for, for not cleaning up object references? If these are the results for such a basic module, what can I really expect for a much more complex module? How can I make better sense of the profile data?
    This is my basic module soak tester (sorry about the code dump but there's not that much code really):
    basicModule.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/halo"
               layout="absolute" width="400" height="300"
               backgroundColor="#0096FF" backgroundAlpha="0.2">
         <s:Label x="165" y="135" text="basicModule" fontSize="20" fontWeight="bold"/>
    </mx:Module>
    moduleSoakTester.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/halo"
                   width="400" height="300" backgroundColor="#D4D4D4"
                   initialize="application_initializeHandler(event)">
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   import mx.events.ModuleEvent;
                   [Bindable]
                   public var loadCount:int = -1;
                   [Bindable]
                   public var unloadCount:int = -1;
                   public var maxCycles:int = 200;
                   public var loadTimer:Timer = new Timer(500, 1);
                   public var unloadTimer:Timer = new Timer(500, 1);
                   protected function application_initializeHandler(event:FlexEvent):void
                        loadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, loadTimer_timerCompleteHandler);
                        unloadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, unloadTimer_timerCompleteHandler);
                   protected function loadModule():void
                        if(loadCount < maxCycles)
                             moduleLoader.url = [correctPath] + "/basicModule.swf";
                             moduleLoader.loadModule();
                             loadCount++;
                   protected function unloadModule():void
                        moduleLoader.unloadModule();
                        unloadCount++;
                   protected function load_clickHandler(event:MouseEvent):void
                        load.enabled = false;
                        loadModule();
                        unload.enabled = true;
                   protected function unload_clickHandler(event:MouseEvent):void
                        unload.enabled = false;
                        unloadModule();
                        run.enabled = true;
                   protected function run_clickHandler(event:MouseEvent):void
                        run.enabled = false;
                        moduleLoader.addEventListener(ModuleEvent.READY, moduleLoader_readyHandler);
                        moduleLoader.addEventListener(ModuleEvent.UNLOAD, moduleLoader_unloadHandler);
                        loadTimer.start();
                   protected function moduleLoader_readyHandler(event:ModuleEvent):void
                        unloadTimer.start();
                   protected function moduleLoader_unloadHandler(event:ModuleEvent):void
                        loadTimer.start();
                   protected function loadTimer_timerCompleteHandler(event:TimerEvent):void
                        loadModule();
                   protected function unloadTimer_timerCompleteHandler(event:TimerEvent):void
                        unloadModule();
              ]]>
         </fx:Script>
         <mx:ModuleLoader id="moduleLoader"/>
         <s:VGroup x="20" y="20">
              <s:HGroup>
                   <s:Button id="load" label="Load" click="load_clickHandler(event)" enabled="true"/>
                   <s:Button id="unload" label="Unload" click="unload_clickHandler(event)" enabled="false"/>
                   <s:Button id="run" label="Run" click="run_clickHandler(event)" enabled="false"/>
              </s:HGroup>
              <s:Label text="loaded: {loadCount.toString()}" fontSize="15"/>
              <s:Label text="unloaded: {unloadCount.toString()}" fontSize="15" x="484" y="472"/>
         </s:VGroup>
    </s:Application>
    Cheers,
    -Damon

    Easiest way I've found to get your SDK version from within Builder is to add this: <mx:Label text="{mx_internal::VERSION}" />
    http://blog.flexexamples.com/2008/10/29/determining-your-flex-sdk-version-number/
    Peter

  • Help with load and unload swf file.

    hello, just now i try, to  load my file using the code snippet 'load and unload' i manage to load the next file succesfully but why my recent file still appear in the background? how do i make it gone?

    When you load another SWF you're loading it 'inside' the current SWF but it appears that you want to replace the current SWF entirely with the new SWF, is that correct?
    If so you should make what's usually known as a 'stub' or a loader. Make an empty project that merely acts as a loader. It should load your first SWF and when you press a button on that first SWF to load a second SWF, it should signal the 'stub' it's loaded inside to unload the first SWF and then load the second.
    e.g. a stub.swf (just coding out of memory, not error checked, just to give a general idea):
    // make a new loader to do all the loading of SWFs
    var loader:Loader = new Loader();
    // and display
    addChild(loader);
    // a function to load a SWF into the loader (replacing any existing SWF)
    function loadSWF(path:String):void
         // assure path is defined or do nothing
         if (!path) return;
         // load requested SWF
         loader.load(new URLRequest(path));    
    // load initial SWF
    loadSWF('/path/to/1.swf');
    For your 1.swf to use the function, you're currently inside the .content property of a Loader so I believe you can just run a command like: Object(this.parent.parent).loadSWF('/path/to/2.swf');
    This example obviously lacks any error checking or transitions but you can add those and season to taste.

  • Facing problem while unloading the SWF file in SWF Loader

    Facing problem with SWF Loader.
    Background:
    I've 4 SWF files (demo1.swf, demo1_skin.swf, demo2.swf and demo2_skin.swf).
    These swf files are created throgh Adobe Captivate.
    Playing demo1_skin, will play the demo1.swf with the controls at the button such as "Play", "Pause", "Stop", "Forward", "Backward" and Seekbar.
    Playing demo2_skin, will play the demo2.swf with the controls at the button such as "Play", "Pause", "Stop", "Forward", "Backward" and Seekbar.
    Scenario:
    1. Clicked on the video1 leaf of the tree. Video1.swf is getting played.
    I am able to click on the seek bar to take the video pointer to the desired position. I can drag the seek bar forward and backward also.
    2. Clicked on the video2 leaf of the tree. Video2.swf is getting played.
    I am not able to click on the seek bar to take the video pointer to the desired position. Also, I am not able to drag the pointer on the seek bar either forward or backward also.
    Play, Pause, Stop, Forward, Backward buttons on the skin works properly.
    3. If I again, click on the video1 leaf, point 1 observation is found.
    4. clicking agian, on video2 leaf, point 2 observation found.
    Please suggest.
    I tried with Loader also. But, nothing fruitful. Same result, as I am getting from SWF Loader.
    Please find the below used code.
    dp.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <gallery label="All">
              <file label="video1" src="demo1_skin.swf" />
              <file label="video2" src="demo2_skin.swf" />
        </gallery>
    </root>
    Sample1.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white">
    <mx:Script>
        <![CDATA[
                  import mx.events.ListEvent;
                  private function tree_itemClick(event:ListEvent):void {
                        var t:Tree = event.currentTarget as Tree;
                        var dataObj:Object = event.itemRenderer.data;
                        swfLoader.load(null);
                        if (dataObj.hasOwnProperty("@src")) {
                            swfLoader.load(dataObj.@src);
              ]]>
    </mx:Script>
    <mx:XML id="dp" source="dp.xml" />
        <mx:HDividedBox width="100%" height="100%">
              <mx:Panel width="200" height="100%">
                  <mx:Tree id="tree" dataProvider="{dp}" labelField="@label"
                        showRoot="false" width="100%" height="100%" itemClick="tree_itemClick(event);" />
                  </mx:Panel>
                  <mx:Panel id="panel" width="100%" height="100%" backgroundColor="white">
                        <mx:SWFLoader id="swfLoader" width="100%" height="100%" />
                  </mx:Panel>
        </mx:HDividedBox>
    </mx:Application>
    log in the console
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\Sample3.swf - 951,034 bytes after decompression
    Clicked on the video1 leaf of the tree
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf - 31,309 bytes after decompression
    this.getSWFVersion() = 7
    contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf - 323,414 bytes after decompression
    incrementWait = 1
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    decrementWait = 0
    Clicked on the video2 leaf of the tree
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf - 31,311 bytes after decompression
    [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
    this.getSWFVersion() = 7
    contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf - 477,273 bytes after decompression
    incrementWait = 1
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    decrementWait = 0
    Clicked on the video1 leaf of the tree (Again)
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf - 31,309 bytes after decompression
    [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf
    this.getSWFVersion() = 7
    contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf - 323,414 bytes after decompression
    [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf
    incrementWait = 1
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    decrementWait = 0
    Clicked on the video2 leaf of the tree (Again)
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2_skin.swf - 31,311 bytes after decompression
    [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1.swf
    this.getSWFVersion() = 7
    contentSWFFullPath = file://C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf
    [SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo2.swf - 477,273 bytes after decompression
    incrementWait = 1
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    onLoad m_movie = null
    decrementWait = 0
    [Unload SWF] C:\Java_Flex_Practice\FlexPractice\Sample\bin-debug\demo1_skin.swf

    Try calling unloadAndStop() before loading a new swf.
    http://livedocs.adobe.com/flex/3/langref/mx/controls/SWFLoader.html#unloadAndStop()
    http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html#unloadAndStop()
    Note that unLoadAndStop()is FP10 only.

  • Display/load and Unload SWF in flex

    hi friends
    i wnat to disply external SWF file into flex but without using SWFLOader(it's make lot's of problem) nad i also Embed that SWF
    this is code
    [Embed(source="1.swf")]
    private var loadswf:Class;
    private function load():void{
    var symb:MovieClip = new loadswf() as MovieClip;
    this.addChild(symb);
    it's give me error....
    TypeError: Error #1034: Type Coercion failed: cannot convert demos_loadswf@39ab3c1 to mx.core.IUIComponent.
    please help to resolve this error or give me suggestion to simple Disply/Load and Unload Embed SWF file in flex

    thnx Flex harUI
    i added UI componentes now my full code is like..
            import mx.controls.Image;    
            import mx.controls.Alert;
            [Embed(source = "1.swf")]
            public var SWF:Class;
            [Embed(source = "2.swf")]
            public var SWF2:Class;
            private var mc:MovieClip;
            private var img:Image;
            protected function checkBtn_clickHandler(event:MouseEvent):void
                clear();
                img = new Image();
                img.width=Number("700");
                img.height=Number("700");
                mc = new MovieClip();
                mc = MovieClip(new SWF());
                img.source = mc;
                vBox0.addChild(img);
            protected function critcalBtn_clickHandler(event:MouseEvent):void
                clear();
                img = new Image();
                img.width=Number("700");
                img.height=Number("700");
                mc = new MovieClip();
                mc = MovieClip(new SWF2());
                img.source = mc;
                vBox0.addChild(img);
            protected function clear():void
                try{
                    if(mc!=null){
                        flash.media.SoundMixer.stopAll();
                        img.source="";
                        img.source=null;
                        mc=null;
                        vBox0.removeChild(DisplayObject(img));
                        vBox0.removeAllElements();
                        vBox0.removeAllChildren();
                }catch(e:Error){
                    Alert.show(e + " ----::---- ");
    <mx:Canvas id="vBox0" width="700" height="700" ></mx:Canvas>
    <mx:HBox >
            <mx:Button id="checkBtn" label="first" click="checkBtn_clickHandler(event)"/>
            <mx:Button id="critcalBtn" label="second" click="critcalBtn_clickHandler(event)"/>
    </mx:HBox>
    now my error gone!!! but one problem is there when i unload my first SWF and load second SWF(on button click), my first SWF sound are still play in Background, i cn't unstand Y this will happen coz i already remove all object and child from my Canvas.
    any help on this....

  • How to load and unload Multiple External SWF

    hello there,
    i need help to figuring out how to load and also unload(removing) multiple external SWF.
    so here is what i;m trying to do,
    i want to load multiple external SWF and play it on my main SWF now i hove no problem with just loading multiple SWF and placing it in the display list .The problem came up when i tried removing those loaded SWF from the display list ,The problem exist because i have no way to refer to what i have loaded and placed on the display list,
    i used a single loader instance to load all that external swf,
    i do know that we have to remove all the event listener related to the external SWF that we want to remove and for this purpose i have crated a function called destroy which the main objective for this function is to remove all event listener inside the swf and also isolating all variable so it would be eligible for garbage collecting, here is what the code look like:
    // Create this in every object you use
    public function destroy():void
         // Remove event listeners
         // Remove anything in the display list
         // Clear the references to other objects, so it gets totally isolated
    sorry it just a kind of pseudocode cause this function will customize with it's own property i did this just for the purpose of simplicity and easy understanding..,
    so now back to main problem how should i solve this problem??
    i tried used an arraf to save all the loaded swf
         the array is just used to save the what the loader is loading but the adding to display method is using
    movieClipActAsContainer.addChild(e.target.content); //the event is from the Event.COMPLETE
    but i have a hard time using that arrya back and matching it to the one i got from the display list.
    please do help me,
    any suggestion would be greatly appreciated,
    and if can pleas show me a source code or pseudocode of what you're suggesting to me cause my english is not so fluent yet,
    thanks before.

    Hey EI,
    I had done this kind of project recently and for loading and unloading different swfs. I had used loaders specific to that filename and for removing I had used a single movieclip instance name and on clicking that specific loader request name that needs to be removed will be requested from the specific function. As mentioned below
    Loading SWF:
    ===============================
    swfLoaderIndia.load(swfRequestIndia);//This will load the request
    If you are inside a movieclip while requesting use below code
    MovieClip(this.root).addChild(swfLoaderIndia);//This will load swf on stage
    or else
    Stage.addChild(swfLoaderIndia);
    Unloading SWF
    =====================================
    If you are inside a movieclip while requesting use below code
    MovieClip(this.root).removeChild(swfLoaderIndia);//This will unload swf on stage
    or else
    Stage.removeChild(swfLoaderIndia);
    Above code will be in specific function which will be requested when the loading and unloading is required.
    I hope this helps you in your project.
    With Regards,
    Sagar S. Ranpise

  • How to load and unload same SWF with different xmlFilePath?

    I have a slideshow on my homepage and try to load and unload same instance with different xmlFilePath based on language on the same page.
    var flashvars = {
            xmlFilePath: escape("http://www.bodto.com.tr/kik.aspx"),
            xmlFileType: "OPML",
            lang: swfobject.getQueryParamValue("lang")    
            //initialURL: escape(document.location)   
          var params = {
            bgcolor: "#000000",  
            allowfullscreen: "true",
            wmode:"transparent",
            allowScriptAccess: "always"
          var attributes = {}
              swfobject.embedSWF("/swf/slideshowpro.swf", "flashcontent", "550", "400", "10.0.0", false, flashvars, params, attributes);
    Actionscript3
    var langPath = root.LoaderInfo.parameters["xmlFilePath"]+root.LoaderInfo.parameters["lang"];
    my_ssp.xmlFilePath = langPath;
    var fileType = root.LoaderInfo.parameters["xmlFileType"];
    my_ssp.xmlFileType = fileType;
    Based on above informations, how could I achieve it?

    Suddenly that code in the following gives me some error
    var langPath = root.LoaderInfo.parameters["xmlFilePath"]+root.LoaderInfo.parameters["lang"];
    my_ssp.xmlFilePath = langPath;
    var fileType = root.LoaderInfo.parameters["xmlFileType"];
    my_ssp.xmlFileType = fileType;
    Access of possibly undefined property LoaderInfo through a reference with static type flash.display:DisplayObject.
    The only code snippet works is
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
    for (var param in paramObj) {
       if (param == "xmlFilePath") {
          my_ssp.xmlFilePath = paramObj[param];
       if (param == "xmlFileType") {
          my_ssp.xmlFileType = paramObj[param];

  • Ipad i have load swf file but swf  is not working proper(flex 4.6) but android is fine to work how

    ipad i have load swf file but swf  is not working proper(flex 4.6) but android is fine to work how

    On the MBP, in iTunes, switch to Song view and enable the iCloud Status column by pulling down View > View options and selecting the option for "iCloud Status." Close the small window. Look for any tracks that have a status of "waiting." If you see several of them disable iTunes Match while holding down the Option key. Quit iTunes, wait a few seconds, then open it again and turn iTM back on. Let it compelete the scan. Wait until all tracks that are "waiting" have a status of either "matched" or "uploaded."
    On the iPad, turn off iTunes Match then launch the Music app and let the contents clear out. Power cycle the iPad for good measure, then re-enable the service once all the tracks in iTunes have been processed.

  • How to cache swf files to reduce load time?

    Hi,
    We are using the XML data connection for our swf files. Some of our swf files are large and may take a minute to load. Is it possible to cache the swf files so they load in a shorter amount of time? If so, how would I go about doing this? Thanks!

    Jim,
    There is no option as such in Xcelsius.
    We used SAP BI Query as a source for our dashboard and we had similar issue, we then cached the SAP BI Query to reduce the load time....it worked really very well!!
    Try doing something similar in the source system...
    -Anil

  • How to get the content in embed swf file in Swf Loader on run time

    How to get the content in embed swf file in Swf Loader on run time
    [Bindable]
    [Embed(source="assets/index.swf")]
       private var SWFSRC:Class;
    <mx:SWFLoader id="_swfloader" source="{SWFSRC}" />

    Hi Flex harUI,
    Throw the error.
    Access of undefined property content

  • Can we load and unload the files in the run time?

    Can we load and unload the files in the run time?
    For example there are four files named "test1.h & test1.c" and another set "test2.h & test2.c" (I attached them as attachment to this post).
    test1.h contains code:
    int variable; //variable declared as integer
    test1.c contains code:
    variable = 1; //variable assigned a value
    test1.h contains code:
    char *variable; //variable declared as string
    test1.c contains code:
    variable = "EXAMPLE"; //variable assigned a string
    So here, in this case can I dynamically load / unload the first & second group of files so that the same variable name "variable" can be used both as integer and string? And if yes, how is that to be done?
    Solved!
    Go to Solution.
    Attachments:
    test.zip ‏1 KB

    What do you mean by "dynamically"?
    If you want to have a variable that either is an int or a char in the same program run, I'm afraid your only option is to define it as a variant and assign from time to time the proper data type in the variant according to some condition. Next, every time you access the variable you must firstly check which data type is stored in it, next access it in the proper way.
    If on the other hand your option or to have a run in which the variable is an int, next you stop the program and in a following run it is a char, you may have it by using some appropriade preprocessor clause:
    #ifdef  CHAR_TYPE
    #include "test1.h";        // variable defined as a char
    #else
    #include "test2.h";        // variable defined as int
    #endif
    Next, every time you want to access the variable you must proceed in the same vay:
    #ifdef  CHAR_TYPE
      variable = "string";
    #else
      variable = 1;
    #endif
    Does it worth the effort?
    Additionally, keep in mind that this "dynamical" approach can work only in the IDE, where you can properly #define your CHAR_TYPE or not depending on your wishes: when you compile the program, it will have only one #include depending on the definition of the macro.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Using SQL*Loader and UTL_FILE to load and unload large files(i.e PDF,DOCs)

    Problem : Load PDF or similiar files( stored at operating system) into an oracle table using SQl*Loader .
    and than Unload the files back from oracle tables to prevoius format.
    I 've used SQL*LOADER .... " sqlldr " command as :
    " sqlldr scott/[email protected] control=c:\sqlldr\control.ctl log=c:\any.txt "
    Control file is written as :
    LOAD DATA
    INFILE 'c:\sqlldr\r_sqlldr.txt'
    REPLACE
    INTO table r_sqlldr
    Fields terminated by ','
    id sequence (max,1) ,
    fname char(20),
    data LOBFILE(fname) terminated by EOF )
    It loads files ( Pdf, Image and more...) that are mentioned in file r_sqlldr.txt into oracle table r_sqlldr
    Text file ( used as source ) is written as :
    c:\kalam.pdf,
    c:\CTSlogo1.bmp
    c:\any1.txt
    after this load ....i used UTL_FILE to unload data and write procedure like ...
    CREATE OR REPLACE PROCEDURE R_UTL AS
    l_file UTL_FILE.FILE_TYPE;
    l_buffer RAW(32767);
    l_amount BINARY_INTEGER ;
    l_pos INTEGER := 1;
    l_blob BLOB;
    l_blob_len INTEGER;
    BEGIN
    SELECT data
    INTO l_blob
    FROM r_sqlldr
    where id= 1;
    l_blob_len := DBMS_LOB.GETLENGTH(l_blob);
    DBMS_OUTPUT.PUT_LINE('blob length : ' || l_blob_len);
    IF (l_blob_len < 32767) THEN
    l_amount :=l_blob_len;
    ELSE
    l_amount := 32767;
    END IF;
    DBMS_LOB.OPEN(l_blob, DBMS_LOB.LOB_READONLY);
    l_file := UTL_FILE.FOPEN('DBDIR1','Kalam_out.pdf','w', 32767);
    DBMS_OUTPUT.PUT_LINE('File opened');
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.READ (l_blob, l_amount, l_pos, l_buffer);
    DBMS_OUTPUT.PUT_LINE('Blob read');
    l_pos := l_pos + l_amount;
    UTL_FILE.PUT_RAW(l_file, l_buffer, TRUE);
    DBMS_OUTPUT.PUT_LINE('writing to file');
    UTL_FILE.FFLUSH(l_file);
    UTL_FILE.NEW_LINE(l_file);
    END LOOP;
    UTL_FILE.FFLUSH(l_file);
    UTL_FILE.FCLOSE(l_file);
    DBMS_OUTPUT.PUT_LINE('File closed');
    DBMS_LOB.CLOSE(l_blob);
    EXCEPTION
    WHEN OTHERS THEN
    IF UTL_FILE.IS_OPEN(l_file) THEN
    UTL_FILE.FCLOSE(l_file);
    END IF;
    DBMS_OUTPUT.PUT_LINE('Its working at last');
    END R_UTL;
    This loads data from r_sqlldr table (BOLBS) to files on operating system ,,,
    -> Same procedure with minor changes is used to unload other similar files like Images and text files.
    In above example : Loading : 3 files 1) Kalam.pdf 2) CTSlogo1.bmp 3) any1.txt are loaded into oracle table r_sqlldr 's 3 rows respectively.
    file names into fname column and corresponding data into data ( BLOB) column.
    Unload : And than these files are loaded back into their previous format to operating system using UTL_FILE feature of oracle.
    so PROBLEM IS : Actual capacity (size ) of these files is getting unloaded back but with quality decreased. And PDF file doesnt even view its data. means size is almot equal to source file but data are lost when i open it.....
    and for images .... imgaes are getting loaded an unloaded but with colors changed ....
    Also features ( like FFLUSH ) of Oracle 've been used but it never worked
    ANY SUGGESTIONS OR aLTERNATE SOLUTION TO LOAD AND UNLOAD PDFs through Oracle ARE REQUESTED.
    ------------------------------------------------------------------------------------------------------------------------

    Thanks Justin ...for a quick response ...
    well ... i am loading data into BLOB only and using SQL*Loader ...
    I've never used dbms_lob.loadFromFile to do the loads ...
    i 've opend a file on network and than used dbms_lob.read and
    UTL_FILE.PUT_RAW to read and write data into target file.
    actually ...my process is working fine with text files but not with PDF and IMAGES ...
    and your doubt of ..."Is the data the proper length after reading it in?" ..m not getting wat r you asking ...but ... i think regarding data length ..there is no problem... except ... source PDF length is 90.4 kb ..and Target is 90.8 kb..
    thats it...
    So Request u to add some more help ......or should i provide some more details ??

  • Best practices for using .load() and .unload() in regards to memory usage...

    Hi,
    I'm struggling to understand this, so I'm hoping someone can explain how to further enhance the functionality of my simple unload function, or maybe just point out some best practices in unloading external content.
    The scenario is that I'm loading and unloading external swfs into my movie(many, many times over) In order to load my external content, I am doing the following:
    Declare global loader:
    var assetLdr:Loader = new Loader();
    Load the content using this function:
    function loadAsset(evt:String):void{
    var assetName:String = evt;
    if (assetName != null){
      assetLdr = new Loader();
      var assetURL:String = assetName;
      var assetURLReq:URLRequest = new URLRequest(assetURL);
      assetLdr.load(assetURLReq);
      assetLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)
      assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);
      function loaded(event:Event):void {
       var targetLoader:Loader = Loader(event.target.loader);
       assetWindow.addChild(targetLoader);
    Unload the content using this function:
    function unloadAsset(evt:Loader) {
    trace("UNLOADED!");
    evt.unload();
    Do the unload by calling the function via:
    unloadAsset(assetLdr)
    This all seems to work pretty well, but at the same time I am suspicious that the content is not truly unloaded, and some reminents of my previously loaded content is still consuming memory. Per my load and unload function, can anyone suggest any tips, tricks or pointers on what to add to my unload function to reallocate the consumed memory better than how I'm doing it right now, or how to make this function more efficient at clearing the memory?
    Thanks,
    ~Chipleh

    Since you use a single variable for loader, from GC standpoint the only thing you can add is unloadAndStop().
    Besides that, your code has several inefficiencies.
    First, you add listeners AFTER you call load() method. Given asynchronous character of loading process, especially on the web, you should always call load() AFTER all the listeners are added, otherwise you subject yourself to unpredictable results and bud that are difficult to find.
    Second, nested function are evil. Try to NEVER use nested functions. Nested functions may be easily the cause for memory management problems.
    Third, your should strive to name variables in a manner that your code is readable. For whatever reason you name functions parameters evt although a better way to would be to name them to have something that is  descriptive of a parameter.
    And, please, when you post the code, indent it so that other people have easier time to go through it.
    With that said, your code should look something like that:
    function loadAsset(assetName:String):void{
         if (assetName) {
              assetLdr = new Loader();
              assetLdr.contentLoaderInfo.addEventListener(Event.INIT , loaded);
              assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);
              // load() method MUST BE CALLED AFTER listeners are added
              assetLdr.load(new URLRequest(assetURL));
    // function should be outside of other function.
    function loaded(e:Event):void {
         var targetLoader:Loader = Loader(event.target.loader);
         assetWindow.addChild(targetLoader);
    function unloadAsset(loader:Loader) {
         trace("UNLOADED!");
         loader.unload();
         loader.unloadAndStop();

  • Load and Unload Movies in AS3

    Please Can someone point me to some god examplkes on loading and unloading swfs in AS3. I manage to load but unloading is a headache.
    Thanks
    Att.,
    Edwin

    there's nothing to study if you're using fp 10:
    var yourloader:Loader=new Loader();
    yourloader.load(new URLRequest("whatever.swf"));
    function unloadF(){
    yourloader.unloadAndStop();

  • Loding swf files into swf files

    Hi,
    If i have a swf fil locally which loads a number of other swf
    files from a server, can i have the loaded files load other files?
    I have a tool which loads different presentations from different
    folders but the swf files in the presentations may them selves load
    other swf files. Is there a method to handle this?
    Jesper

    Having one player find with relative paths folder grouped or
    data based
    grouped is very doable in Flash.
    Look at the _url property for the player and pop off the swf
    name at the end
    and you have the path of the player. Then concatenate the
    relative paths
    from there.
    The player base url can be attained with
    urlBase = _url.substr(0,_url.lastIndexOf("/")+1)
    then you concatenate
    Ex:
    aChildFolder = urlBase + "theChildFolderName/"
    aSiblingFolder = urlBase + "../theSiblingFolderName/"
    Then concatenate the swf name to those.
    Lon Hosford
    www.lonhosford.com
    May many happy bits flow your way!
    "JesperBisgaard" <[email protected]> wrote
    in message
    news:e2a8bj$22m$[email protected]..
    thanks for your reply,
    To describe the problem in greater detail:
    I work for a company which produces presentations in flash.
    Each
    presentation
    has a folder of its own on our server and these folders are
    organised under
    the
    companies who ordered them. The presentations are composed of
    a number of
    swf
    files which are loaded into a main presentation control file.
    Now i am
    looking
    to build a tool which can load each of these presentations
    depending on what
    the customer would like to see. I would like this tool to be
    plased in a
    folder
    of its own so i dont have to place one in each presentation
    folder.
    But my problem is that when i try this i find that most
    often flash cant
    handle the relative paths in the movies loaded by the
    presentation control
    file. Example: If i in the presentation load a file with a
    graf and the graf
    contains a button with an onRelease = function() {
    instance.gotoAndPlay(2) }
    flash has a very hard time determining which movieclip to run
    the command
    on.
    Is there a way to handle this?

Maybe you are looking for

  • Excel o/p in Reports 9i-additional report header for every row

    Dear All, Is there any way to generate an Excel file output from OracleReports9i.Actually I have tried the simple report. I am able to create a delimited output.But the prob is it contains an additional report header for every row of the report and t

  • Need help uninstalling Mountain Lion and going back to Lion.

    I have just installed Mountain Lion. I am having serious compatibility issues with Matlab, though, and I want to reinstall Lion so that I can work in Matlab. I do not have a recent enough time machine backup of Lion, and I bought Lion from the app st

  • Contents of lvm file

    Hello, My apologies ... I fear this is a very newbie question and I'm just missing something basic. I have created some .lvm files without headers.  The contents are similar to the following: 0.000000    -107.735124     1201.923077 29750000.000000 1.

  • Call .js file through VB[Error]

    Hello, Using Visual Basic, i called the .js file. Its works most of the time. Some times, its throws an runtime error. Could you please advice me, how to solve this. Regards, Maria

  • Cloning ebs R12 on guest os OUL5x64 bit on oracle VM

    Hi All, Please share information if anyone has successfully cloned ebs r12 on a guest OS OU5x64 bit HVM on oracle VM 2.1.2 64bit. Thanks in advance!