Unable to unload external swf which is using runtime sharing

Unable to unload external swf which is using runtime sharing of some symbols and classes.
Due to this problem i am unable to load another swf or the same for the second time and getting errors at runtime.
It works fine when the swf is opened in IE.
Can anyone please help me in solving the issue.

thank you
i have tried to use   this.parent.Click_To_Close  but it gives compilation error
i checked the tutorial about custom events i think its little complex for me now to understand the typeriter app.
also i cheked the similer thread and tried to test that code myself..i found that the last block of main movie does not works and does not unload the loader2. however  all the trace are showing in the output windows that i added to check the code but last trace from the main movie is not showig...   
trace("child removed from Main Movie") 
so if this can work somehow i will use this method of event dispatch in my application that i am working...
Thank you
-----main movie ---------
var loader1:Loader = new Loader();
var loader2:Loader = new Loader();
loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, assignMovie1Listener);
loader1.load(new URLRequest("movie_1.swf"));
loader2.load(new URLRequest("movie_2.swf"));
addChild(loader1);
addChild(loader2);
function assignMovie1Listener(evt:Event):void {
      MovieClip(evt.currentTarget.content).addEventListener("eventTriggered", removeLoader2);
            trace("listner is listning..")
function removeLoader2(evt:Event):void {
      loader2.unloadAndStop();
      removeChild(loader2);
         loader2 = null;
            trace("child removed from Main Movie")
//------------- movie_1.swf code:
removeMovie2_btn.addEventListener(MouseEvent.CLICK , removeMovie2);
function removeMovie2(event:MouseEvent):void
      dispatchEvent(new Event("eventTriggered"));
            trace("event triggered form Child Movie-1");
as u can see when i click close button its triggering the trace from movie-1 but its not unloadign the movie2

Similar Messages

  • Unable to load external swf which has runtime sharing with another swf.

    Hi,
    I am getting issues on loading external swf say "importer.swf" file into another swf file say "loader.swf" for second time like
    ReferenceError: Error #1065: Variable testSymbol is not defined. VerifyError: Error #1014: Class testClass could not be found.
    at global$init()
    In the external swf "importer.swf", i am trying to import the symbol "testSymbol" from another swf file say "exporter.swf", which exports through runtime sharing option for the symbols.
    I am having some buttons in loader.swf file and on each button click i am loading different swf files into the loader.swf after unloading the previous one.
    I am able to load and unload different swf files but unable to load the importer.swf file which is sharing symbols from external swf and that too for the second time i.e., when i click the button twice.
    When trying to debug with flash debugger, all the other swf files are being unloaded before loading of another swf but the swf which is sharing symbols/classes with another swf is not getting unloaded.
    Output when i am trying to load two files example and importer files into loader.swf file on two different button clicks. On first button click example.swf is loaded. On second button click , example.swf is unloaded and importer.swf is loaded which is successful. On first button click again importer.swf is unloaded and example.swf is loaded. On second button click again, example.swf is unloaded and importer.swf is loaded, here i am getting issues shown above.
    Attemping to launch and connect to Player using URL D:\runtime issue\loader.swf
    [SWF] D:\runtime issue\ loader.swf - 8181 bytes after decompression
    [SWF] D:\runtime issue\example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    [SWF] D:\runtime issue\importer.swf - 441708 bytes after decompression
    [SWF] D:\runtime issue\ example.swf - 441708 bytes after decompression
    [UnloadSWF] D:\runtime issue\ example.swf
    [SWF] D:\runtime issue\importer.swf - 1920 bytes after decompression
    ReferenceError: Error #1065: Variable xxxxxx is not defined.
    Debug session terminated.
    Code i am using
    b1.addEventListener(MouseEvent.CLICK, b1Clicked);
    b2.addEventListener(MouseEvent.CLICK, b2Clicked);
    var ldr:Loader;
    function b2Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("importer.swf"));
        addChild(ldr);
    function b1Clicked(e:MouseEvent)
        if(ldr != null)
            ldr.unloadAndStop(true);
        ldr = new Loader();
        ldr.load(new URLRequest("example.swf"));
        addChild(ldr);
    If i try to open the swf using IE, i am not getting any issues at all. But i need to open this loader.swf in a air application. Also when i use loaderContext for the loader instance i am able to get rid of this issue but i cant use it in my application.
    So, please help me in resolving this issue.
    Thanks

    I got my answer. I had to append the photo url to the 'movie' value of the javascript embed method. Like this:
    <script language="JavaScript" type="text/javascript">
       AC_FL_RunContent(
          'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
          'width', '550',
          'height', '400',
          'src', 'lesson2',
          'quality', 'high',
          'pluginspage', 'http://www.adobe.com/go/getflashplayer',
          'align', 'middle',
          'play', 'true',
          'loop', 'true',
          'scale', 'showall',
          'wmode', 'window',
          'devicefont', 'false',
          'id', 'lesson2',
          'bgcolor', '#ffffff',
          'name', 'lesson2',
          'menu', 'true',
          'allowFullScreen', 'false',
          'allowScriptAccess','always',
          'movie', 'lesson2?photo=http://www.flash-mx.com/images/image1.jpg',
          'salign', ''
          ); //end AC code
    </script>
    Thanks,
    srb.

  • AS3 Unloading external SWF piling up problem

    I have two buttons on main SWF what loads and Unload two external SWFs back and forth.
    Also one timer function is calling external Screen saver SWF and unload the existing one when no interaction found.
    I am using unloadAndStop() function to unload the external SWFs.
    But after loading and unloading external SWFs, I am facing piling up or stack overflow problem.
    Any help will be highly appreciated.
    Thanks
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.media.Video;
    import flash.display.MovieClip;
    import caurina.transitions.*;
    import flash.utils.Timer;
    import flash.events.*;
    var myLoader_Map_1:Loader = new Loader();
    var myLoader_Map_2:Loader = new Loader();
    var myLoader_Screen_Saver:Loader = new Loader();
    var Ss:Boolean = false;
    var Maps:Boolean = true;
    //--------------------Screen Saver---------------------------------
    ScreenSaver();
      function ScreenSaver():void{
      var url:URLRequest = new URLRequest("screensaver.swf");
      myLoader_Screen_Saver.load(url); 
      addChild(myLoader_Screen_Saver);
      setChildIndex(myLoader_Screen_Saver, 1);
      Maps = false;
      Ss = true;
      function ScreenSaver_Unload():void{
      myLoader_Screen_Saver.unloadAndStop();
    //--------------------Map Buttons---------------------------------
    function MPstart():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:1, x:778.25, y:1070.65, time:1, delay:1, transition:"easeOutCubic"});
      setChildIndex(MC_Maps_Btns, 2);
      MC_Maps_Btns.Btn_Map_1.visible = true;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    function MPclose():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:0, x:778.25, y:1179.85, time:1, transition:"easeOutCubic"});
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_1.addEventListener(MouseEvent.CLICK,OpenMap1);
      function OpenMap1(e:MouseEvent):void{
      var url:URLRequest = new URLRequest("Map_1.swf");
      myLoader_Map_1.load(url);
      myLoader_Map_1.alpha = 1;
      addChild(myLoader_Map_1);
      setChildIndex(myLoader_Map_1, 2);
      myLoader_Map_2.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_1.visible = false;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_2.addEventListener(MouseEvent.CLICK,OpenMap2);
      function OpenMap2(e:MouseEvent):void {
      var url:URLRequest = new URLRequest("Map_2.swf");
      myLoader_Map_2.load(url);
      myLoader_Map_2.alpha = 1;
      addChild(myLoader_Map_2);
      setChildIndex(myLoader_Map_2, 2);
      myLoader_Map_1.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_2.visible = false;
      MC_Maps_Btns.Btn_Map_1.visible = true;
    //--------------------Timer ---------------------------------
    var inactiveTime:int = 10000;
    var t:Timer = new Timer(inactiveTime);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown1);
    t.addEventListener(TimerEvent.TIMER, onTimer);
    t.start();
      function onMouseDown1(e:MouseEvent):void {
      t.reset();
      t.start();
      trace("Interaction detected");
      function onTimer(e:TimerEvent):void {
      handleInactivity();
      function handleInactivity():void {
      trace('You\'re inactive.');
      if (Maps == true){
      myLoader_Map_1.unloadAndStop();
      myLoader_Map_2.unloadAndStop();
      else{
      trace("No Maps");
      if (Ss == false ){
      ScreenSaver();
      MPclose();
      else{
      trace("ScreenSaver already loaded");

    This is how I applied
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.media.Video;
    import flash.display.MovieClip;
    import caurina.transitions.*;
    import flash.utils.Timer;
    import flash.events.*;
    var myLoader_Map_1:Loader = new Loader();
    var myLoader_Map_2:Loader = new Loader();
    var myLoader_Screen_Saver:Loader = new Loader();
    var Ss:Boolean = false;
    var Maps:Boolean = true;
    //--------------------Screen Saver---------------------------------
    function unloadAllF():void{
    if(myLoader_Screen_Saver.content){
    myLoader_Screen_Saver.unloadAndStop();
    trace("ss unloaded");
    if(myLoader_Map_1.content){
    myLoader_Map_1.unloadAndStop();
    trace("map_1 unloaded");
    if(myLoader_Map_2.content){
    myLoader_Map_2.unloadAndStop();
    trace("map_2 unloaded");
    //etc
    ScreenSaver();
      function ScreenSaver():void{
      var url_ss:URLRequest = new URLRequest("screensaver.swf");
      unloadAllF();
      myLoader_Screen_Saver.load(url_ss); 
      addChild(myLoader_Screen_Saver);
      setChildIndex(myLoader_Screen_Saver, 1);
      Maps = false;
      Ss = true;
        function ScreenSaver_Unload():void{
      myLoader_Screen_Saver.unloadAndStop();
    //--------------------Map Buttons---------------------------------
    function MPstart():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:1, x:778.25, y:1070.65, time:1, delay:1, transition:"easeOutCubic"});
      setChildIndex(MC_Maps_Btns, 2);
      MC_Maps_Btns.Btn_Map_1.visible = true;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    function MPclose():void{
      Tweener.addTween(MC_Maps_Btns,{alpha:0, x:778.25, y:1179.85, time:1, transition:"easeOutCubic"});
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_1.addEventListener(MouseEvent.CLICK,OpenMap1);
      function OpenMap1(e:MouseEvent):void{
      var url_map_1:URLRequest = new URLRequest("Map_1.swf");
      unloadAllF();
      myLoader_Map_1.load(url_map_1);
      myLoader_Map_1.alpha = 1;
      addChild(myLoader_Map_1);
      setChildIndex(myLoader_Map_1, 2);
      myLoader_Map_2.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_1.visible = false;
      MC_Maps_Btns.Btn_Map_2.visible = true;
    //--------------------Map 1 ---------------------------------
    MC_Maps_Btns.Btn_Map_2.addEventListener(MouseEvent.CLICK,OpenMap2);
      function OpenMap2(e:MouseEvent):void {
      var url_map_2:URLRequest = new URLRequest("Map_2.swf");
      unloadAllF();
      myLoader_Map_2.load(url_map_2);
      myLoader_Map_2.alpha = 1;
      addChild(myLoader_Map_2);
      setChildIndex(myLoader_Map_2, 2);
      myLoader_Map_1.unloadAndStop();
      ScreenSaver_Unload();
      Maps = true;
      Ss = false;
      MC_Maps_Btns.Btn_Map_2.visible = false;
      MC_Maps_Btns.Btn_Map_1.visible = true;
    //--------------------Timer ---------------------------------
    var inactiveTime:int = 10000;
    var t:Timer = new Timer(inactiveTime);
    stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown1);
    t.addEventListener(TimerEvent.TIMER, onTimer);
    t.start();
      function onMouseDown1(e:MouseEvent):void {
      t.reset();
      t.start();
      trace("Interaction detected");
      function onTimer(e:TimerEvent):void {
      handleInactivity();
      function handleInactivity():void {
      trace('You\'re inactive.');
      if (Maps == true){
      myLoader_Map_1.unloadAndStop();
      myLoader_Map_2.unloadAndStop();
      else{
      trace("No Maps");
      if (Ss == false ){
      ScreenSaver();
      MPclose();
      else{
      trace("ScreenSaver already loaded");

  • Looping external swf which has no .fla

    Hi!
    What I have is a sliding menu with buttons - each button calls an external swf - which plays in an empty movie clip.
    Now, I want the current loaded swf to loop till the time the user clicks on another button. The problem is, I do not have the fla files for any of the external swfs (these are screencam recordings using a software that does not publish .fla) - so I can't put a code at the end of each external swf asking it to not stop.
    Any suggestions on how I might be able to have the external swf loop?
    Thanks & Regards,
    ~ Raven

    Thanks for your help Ned. Actually, I did manage to decompile the swf (using a 3rd party software) - yes, it is a movieclip on frame 1. I could even go inside it and place the loop code. But decompiling meant loss of the control bar that the screen capture software put in it and I can't compromise on that. I guess the screen capture guys should've chosen another softwares that publishes the .fla.
    Thanks again and regards,
    ~ Raven

  • Remove / unload external swf file(s) from the main flash file and load a new swf file and garbage collection from memory.

    I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
    This is the error message(s) I am receiving: "TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/removeChild()
    at index_fla::MainTimeline/Down3()"
    import nl.demonsters.debugger.MonsterDebugger;
    var d:MonsterDebugger=new MonsterDebugger(this);
    stage.scaleMode=StageScaleMode.NO_SCALE;
    stage.align=StageAlign.TOP_LEFT;
    stage.addEventListener(Event.RESIZE, resizeHandler);
    // loader is the loader for portfolio page swf
    var loader:Loader;
    var loader2:Loader;
    var loader3:Loader;
    var loader1:Loader;
    //  resize content
    function resizeHandler(event:Event):void {
        // resizes portfolio page to center
    loader.x = (stage.stageWidth - loader.width) * .5;
    loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    /*loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;*/
    addEventListener(Event.ENTER_FRAME, onEnterFrame,false, 0, true);
    function onEnterFrame(ev:Event):void {
    var requesterb:URLRequest=new URLRequest("carouselLoader.swf");
    loader = null;
    loader = new Loader();
    loader.name ="carousel1"
    //adds gallery.swf to stage at begining of movie
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requesterb);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    // stop gallery.swf from duplication over and over again on enter frame
    removeEventListener(Event.ENTER_FRAME, onEnterFrame);
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent):void {
    // re adds listener for contact.swf and about.swf
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
    var requester:URLRequest=new URLRequest("carouselLoader.swf");
        loader = null;
    loader = new Loader();
    loader.name ="carousel"
    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader);
    loader.x = (stage.stageWidth - 739) * .5;
    loader.y = (stage.stageHeight - 500) * .5;
    removeChild( getChildByName("about") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of gallery.swf
    MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    function Down1(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    var requester:URLRequest=new URLRequest("contactLoader.swf");
    loader2 = null;
    loader2 = new Loader();
    loader2.name ="contact"
    loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader2.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader2);
    loader2.x = (stage.stageWidth - 658.65) * .5;
    loader2.y = (stage.stageHeight - 551.45) * .5;
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
    //adds eventlistner so that info.swf can be loaded
    MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    function Down3(event:MouseEvent):void {
    //this re-adds the EventListener for portfolio so that end user can view again if they wish.
    MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
    var requester:URLRequest=new URLRequest("aboutLoader.swf");
    loader3 = null;
    loader3 = new Loader();
    loader3.name ="about"
    loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
    function ioError(event:IOErrorEvent):void {
    trace(event);
    try {
    loader3.load(requester);
    } catch (error:SecurityError) {
    trace(error);
    addChild(loader3);
    loader3.x = (stage.stageWidth - 482) * .5 - 260;
    loader3.y = (stage.stageHeight - 492) * .5 - 140;
    removeChild( getChildByName("carousel") );
    removeChild( getChildByName("carousel1") );
    // remove eventlistner and prevents duplication of info.swf
    MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
    stop();

    Andrei1,
    Thank you for the helpful advice. I made the changes as you suggested but I am receiving a #1009 error message even though my site is working the way I wan it to work. I would still like to fix the errors so that my site runs and error free. This is the error I am receiving:
    "TypeError: Error #1009: Cannot access a property or method of a null object reference."
    I'm sure this is not the best method to unload loaders and I am guessing this is why I am receiving the following error message.
         loader.unload();
         loader2.unload();
         loader3.unload();
    I also tried creating a function to unload the loader but received the same error message and my portfolio swf was not showing at all.
         function killLoad():void{
         try { loader.close(); loader2.close; loader3.close;} catch (e:*) {}
         loader.unload(); loader2.unload(); loader3.unload();
    I have a question regarding suggestion you made to set Mouse Event to "null". What does this do setting the MouseEvent do exactly?  Also, since I've set the MouseEvent to null do I also have to set the loader to null? e.g.
    ---- Here is my updated code ----
    // variable for external loaders
    var loader:Loader;
    var loader1:Loader;
    var loader2:Loader;
    var loader3:Loader;
    // makes borders resize with browser size
    function resizeHandler(event:Event):void {
    // resizes portfolio page to center
         loader.x = (stage.stageWidth - loader.width) * .5;
         loader.y = (stage.stageHeight - loader.height) * .5;
    // resizes about page to center
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
    //adds gallery.swf to stage at begining of moviie
         Down();
    //PORTFOLIO BUTTON
    //adds eventlistner so that gallery.swf can be loaded
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
    function Down(event:MouseEvent = null):void {
    // re adds listener for contact.swf and about.swf
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
    //unloads gallery.swf from enter frame if users presses portfolio button in nav
         var requester:URLRequest=new URLRequest("carouselLoader.swf");
         loader = new Loader();
         loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader.load(requester);
         } catch (error:SecurityError) {
         trace(error);
         this.addChild(loader);
         loader.x = (stage.stageWidth - 739) * .5;
         loader.y = (stage.stageHeight - 500) * .5;
    // sure this is not the best way to do this - but it is unload external swfs
         loader.unload();
         loader2.unload();
         loader3.unload();
    // remove eventlistner and prevents duplication of gallery.swf
         MovieClip(root).nav.portfolio.removeEventListener(MouseEvent.MOUSE_DOWN, Down);
    //INFORMATION BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         function Down1(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         var requester:URLRequest=new URLRequest("contactLoader.swf");
         loader2 = null;
         loader2 = new Loader();
         loader2.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);    
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader2.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader2);
         loader2.x = (stage.stageWidth - 658.65) * .5;
         loader2.y = (stage.stageHeight - 551.45) * .5;
    loader.unload();
    loader2.unload();
    loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.info.removeEventListener(MouseEvent.MOUSE_DOWN, Down1);
    //ABOUT BUTTON
         //adds eventlistner so that info.swf can be loaded
         MovieClip(root).nav.about.addEventListener(MouseEvent.MOUSE_DOWN, Down3, false, 0, true);
         function Down3(event:MouseEvent = null):void {
         //this re-adds the EventListener for portfolio so that end user can view again if they wish.
         MovieClip(root).nav.portfolio.addEventListener(MouseEvent.MOUSE_DOWN, Down, false, 0, true);
         MovieClip(root).nav.info.addEventListener(MouseEvent.MOUSE_DOWN, Down1, false, 0, true);
         var requester:URLRequest=new URLRequest("aboutLoader.swf");
         loader3 = null;
         loader3 = new Loader();
         loader3.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);
         function ioError(event:IOErrorEvent):void {
         trace(event);
         try {
         loader3.load(requester);
    }      catch (error:SecurityError) {
         trace(error);
         addChild(loader3);
         loader3.x = (stage.stageWidth - 482) * .5 - 260;
         loader3.y = (stage.stageHeight - 492) * .5 - 140;
         loader.unload();
         loader2.unload();
         loader3.unload();
         // remove eventlistner and prevents duplication of info.swf
         MovieClip(root).nav.about.removeEventListener(MouseEvent.MOUSE_DOWN, Down3);
         stop();

  • External swf file not using URLRequest

    Good morning guys.
    You can load an external swf file not using URLRequest? Since embed html code is setted as <param value="never" name="allowscriptaccess"/>
    I have this problem and I need to load a swf skin
    thank you

    are you loading a swf (done during runtime) or importing one (done during authortime)?
    in either case, the allowscriptaccess parameter of the external swf (that your loading or importing) is irrelevant.  allowscriptaccess is assigned in the main (loading or importing) swf's embedding html page and is used to control html/js access of the main and loaded swfs.
    if you trust the swf you're loading, you can change allowscriptacess to always.  if you're importing a swf, none of its actionscript will execute anyway so it doesn't matter whether its trusted or not.

  • HT1338 not able to access my external hd which i used on my windows pc ntfs3g and mac fuse aren't helping what to do?

    not able to access my external hd which i used on my windows pc ntfs3g and mac fuse aren't helping what to do?

    Bump-I still really need help with this! The connection keeps cutting in and out and I really don't know how to fix it!

  • AIR crashes on loading swf with 'Imported for runtime sharing' fonts

    Hello everybody,
    I have a trouble with an AIR application developped with Flex but the error seems to come from the Flash/AIR, after some searches a staff member (Flex harUI) said me that I could find more help for my trouble here.
    I'm developping an AIR application which loads an external swf. This swf contains 'Imported for runtime sharing' fonts from another swf to reduce its size.
    When the AIR application has finished to load (see message below) the whole application crashes without giving any error message except the usual "Process terminated unexpectedly" error message.
    End Loading: [SWF] C:\Users\dev02\myProject\index.swf - 83,930 bytes after decompression
    Error Message:
    Process terminated unexpectedly.
    Launch command details:  "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.6.0\bin\adl.exe" -runtime "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.6.0\runtimes\air\win" "C:\Users\dev02\Adobe Flash Builder 4\Languages_Editor\bin-debug\Language_Editor-app.xml" "C:\Users\dev02\Adobe Flash Builder 4\Languages_Editor\bin-debug"
    I use Flash Builder 4 (build 272416) with sdk 4.6.
    Full discussion here.
    I tried to load the external swf with the most basics codes, it works with a Flash web app but not with a Flex/AIR app or a Flash/AIR app.
    Thanks for the help !

    Thanks for the anwser.
    In fact, I cannot specify a swc because my main application is an editor of sub-applications where each one has its own library.
    The bug remains when sharing a simple MovieClip too.
    Maybe, if I explain my project it will be a little more clear.
    I'm developping a multi-languages module / application.
    For each module, I have an external xml for texts. So in order to add a new language we don't need to recompile, just to change texts in the xml. But, I had to externalize my fonts, (imagine if each swf contains the whole characters set like latin, cyrillic, etc.).
    And then, I have my main text editor application above the module, which loads texts xmls and a preview of the page where we need to change the text. (This is where it crashes, during the process of loading the preview).
    My editor works great for translating, changing texts, modify images but without the preview, what is really frustrating.
    (not so ergonomic, I know...)
    I hope it will help you to understand my trouble.
    regards

  • Unload external SWF using event dispatch

    Hi i am working on a flash website where i have a main movie named as Navigation where i have all the navigation buttons and drop menus. i am using switch case method to load multiples external SWFs. so as user clicks on any of the navigation button...it loads the external SWF
    now i have a close_btn in the loaded SWF and i simply want the unload the external SWF when user clicks on the close_btn.
    I come to know that i can do this by event dispach but i am not sure what code to put in external swf  so when close_btn is clicked it can access the unloader function in main movie and unload the External SWF.
    Could you Please help, Thank you !
    this is my code
    //--------main swf---------------------
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.*;
    import flash.net.URLRequest;
              home_btn.addEventListener(MouseEvent.CLICK,Click_To_Close);
              ourstory_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              facility_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              customers_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              sustainability_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              contactus_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    //  Dropdown Menu1 Buttons
              menu1.menu_mc1.organicinitiative_btn.addEventListener(MouseEvent .CLICK, clickHandler);
              menu1.menu_mc1.myhope_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu1.menu_mc1.target2015_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    //  Dropdown Menu2 Buttons
              menu2.menu_mc2.mens_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu2.menu_mc2.womans_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu2.menu_mc2.teans_btn.addEventListener(MouseEvent.CLICK, clickHandler);
              menu2.menu_mc2.babies_btn.addEventListener(MouseEvent.CLICK, clickHandler);
    var loader:Loader = new Loader();
    addChildAt(loader,0);
    function clickHandler(e:Event):void{
    switch(e.target.name){
        case "ourstory_btn": loader.load(new URLRequest("ourstory.swf")); break;
        case "facility_btn": loader.load(new URLRequest("facility.swf")); break;
              case "customers_btn": loader.load(new URLRequest("customers.swf")); break;
              case "sustainability_btn": loader.load(new URLRequest("sustainability.swf")); break;
              case "contactus_btn": loader.load(new URLRequest("contactus.swf")); break;
              case "organicinitiative_btn": loader.load(new URLRequest("organicinitiative.swf")); break;
              case "myhope_btn": loader.load(new URLRequest("myhope.swf")); break;
              case "target2015_btn": loader.load(new URLRequest("target2015.swf")); break;
              case "mens_btn": loader.load(new URLRequest("mens.swf")); break;
              case "womans_btn": loader.load(new URLRequest("womans.swf")); break;
              case "teans_btn": loader.load(new URLRequest("teens.swf")); break;
              case "babies_btn": loader.load(new URLRequest("babies.swf")); break;
    //-----------my unloader function in main swf --------------------
    function Click_To_Close(event:MouseEvent):void
                  if(loader != null) {
         loader.unloadAndStop();

    thank you
    i have tried to use   this.parent.Click_To_Close  but it gives compilation error
    i checked the tutorial about custom events i think its little complex for me now to understand the typeriter app.
    also i cheked the similer thread and tried to test that code myself..i found that the last block of main movie does not works and does not unload the loader2. however  all the trace are showing in the output windows that i added to check the code but last trace from the main movie is not showig...   
    trace("child removed from Main Movie") 
    so if this can work somehow i will use this method of event dispatch in my application that i am working...
    Thank you
    -----main movie ---------
    var loader1:Loader = new Loader();
    var loader2:Loader = new Loader();
    loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, assignMovie1Listener);
    loader1.load(new URLRequest("movie_1.swf"));
    loader2.load(new URLRequest("movie_2.swf"));
    addChild(loader1);
    addChild(loader2);
    function assignMovie1Listener(evt:Event):void {
          MovieClip(evt.currentTarget.content).addEventListener("eventTriggered", removeLoader2);
                trace("listner is listning..")
    function removeLoader2(evt:Event):void {
          loader2.unloadAndStop();
          removeChild(loader2);
             loader2 = null;
                trace("child removed from Main Movie")
    //------------- movie_1.swf code:
    removeMovie2_btn.addEventListener(MouseEvent.CLICK , removeMovie2);
    function removeMovie2(event:MouseEvent):void
          dispatchEvent(new Event("eventTriggered"));
                trace("event triggered form Child Movie-1");
    as u can see when i click close button its triggering the trace from movie-1 but its not unloadign the movie2

  • PrintJob unable to print my external swf which created from a pdf.

    Hi Everybody,
    We developed a tool which split pdf's uploaded by user into single page and convert each single page into swf. We used swftools to convert pdf to swf.
    after converting swf files we show each swf as a single page to user, where user can add more colors, clip arts, text, images to it and later we can take print out, for testing we will print the final output as pdf.
    Most of the times everything is working fine, but when pdf page have many layers, we are able to convert into swf successfully, but while printing some layers (mainly images) are missing in final print. We tried converting pdf to AVM1 swf and AVM2 swf files, in both cases the result is same. Did anybody have idea about this issue?
    Regards
    Vikram

    Hi Karthik,
    Please check below
    You can view Log files on 14 hive folder <System Root>:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS . Use the ULS Logviewer tool to eficiently view the Log files http://ulsviewer.codeplex.com/.
    Search for Log file with the viewer or check the latest file with time provided by Error page. That will show exact issues.
    or
    BCS supports null columns, but make sure the column is set to IsNullable in the db schema.
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How to Load/Unload external SWF

    Hey all, I'm in a desperate struggle to meet a deadline for college coursework. I am unable to UNLOAD an external SWF file that I have put inside another SWF file. The problem that is occurring is, although it loads successfully, when I attempt to navigate to another page after viewing the external SWF, I expect it to close as it goes on to another page however, it remains in place. If i then go back on to the page that it is loading from, it will start to keep adding more and more SWF's. The print screens should explain it easier... Below i'll post the code that I'm using currently. The external SWF I am trying to load/unload is an interactive hangman game (whether it being interactive has an effect I do not know), but any and all help with this would be seriously appreciated!
    The code currently being used is:
    var _swfLoader:Loader;
    var _swfContent:MovieClip;
    loadSWF("Real Hangman.swf");
    function loadSWF(path:String):void {
       var _req:URLRequest = new URLRequest();
       _req.url = path;
       _swfLoader = new Loader();
       setupListeners(_swfLoader.contentLoaderInfo);
       _swfLoader.load(_req);
    function setupListeners(dispatcher:IEventDispatcher):void {
       dispatcher.addEventListener(Event.COMPLETE, addSWF);
       dispatcher.addEventListener(ProgressEvent.PROGRESS, preloadSWF);
    function preloadSWF(event:ProgressEvent):void {
       var _perc:int = (event.bytesLoaded / event.bytesTotal) * 100;
       // swfPreloader.percentTF.text = _perc + "%";
    function addSWF(event:Event):void {
       event.target.removeEventListener(Event.COMPLETE, addSWF);
       event.target.removeEventListener(ProgressEvent.PROGRESS, preloadSWF);
       _swfContent = event.target.content;
       _swfContent.addEventListener("close", unloadSWF);
       addChild(_swfContent);
    function unloadSWF(event:Event):void {
       _swfLoader.unloadAndStop();
    removeChild(_swfContent);
       _swfContent = null;
    This printscreen is showing what it looks like in the Flash view (plain background and external SWF loads when this SWF is published)
    What it looks like when loaded as published swf
    Picture of the external SWF working inside the other SWF
    Picture of it not being able to unload when i navigate to another page!
    Finally, a picture of it doubling up when i proceed to go on the 'game' page again, it just keeps loading the SWF's rather than unloading them!

    for example, file1 consits of two buttons, and also considered as main page. As i click on these two buttons , it will lead me go to open the external file2.swf, and file3.swf respectively. (file2.swf and file3.swf could have other navigation buttons, however, i am just simplify here).
    the code you provided is working fine. but i want to totally remove/unlink the orginal file (file1.swf) when i click on either buttons which could lead me to other page (file1.swf or file2.swf).
    Besides that, in file2.swf and file3.swf could have another "back" button to turn it back to the main page (file1.swf). When the user click on that back button, the file2.swf will unloaded...and file1.swf will be called back again...
    can it  be done?
    so sorry if my poor explanation makes you confuse..
    thank you.

  • Unloading external swf

    Hello everyone,
    I'm kind of new to AS3
    I created a flash file and i have several buttons on the main
    stage.
    I have given the buttons instance names and whenever a button
    is clicked an external swf is loaded on the main stage.
    The problem which occurred is that ehenever i click on the
    same button again i can see a glimpse of the previous swf that was
    loaded meaning that i didnt get rid of the swf on the click of
    another button.
    What i want to achieve is to load the external swf and then
    when i click on another button i wish for it to unload.
    Here is the code.
    var externalSWF6:URLRequest = new URLRequest("dress6.swf");
    var myLoader6:Loader = new Loader();
    button6.addEventListener(MouseEvent.CLICK, onButtonClick6);
    myLoader6.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
    swfLoading6);
    myLoader6.contentLoaderInfo.addEventListener(Event.COMPLETE,
    swfComplete6);
    function onButtonClick6(event:MouseEvent):void
    myLoader6.load(externalSWF6);
    function swfComplete6(event:Event):void
    addChild(myLoader6);
    myLoader6.x = 0
    myLoader6.y = 0
    function swfLoading6(event:ProgressEvent):void
    var externalSWF7:URLRequest = new URLRequest("dress7.swf");
    var myLoader7:Loader = new Loader();
    button7.addEventListener(MouseEvent.CLICK, onButtonClick7);
    myLoader7.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
    swfLoading7);
    myLoader7.contentLoaderInfo.addEventListener(Event.COMPLETE,
    swfComplete7);
    function onButtonClick7(event:MouseEvent):void
    myLoader7.load(externalSWF7);
    function swfComplete7(event:Event):void
    addChild(myLoader7);
    myLoader.x = 0
    myLoader.y = 0
    myLoader7.addEventListener("UnloadMe", unloadFunction7); //
    <-- My line
    function unloadFunction7(event:Event):void {
    // event.target is the loader reference.. so cast it as
    Loader
    Loader(event.currentTarget).unload();
    function swfLoading7(event:ProgressEvent):void
    var externalSWF:URLRequest = new URLRequest("dress4.swf");
    var myLoader:Loader = new Loader();
    button4.addEventListener(MouseEvent.CLICK, onButtonClick);
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
    swfLoading);
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    swfComplete);
    function onButtonClick(event:MouseEvent):void
    myLoader.load(externalSWF);
    function swfComplete(event:Event):void
    addChild(myLoader);
    myLoader.x = 0
    myLoader.y = 0
    function swfLoading(event:ProgressEvent):void
    var externalSWF8:URLRequest = new URLRequest("dress8.swf");
    var myLoader8:Loader = new Loader();
    button8.addEventListener(MouseEvent.CLICK, onButtonClick8);
    myLoader8.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
    swfLoading8);
    myLoader8.contentLoaderInfo.addEventListener(Event.COMPLETE,
    swfComplete8);
    function onButtonClick8(event:MouseEvent):void
    myLoader8.load(externalSWF8);
    function swfComplete8(event:Event):void
    addChild(myLoader8);
    myLoader.x = 0
    myLoader.y = 0
    myLoader8.addEventListener("UnloadMe", unloadFunction8); //
    <-- My line
    function unloadFunction8(event:Event):void {
    // event.target is the loader reference.. so cast it as
    Loader
    Loader(event.currentTarget).unload();
    function swfLoading8(event:ProgressEvent):void
    var externalSWF9:URLRequest = new URLRequest("dress9.swf");
    var myLoader9:Loader = new Loader();
    button9.addEventListener(MouseEvent.CLICK, onButtonClick9);
    myLoader9.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,
    swfLoading9);
    myLoader9.contentLoaderInfo.addEventListener(Event.COMPLETE,
    swfComplete9);
    function onButtonClick9(event:MouseEvent):void
    myLoader9.load(externalSWF9);
    function swfComplete9(event:Event):void
    addChild(myLoader9);
    myLoader.x = 0
    myLoader.y = 0
    function swfLoading9(event:ProgressEvent):void
    //you can do something here while the swf is loading... }
    button4.buttonMode = true;
    button6.buttonMode = true;
    button7.buttonMode = true;
    button8.buttonMode = true;
    button9.buttonMode = true;
    button4.addEventListener(MouseEvent.ROLL_OVER,buttonOver4);
    button4.addEventListener(MouseEvent.ROLL_OUT,buttonOut4);
    function buttonOver4(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("over4");
    function buttonOut4(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("out4");
    button6.addEventListener(MouseEvent.ROLL_OVER,buttonOver6);
    button6.addEventListener(MouseEvent.ROLL_OUT,buttonOut6);
    function buttonOver6(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("over6");
    function buttonOut6(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("out6");
    button7.addEventListener(MouseEvent.ROLL_OVER,buttonOver7);
    button7.addEventListener(MouseEvent.ROLL_OUT,buttonOut7);
    function buttonOver7(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("over7");
    function buttonOut7(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("out7");
    button8.addEventListener(MouseEvent.ROLL_OVER,buttonOver8);
    button8.addEventListener(MouseEvent.ROLL_OUT,buttonOut8);
    function buttonOver8(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("over8");
    function buttonOut8(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("out8");
    button9.addEventListener(MouseEvent.ROLL_OVER,buttonOver9);
    button9.addEventListener(MouseEvent.ROLL_OUT,buttonOut9);
    function buttonOver9(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("over9");
    function buttonOut9(e:MouseEvent):void
    e.currentTarget.gotoAndPlay("out9");
    If anyone can be of assistance i would greatly appreciate
    it:)

    Your choices for removing objects are removeChild() and
    removeChildAt().
    So you need some way of tracking the objects that are added
    so that they can be removed. IF the buttons are the only things
    that add new content while the movie is playing, then the last
    thing added will have an index = numChildren-1,
    So if you want to remove the last movie before the new movie
    is added, then use removeChildAt(numChildren-1)
    Now, for the first time you use this, it will remove the last
    element on the stage, which you don't want, so you should probably
    have a variable that is set when any button is clicked and a
    conditional that checks it....
    var buttonClicked:Boolean = false; // set to true when a
    button is clicked
    in the handler:
    if(buttonClicked){
    removeChildAt(numChildren-1)
    buttonClicked = true;
    There are other ways of targeting in the event the movie was
    not the last thing added to the stage when another button gets
    clicked, such as assigning name to the movie or capturing which
    index it has when it is loaded.

  • As3 for unloading external swf

    I know this is a much covered subject but after spending two days trying different
    things I have to admit I'm baffled.
    Got two swf I want connected to one another to act like a portfolio gallery - parent is called "portfolio" child is "portfolio_flash_2"
    Both have animation at the start with the child having a skip button (cause its animation is 20 odd seconds long). after the animation the thumbnails appear for the larger images.
    On both swf's the buttons I'm using to load (parent to child) and unload (child back to parent) appear after the animation - I can get the child to load from the parent but having problems knowing what proper code to use on the child button "page2_btn" to return to the parent.
    The code I'm using for the parent button is called "cloud" ;
    var myLoader:Loader=new Loader ();
    cloud.addEventListener(MouseEvent.CLICK, portfolio);
    function portfolio(myevent:MouseEvent):void{
           var myURL:URL Request=new URLRequest("portfolio_flash_page2.swf"
           myLoader.load(myURL);
           addChild(myLoader);
    I did also try adding this to the above with out any code on the button of the child swf;
    myLoader.addEventListener(MouseEvent.CLICK, unloadcontent);
    function unloadcontent(myevent:MouseEvent):void{
           removerChild(myLoader);
    but after the animation (when the code in the timeline is written) just clicking anywhere on the child swf ( not just the button) made the parent appear.
    I have also tried (in two instances when the last code above was present and removed) adding this code to the "page2_btn" I made for the child page;
    page2_btn.addEventListener(MouseEvent.CLICK, removeSWF);
    function removeSWF(e:MouseEvent):void{
            removeChild(myLoader1);
            myLoader1 = null;
    But that just resulted in the skip button on the child not working and the larger images playing as if it was a movie.
    Most of this code I got from the classrom in a book and from threads on here, did try countless others from other google searches but when your stupid your stupid. So if any body could help out a learner I'd be most grateful.
    Paul

    cheers for your reply. got the decription and source faults below
    1061: Call to a possibly undefined method unloadAndStop through a reference with static type flash.display:DisplayObjectContainer. this.parent.unloadAndStop();  // if publishing  for fp 10,  else use unload()
    1059: Property is read-only.
    this.parent=null;  // this may not execute so it might be better to call a removeSWF function in the parent swf
    based on the code in the parent as shown in first thread, how would I include/call the "removeSWF function" into that script?
    To help sort this out I thought I'd include a photo of the timeline as there is three sets of script, and for all I know each might be conflicting with the other or something. (due to why the skip btn does not work for instance)
    in photo - the top layer contains the "skip" btn script where it skips to frame 216.
    the code highlighted is the "page2_btn" script and the script lower down is for the "showimage" function in ref's to the labels 1 to 4.
    I wish I was like you pro's and could see the problems instead of staying up til the late hours of the morning trying to solve stuff searching endless google searches - could you recommend a good book from learning the basic's of the AS3 - might help a great deal to learn them first but my first indention of using flash was for animation which I done for awhile without the AS.
    But I hope to display various animations I've done within external SWF such as this example so a book that covers it would be great.
    again cheers for any help.

  • Unload external swf from flv component

    Please help.
    Is it possible to add action script to the flv player
    componet buttons?
    I am trying to unload an external swf file (voice over) if
    the viewer chooses to play one of the many videos in the
    presentation. Currently I am using an invisible button over the flv
    component play button which unloads the swf. This works but would
    rather assign the action directly to the flv play button on press.
    Any suggestions? Thank you

    I've created a empty movieclip at x : 0, y : 0 instanced as "container"
    i've got working like this,
    but now i 'm trying to call a function in root, directly from child.
    luca.swf (back button_
    box.bt_voltar.addEventListener(MouseEvent.CLICK,onClosed);
    function onClosed(e:MouseEvent):void {
              if(this.parent) {
                         if(this.parent is Loader && this.parent.parent)
                          this.parent.parent.removeChild(this.parent);
                         else
                          this.parent.removeChild(this);
              var p:MovieClip = this.parent.parent as MovieClip;
              p.traceEntrada();
    and main.swf
    function lucaHandler(e:MouseEvent):void
                        limpaHome();
                        bt_luca.visible = false;
                        bt_conheca.visible = false;
                        bt_jogo.visible = false;
                                    var ldrLuca:Loader=new Loader();
                                  ldrLuca.load(new URLRequest("luca.swf"));
                                  ldrLuca.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                                  addChild(ldrLuca);
                        function onCompleteHandler(loadEvent:Event):void{
                                  container.addChild(loadEvent.currentTarget.content);
    function traceEntrada():void{
                   trace("called from B.swf");
    Now, as you can see, how can i call a function in parent from the loaded swf.
    how can i call this trace function from the external loaded swf?
        var p:MovieClip = this.parent.parent as MovieClip;
         p.traceEntrada();
    ps, im not using classes

  • Transition_Manager and unloading external swf problems

    Hi there
    I´m having a few problems with my project which i although it work it has some unpleasant bugs that i´m trying to solve for days.
    When i load external swf´s they show up on top of the Menu button.Maybe because the button i´m pressing is inside the same movieclip as the Menu.
    Explaining better here´s a little diagram of my site:
    con2 MC (Instance of Menu) ---> cont3 MC (Instance of subMenu) and mainButton MC (Instance of Main)
    Here´s the general code which is inside the Painel.as
    package {
        import com.greensock.TweenLite;
        import com.greensock.TweenMax;
        import com.greensock.*;
        import com.greensock.easing.*;
        import flash.display.*;
        import flash.events.*;
        import flash.display.MovieClip;
        import fl.transitions.*;
        import fl.transitions.easing.*;
        import flash.net.URLRequest;
        import flash.display.Loader;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        public class Painel3 extends MovieClip
            private var inFocus:MovieClip;
            public function Painel3():void
                setupClips();
                addEventListener(Event.ENTER_FRAME, loop);
            private function setupClips():void
            con2.mainButton.addEventListener(MouseEvent.ROLL_OVER, onOver);
            con2.mainButton.addEventListener(MouseEvent.ROLL_OUT, onOut);
            con2.mainButton.addEventListener(MouseEvent.CLICK, onClick);
                var len:int = con2.cont3.numChildren;
                for(var i:int=0; i<len; i++)
                    var mc:MovieClip = MovieClip(con2.cont3.getChildAt(i));
                    mc.buttonMode = true;
                    mc.loc = [mc.x, mc.y];
                    mc.addEventListener(MouseEvent.CLICK, onClick);
                    con2.cont3.visible = false;
            private function onOver(e:MouseEvent):void
            private function onOut(e:MouseEvent):void
            private function onClick(e:MouseEvent):void
                con2.cont3.visible = true;
    TransitionManager.start(con2.cont3, {type:Wipe, direction:Transition.IN, duration:1, easing:None.easeNone, startPoint:5} );                       
            private function loop(e:Event):void
                var distx:Number = mouseX / 1400;
                var disty:Number = mouseY / 1400;
                TweenLite.to(con2, 2, {
                            rotationY:(-70 +(145*distx)),
                            rotationX:(70 -(145*disty)),
                            ease:Expo.easeOut
    And then inside the subMenu.as class for the movieclip subMenu i have the buttons that load the external swf´s:
    package  {
        import com.greensock.TweenLite;
        import com.greensock.TweenMax;
        import com.greensock.*;
        import com.greensock.easing.*;
        import flash.display.*;
        import flash.events.*;
        import flash.display.MovieClip;
        import flash.net.URLRequest;
        import flash.display.Loader;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        import fl.transitions.*;
        import fl.transitions.easing.*;
        public class subMenu extends MovieClip {
            public function subMenu() {
                // constructor code
                menu1.buttonMode = true;
                menu2.buttonMode = true;
                menu3.buttonMode = true;
                menu4.buttonMode = true;
                 menu1.addEventListener(MouseEvent.CLICK,link1);
                 menu2.addEventListener(MouseEvent.CLICK,link2);
                 menu3.addEventListener(MouseEvent.CLICK,link3);
                 menu4.addEventListener(MouseEvent.CLICK,link4);
            function link1(e:MouseEvent) {
               function startLoad()
                var mLoader:Loader = new Loader();
                var mRequest:URLRequest = new URLRequest("AugmentedReality_v1.swf");
                mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
                mLoader.load(mRequest);
    function onCompleteHandler(e:Event):void {
    var swf:DisplayObject = e.target.content;
    swf.x = -400;    
    swf.y = -300;    
    addChild(swf);
    function onProgressHandler(mProgress:ProgressEvent)
           var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
           trace(percent);
    startLoad();
            function link2(e:MouseEvent) {
                function startLoad()
                var mLoader:Loader = new Loader();
                var mRequest:URLRequest = new URLRequest("Fotos.swf");
                mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
                mLoader.load(mRequest);
    function onCompleteHandler(e:Event):void {
    var swf:DisplayObject = e.target.content;
    swf.x = -400;    
    swf.y = -300;    
    addChild(swf);
    function onProgressHandler(mProgress:ProgressEvent)
           var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
           trace(percent);
    startLoad();
            function link3(e:MouseEvent) {
            function link4(e:MouseEvent){
                function startLoad()
                var mLoader:Loader = new Loader();
                var mRequest:URLRequest = new URLRequest("Texto.swf");
                mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
                mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
                mLoader.load(mRequest);
    function onCompleteHandler(e:Event):void {
    var swf:DisplayObject = e.target.content;
    swf.x = -400;    
    swf.y = -300;    
    addChild(swf);
    function onProgressHandler(mProgress:ProgressEvent)
           var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
           trace(percent);
    startLoad();
    Like i said the swf´s show up on top of the Menu and i need it to dissapear.
    Also i want to unload the swf currently in scene so that when i load another one they don´t pile on top of each other.
    Pls help. Thanks

    Oh btw, i´m having an error 1069 Property TransitionManager not found in subMenu and there is no default value
    at fl.transitions::TransitionManager$/start()
        at Painel3/onClick()
    This doesn´t happen when i uncheck the Export for actionscript in the subMenu class but i can´t do that or else the buttons wont work.

Maybe you are looking for

  • How do I stop the Cp from advancing automatically to the next slide?

    I'm using Windows NT and Adobe Captivate 4.  Until now, I've been creating demos in Cp4 where the movie file just continues to the next slide automatically.  Now I'm making the Cp files more interactive and would like to know how to make the movie no

  • 6280 Screen light

    Hi, Something strange is going on with my 6280, after an hour i leave the phone on the table the phones screen wont go black, it stays on standby with i slightly lighted display it won't go black, Power save and sleep mode are on but it still doesn't

  • Is it possible to add data link at runtime

    Hi, I would like to get the data from a temporary table and needs to create a data link with an existing group at run time to display the temporary data in the same frequecy of the other groups.....thanks Bcj

  • How can i recover my lost notes?

    When i opened the app two of my notes dissapered. I haven't synced the phone, or connected my notes to my email. I've tried to download a notes recovery program, but they only save the currant notes and don't recover the ones which i've lost... Pleas

  • Can't open latest 64-bit version of iTunes. It says to open it in 32-bit but there is no option in "Get Info" to do that.

    I use a MacBook Pro version 10.6.8. The version of iTunes I installed is 10.5.1. When I try to open iTunes, the following message appears: Running iTunes in 64-bit mode requires Mac OS X 10.7 or later. To run iTunes in 32-bit mode, select the iTunes