Problem with loading/unloading SWFs external

Hey! Thank you in advance for any assistance you can provide. Here's the question: my master I am loading an external swf file. This file overlays the original file, so I started looking for a way to download the original file. I was not very successful. I've looked through these forums and did research on google, too, but found only a partial solution.  Right now, I have created a background layer that allows the loaded file cover the original file without bleed through.  I'd rather have the original file unload before loading the file newly appointed.

Here is the code that I found so far:

Declaring Variables
var Xpos = 0;
var Ypos = 0;
var loader: Loader = new Loader();
var swfFileToLoad: URLRequest = new URLRequest ("holdHumans.swf");

Go to the creation
removeChild (loader);
Loader.Load (swfFileToLoad);
Loader.x = Xpos;
Loader.y = Ypos;
addChild (loader);

This code is normally associated with a key event, but I have to be able to use it inside a timer function in the original file. When the function is called, I get this message: Error #2025: the supplied DisplayObject must be a child of the caller.

I get this message too when I try to use it in the swf file loaded externally.

How to solve this problem?

Thank you

Michael

You are welcome.

Tags: Adobe Animate

Similar Questions

  • Loading & unloading SWF external in main.swf

    Hello, please I have problem with my project. I'm happy for all the help I can get.

    so, my question is the following:

    I main.swf that standard load menubar.swfand footer.swf in menubar.swf are buttons: button1_btn, button2_btn, button3_btn.

    Main.swf is listening click on the button 1, 2 or 3. If for main.swf loads content1.swf, content2.swf or content3.swf

    for example: was clicked button1_btn which addedChild of content1.swf coming from the left to the center of the stage and if user click on button2_btn , I want only the content that is loaded (in this example is content1.swf), going away from the stage to the right and then content2.swf will come from the left side toward the center of the scene.

    I'm sorry for my English.

    Any help will be much appreciated.

    Thank you very much in advance.

    project1.jpg

    you always change the names of your buttons.

    When you finally on your button names, add them to a table and use:

    var buttonA:Array = [the button that matches content1Loader, the buttons corresponding to content2Loader, etc.];

    var prevOnStageLoader:Loader;

    for (var i: int = 0; i<>

    buttonA [i] .addEventListener (MouseEvent.CLICK, goContent);

    }

    function goContent(e:MouseEvent):void

    {

    {if (prevOnStageLoader)}

    TweenLite.to(prevOnStageLoader,1,{x:stage.stageWidth});)

    }

    prevOnStageLoader Loader = (this ["happy" + (1 + buttonA.indexOf (e.currentTarget)) + "Loader"]);

    addChild (prevOnStageLoader);

    prevOnStageLoader.x =-1250;

    TweenLite.to (prevOnStageLoader, 1, {x: 0, ease:Elastic.easeInOut});})

    }

  • Problem with load LOV value reset

    12.1.3 ADF

    I am facing a problem with load LOV set to reset.

    I have a page in waterfall surrounded by af LOV: PanelFormLayout. Also do some validation on the data entered by the user when clicked on submit. If the validation fails, an alert will appear on the validation failed and user will stay on the same page.

    Values LOV child get back their null or empty when you click on the "submit" button. It works as expected when the validation failed and the user has navigated to the next page. But if validation fails, the user stays on the same page and child LOV connection reset to NULL or emptyvalue. For this reason, NPE error occurs when the user attempts submit again and have to select again the child value LOV.

    Is it possible to keep the child LOV value even after submitting a form?

    Page code:

    < af:panelBox text = "Product Details" id = "pb4" >

    < af:panelFormLayout id = labelWidth "180px" = "pfl4" >

    < af:selectOneChoice value = "#{bindings." ProdType.inputValue}.

    label = "#{bindings." Required to ProdType.label'} = 'true '.

    requiredMessageDetail = "product Type cannot be NULL. Please select a value.

    shortDesc = "Select the Type of product" id = "soc1' autoSubmit = 'true '.

    showRequired = "true" contentStyle = "width: 150.0px".

    Binding = "#{viewScope.provBean.prodType} '"

    valueChangeListener = "#{viewScope.provBean.prodTypeVCL}" >

    < f: selectItems value = "#{bindings." ProdType.items}"id ="si1"/ >

    < f: validator binding = "#{bindings." ProdType.validator} "/ >"

    "< af:target execute="@this "make ="soc2"/ >

    < / af:selectOneChoice >

    < af:selectOneChoice value = "#{bindings." ProdVer.inputValue}.

    label = "#{bindings." Required to ProdVer.label'} = 'true '.

    requiredMessageDetail = 'Product Version cannot be NULL. Please select a value.

    shortDesc = 'Select Product Version' id = 'soc2 '.

    Disabled = ' #{bindings. " ProdVer.inputValue == null} ".

    contentStyle = "width: 150.0px" showRequired = "true".

    Binding = "#{viewScope.provBean.prodVer}" >

    < f: selectItems value = "#{bindings." ProdVer.items}"id ="si2"/ >

    < f: validator binding = "#{bindings." ProdVer.validator} "/ >"

    < / af:selectOneChoice >

    < / af:panelFormLayout >

    < / af:panelBox >

    Timo thanks for your response.

    Child LOV I created is an attribute of transient and resolved the problem by setting the property of passivation to true.

  • Problem with loading an external swf of in an external swf...

    OK, everything was going well on a Web site project, I worked, until yesterday. I will try to explain the whole scenario first, and I'll put the code here too so anyone can try to understand what the problem is. Here is a breakdown of the site:

    1) there a MAIN SWF file that plays an intro and then stops on the last image with the Navigation buttons 'hand'.

    2) in the root folder where the MAIN SWF resides, there is another folder called "sovereign wealth funds", which contains six main external navigation pages, but also another folder called "galleries" which contains additional external SWFs for six pages in the gallery.

    3) on one of the layers of the MAIN SWF, there is a clip called 'mySWFLoadingClip' that the buttons of Navigation of the 'hand' loading and unload pages external to swf. It all works perfectly. The beginning of the problem to the next step. This is the code I used for the buttons of navigation on the MAIN SWF scenario:

    var Xpos:Number = 0.0;
    var Ypos:Number = 0.0;
    var swf:MovieClip;
    var loader: Loader = new Loader();

    var defaultSWF:URLRequest = new URLRequest("swfs/home_page_swf.swf");

    Loader.Load (defaultSWF);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClip.addChild (loader);
    ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

    Function universal BTNS
    function btnClick(event:MouseEvent):void {}

    this.mySWFLoadingClip.removeChild (loader);
    var newSWFRequest:URLRequest = new URLRequest ("SWFs /" + event.target.name + ".swf");
    Loader.Load (newSWFRequest);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClip.addChild (loader);
    }
    Listeners of BTN
    home_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    portfolio_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    services_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    about_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    team_page_swf.addEventListener (MouseEvent.CLICK, btnClick);
    contact_page_swf.addEventListener (MouseEvent.CLICK, btnClick);


    4) one of the external navigation SWF pages is called "portfolio_page_swf" and gets loaded into the moveclip of 'mySWFLoadingClip' on the MAIN SWF. This is where the problem begins. The "portfolio_page_swf" has six buttons facing an additional external swf in the file galleries. Now when I open the file "portfolio_page_swf" to test if the buttons work, they work perfect. When I click the buttons, the external swf gallery files appear as they should. But the problem is that when I open the "MAIN SWF" file to test the site, I can click on the main Navigation buttons and they work. I click the portfolio button on the time line of Hand SWF and place of 'portfolio_page_swf' on the stage as it should, but when I click the buttons located in the 'portfolio_page_swf' galleries are not displayed. The page "portfolio_page_swf" buttons work only if I open the file 'portfolio_page_swf' directly. The following code is used in the "portfolio_page_swf":

    var Xpos:Number = 0.0;
    var Ypos:Number = 0.0;
    var swf:MovieClip;
    var loader: Loader = new Loader();

    var defaultSWF:URLRequest = new URLRequest("galleries/gallery_print_swf.swf");

    Loader.Load (defaultSWF);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClipGALLERY.addChild (loader);
    ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

    Function universal BTNS
    function btnClick(event:MouseEvent):void {}

    this.mySWFLoadingClipGALLERY.removeChild (loader);
    var newSWFRequest:URLRequest = new URLRequest ("galleries /" + event.target.name + ".swf");
    Loader.Load (newSWFRequest);
    Loader.x = Xpos;
    Loader.y = Ypos;
    this.mySWFLoadingClipGALLERY.addChild (loader);
    }
    Listeners of BTN
    gallery_print_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_packaging_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_web_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_video_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_others_swf.addEventListener (MouseEvent.CLICK, btnClick);
    gallery_logos_swf.addEventListener (MouseEvent.CLICK, btnClick);

    If anyone can help understand me this I would really appreciate. This is a very important project and the deadline is coming up very soon. Please help me understand how to load an external SWF on the main timeline and then charge an additional external swf within the first external swf. I'm puzzled.

    If I'm following the structure you describe, it's probably a problem of targeting.  If you load a swf into another swf I think the scenario is the same that if you load a swf in a web page...  The charging base is the document down the chain, which is your main swf if you test Flash (otherwise it would be so stable web page in a web page).  So when your portfolio is responsible in the hand, it's like living in the folder of the hand, so your swf portfolio should probably include sovereign wealth funds in targeting... as in...

    var defaultSWF:URLRequest = new URLRequest("swfs/galleries/gallery_print_swf.swf");

  • Problem with loading external swf files

    Hello

    I am currently working on a project which is an interactive and dynamic elemtry school presentation to the Denmark. I finished my project and it works perfectly, but only locally on my computer.

    The final draft should be implemented on the site and public work. I tried to implement the project on the site and unfortunately, it does not work as expected.

    When all the files where transferred to the ftp server, only a single files are responding and appear correctly.

    Interactivity of the project is based on a structure of Action script, which is based on the smooth transition between swf files (load another swf file after the action is triggered by clicking on a button) do any work.

    After days of trying to figure out the solution, I'm totally lost. One thing is to publish the project so that all action script will work and answer between swf files, and the other thing is to make it user-friendly for the Android and apple products.

    The presentation is quite heavy because of its loading external swf content files, which are images and movies.

    I really hope you can help me with my problem. I will gladly share the files and codes if it would help solve the problem.

    Best regards

    Agata

    It could be a problem of location of file from loading.  When you place a swf file in an HTML base for targeting anything that the SWF load becomes the folder of the html page.  You may need to adjust the target so that the target of swf files, load it as if it were in the same folder as the html page.

  • Need HELP loading and unloading SWFs external when the user clicks on the buttons

    Hi everyone, I'm working on a few Web sites at the moment, one for being my online portfolio, as well as my Web site for a product of sleep, that I'm selling.  I have very little experience with AS3, last time I created a Web site that as2 has been used.  I tried a few tutorials online, but nothing performs the work, there is always an error...

    I have an index.swf that loads the default home.swf.   There is also an about.swf, contact.swf, order.swf and testimonials.swf...

    It was a hair pulling 4 days now, not be able to get this working.

    All I need is for the swf external to pull up when you click on the corresponding button, and when the next button is clicked, the current to unload swf and swf to load new file.  It was so simple with AS2, you would think things could be as easy, if not easier.   So any help that all the world can offer, I would be so very you happy for me!  If necessary I can copy my current code, even if it doesn't work!   Thanks, Mike

    var loader: Loader = new Loader();

    addChild (loader);

    home_btn.addEventListener (MouseEvent.Click, loadF);

    about_btn.addEventListener (MouseEvent.Click, loadF);

    contact_btn.addEventListener (MouseEvent.Click, loadF);

    function loadF(e:Event):void {}

    Loader.Load (new URLRequest (e.currentTarget.name.split ("_") [0] + ".swf")); / / assuming that each reference button is also the button's name property

    }

  • Problem with loading ScrollPane

    I have a SWF that loads another swf into a ScrollPane. The SWF being loaded is great... about 4 MB. My problem is that sometimes it loads well, sometimes it loads without the scroll bar, and sometimes you need to refresh the page before loading completely and correctly. My question: How can I easily test it has fully charged and that the scroll bars appear? I tried various scenarios with ProgressBars, etc., but even when 100% charged, the scroll bars do not load consistently. Any help would be appreciated. -Bill

    ScrollPane has getBytesLoaded() and getBytesTotal() methods that you can use to check if the content is completely loaded.  at this point, you can run an invalidate() or redraw() method.

  • Having a problem with loading in the combustion chamber

    Hello

    I'm having a small problem I could use help with. I'm not really sure what's going on, but I'm having a problem with one of the pages of my site does not when you try to view the page in Firefox. But if I loaded this page in Safari or Chrome, it loads very well.

    Here is the URL of the page to take a look:
    Specific link removed by moderator display ~ J99 < sitename >.com/top-10/top...services/

    No idea why this might be happening or how to fix it? I don't know if it's just my computer, or if others have the same problem.

    Thanks in advance,

    Mike

    There's two of us have confirmed the page will load so I deleted the link to display as it could be construed as advertising.

    P.S. Note only forum content in the resolved threads is now indexed by search engines.

    (Last updated: February 14, 2015 08:45 CEST)

    Solved the locked thread now ~ J99

  • Windows 7 Causes of security errors - Invalid SIDS - problem with loading of programs such as Adobe Flash

    I discovered a bug in my Windows 7 (64-bit) that causes security errors in my system.  I honestly do not know or understand how these mistakes happened.  For example, my system lists the group "power users ^ 0' and 'Power users' (the latter should of course)."  I have never tested with the accounts system, not to mention the well known windows accounts.
    Even when I try to delete the group "power users ^ 0' the system replied that he could not remove a well-known group."  This isn't a well-known group.  The Group initially appeared in 'users and groups' within the 'computer management '.  I made a few changes to the security in the registry settings to try to fix my system, but the group no longer appears in "computer Management\Users and groups."  It appears when I look at the 'properties' for a user and select ' Add/search' when I try to add a group to the user. »
    Regarding Adobe Flash, it does not when I am connected with a normal user account.  It does not load when I log in as an administrator (on the same machine).  So I suspect there is a security problem in the registry which prevents Adobe Flash to load for a regular user.  What me stem, is that when I go there and install Adobe Flash for a normal user (Yes, he invites me to run the installation as long as the administrator - date which I enter the password to continue the installation, which runs without error reported).  The installation of Adobe Flash completed successfully for the user as an Explorer window showing the installation of Adobe Flash successfully, I proceed to access any site that requires Adobe Flash to be installed on the client computer and the site if poster correctly - flash loads fine.  Now, if log out me of the account of user and re - login under the same user on this computer, even when the user has just installed Adobe Flash, it loads is no longer!  When I navigate to a site that requires Adobe Flash, it generates an error indicating that Adobe Flash must be installed!  Curiously, when I connect as administrator, Adobe Flash loads very well!  For me, Windows 7 displays security system errors / makes me crazy.  I would be grateful if I get assistance for this problem.   All system errors have focused on SIDS invalid, invalid years system well-known accounts created by Windows 7.  In the meantime, I connect as administrator because he never complains you need to install Adobe Flash.
    Help, please!

    Thank you
    E-mail address is removed from the privacy *... com

    I decided to do a clean reinstall of my computer Windows 7 (64 bit)...  Nevertheless, I think that I think I know when the error with the "Power User ^ 0' saw the light of day..."  When I was rebuilding my machine with a fresh install of Windows 7 (with a full format my system drive), I noticed that when I renamed my machine (as everyone would expect to see), I inspected the "users and groups" in "Computer management" and low and has appeared the "power users ^ 0' group."  I believe that this has happened during the time where I've renamed my machine.   I have never messed with the creation of groups or something of the sort.  I am amazed that such a simple task would result in such a mistake.  As for my problem with impossible to load Adobe Flash, that the error has been removed, but I don't see how it existed in the first place.  I do not understand why Microsoft publishes several buggy instead of solidification Windows 7 systems.

    Thank you for your help,

    ~ sreyes27

  • Load Unload swf

    as3 load unload.jpg

    I can load 'Sample.swf' load on stage by the loader class, but I can't unload "Sample.swf."

    What button code 'X '?

    Code of main.swf is:

    load_bt.addEventListener (MouseEvent.Click, onLoadbt);

    function onLoadbt(e:MouseEvent):void

    {

    var ldr:Loader = new Loader();

    LDR. Load (new URLRequest ("Sample.swf"));

    addChild (ldr);

    }

    Sample.swf code is:

    close_bt.addEventListener (MouseEvent.Click, onClosed);

    function onClosed(e:MouseEvent):void

    {

    Loader (this.parent) .unloadAndStop ();

    }

    p.s. pleas mark the answers useful/correct.

  • Help please! Problems with loading external swf files

    I'm scared, I'm new to both Adobe Flash and Actionscript 3.0.

    I'm trying to create a simple site using a couple of different external sovereigns loaded into a main swf file.

    For the moment, in the timeline panel, I have the following code in frame 1 of the layer actions:

    import flash.events.MouseEvent;

    Stop();

    navbutt.addEventListener (MouseEvent.CLICK, shownavbg);
    function shownavbg (myEvent:MouseEvent): void {}
    gotoAndPlay (10);
    }
    home_btn.addEventListener (MouseEvent.CLICK, showhome);
    function showhome (myEvent:MouseEvent): void {}
    gotoAndPlay (66);
    }
    aboutme_btn.addEventListener (MouseEvent.CLICK, showaboutme);
    function showaboutme (myEvent:MouseEvent): void {}
    gotoAndPlay (49);
    }
    gallery_btn.addEventListener (MouseEvent.CLICK, showgallery);
    function showgallery (myEvent:MouseEvent): void {}
    gotoAndPlay (76);
    }

    var bgLoader:Loader = new Loader();
    stage.addChild (bgLoader);
    ("var url: URLRequest = new URLRequest("Background/sitebackground/Main.swf ");
    bgLoader.load (url);
    stage.setChildIndex (bgLoader, 0);

    Then, in the framework of 76, I have the following code:

    removeChildAt (0);
    bgLoader.unload ();

    In section 77:

    var galleryLoader:Loader = new Loader();
    stage.addChild (galleryLoader);
    var galleryurl:URLRequest = new URLRequest("test/ZenGalleryDemo.swf");
    galleryLoader.load (url);
    stage.setChildIndex (galleryLoader, 0);

    Stop();

    The idea is that, when the file is loaded, the 'sitebackground/Main.swf"flash loads on the stage. Then I want to delete this flash and load a different one when I click on the gallery_btn. So, when I click on the gallery_btn, he plays frame 76, theoretically unloading the Main.swf and the loading of the ZenGalleryDemo.swf in its place.

    For the moment, the Main.swf loads perfectly and works great. But when I click on the button to the Gallery, he jumps to the frame 76 and plays the Main.swf. It does not load the file ZenGalleryDemo.swf...

    If anyone has any ideas, I would be really grateful!

    Thanks in advance

    It's just a glance and reading, but the problem may lie between these two lines... look closely...

    var galleryurl:URLRequest = new URLRequest("test/ZenGalleryDemo.swf");
    galleryLoader.load (url);

  • Flash Air CC iOS: problems with loading text from an external xml located on a server.

    So I have this code allowing me to load the text of an xml located on a server. Everything works fine on Air for Android. The app works even in the ios emulator, but once I export my app on my ios with ios device 7, I do not see any text. The app is developed with Air sdk 3.9. What could be the reason? Do I need any special authorization like on Android? IOS even allow load xml from an external server?

    Clues?

    OK, I solved the problem.

  • problem with loading and unloading Movie

    Hello

    I have a function on the button to load an external swf and then I the anther button to unload

    It works perfectly...

    But when I put it on server to work online, it does not work

    Could someone help please?

    Make sure that sub01.swf is uploaded to the correct directory online and use:

    ////////////////////

    {We (Release)}

    _root. Loader_mc.loadMovie ("sub01.swf");

    }

    and the unloading function is

    ////////////////////

    on (release) {}

    _root. Loader_mc.unloadMovie ();

    }

  • Problem with loading multiple external xml files

    I have a table named 'source', which consists of names of files external xml, the content of which I'm loading in another table called 'content '. I tried with the following text:

    ----------------------------------------------------------------------------------------
    for (i = 0; i < source.length; i ++) {}
    XML_URL = "' http://localhost/temp/ ' + source ;"
    myXMLURL = new URLRequest (XML_URL);
    myLoader = new URLLoader (myXMLURL);
    myLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    }

    function xmlLoaded(evt:Event):void {}
    Content.push (myLoader.Data);
    }
    ---------------------------------------------------------------------------------------

    The problem is that in this way, I get that content of the last xml file and other items ' content ' are 'undefined '. Anyone know the solution to this problem or maybe another way to do this?

    Thanks in advance

    I tested the following with two xml files in the same folder (I would try the same thing) and put their names in the table source. Create two dummy xml for the test files.
    Here is my exact code (I've changed, I have one because it's italicized here in the forums):

    var content: Array = new Array();
    var source: Array = new Array ("media1.xml", "media2.xml");
    for (var a source) {}
    var XML_URL = ' "+ source [a];
    var myXMLURL = new URLRequest (XML_URL);
    var myLoader = new URLLoader ();
    myLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    myLoader.load (myXMLURL);
    }

    function xmlLoaded(evt:Event):void {}
    Content.push (evt. Target.Data);
    if(Content.Length ==source.) Length)
    TR();
    }

    function tr() {}
    trace (content);
    }

  • Problem with loading external images

    I have a small gallery that I did (Nothing fancy) and want images to load fully before they fade. The process would be, first image load in, click Next, shows preloader bar above the current picture (still on display), and then once fully loaded, replaces the last image with the new it fading... I hope that makes sense...

    Why doesn't this work? I use a loader movie clip...

    Alrighty... I have moved things and I now call to the function loadClip mcl in a different place, so it fades the current image, image, image new charges fades in... Let's see if my customer purchases (they wanted a more seamless transition) with on the pause between showing the loading preloader...

Maybe you are looking for