Delete with external loaded swf movieclip

Hello

I have 4 empty movieclips called holderMC1, 2, 3, 4 on 4 main timeline frames

Each movieclip load in an external swf with this code:

var swfLoader4:Loader = new Loader();

holderMC4.addChild (swfLoader4);

var bgURL4:URLRequest = new URLRequest ("F1_h.swf");

swfLoader4.contentLoaderInfo.addEventListener (Event.COMPLETE, loadProdComplete4);

swfLoader4.load (bgURL4);

function loadProdComplete4(e:Event):void

{

trace ("file loaded4");

}

I have 4 buttons which, when clicked on, goes to 4 labels in the main timeline image corresponding with the 4 movieclips

Very simple - works well - except SWFs unload properly, so the video in the external swf continues to play back plan when a new swf file has been loaded.

Can someone give me an idea of the best way to solve the problem please?

You are welcome.

p.s. in the future, please mark helpful/correct responses.

Tags: Adobe Animate

Similar Questions

  • Acess to an external loaded swf movieclip

    I am loading a swf file into a flash application. I want to access some movieclips in outside loadd swf of my main application. How can I do this?

    large.

  • How to call the function lavel root & variable external loaded swf file

    I have little problem in as3.  I load 'mainmenu.swf' file "main.swf". through class loader. so now "main.swf" is children of parents 'mainmenu.swf' file how can call "main.swf" variable and function of "mainmenu.swf".

    The parent of the loaded swf file is the charger.  The main SWF is the parent of the charger.  Then to communicate with the main storyline of the loaded file can use:

    MovieClip (parent.parent) .someFunction ();

  • Problem external loading SWF in Flash Movie

    I am trying to load an external swf (which is a slide show) in a flash animation. The swf file in the film show and apparently plays ok but there is something wrong. On the last image(3rd) in the slide show keys stop responding and when I click on the "back" button on the second slide is going to the third slide, and not the first. When I check the SWF itself it works fine, it is only in the flash movie, where everything is blurred.

    Link to the Flash animation:

    http://www.dagif.com/habanaHarlem.swf

    This is the code that I put in the flash animation:

    holder_mc.loadMovie ("http://www.dagif.com/slideplayerHabana.swf" "");

    Link to external swf: http://www.dagif.com/slideplayerHabana.swf

    This is the code for the external swf file:

    Stop();
    next_btn.onRelease = function() {}
    If (_root._currentframe == 3) {}
    gotoAndStop (1);
    }
    else {}
    nextFrame();
    }
    }
    Stop();

    previous_btn.onRelease = function() {}
    If (_root._currentframe == 1) {}
    gotoAndStop (3);
    }
    else {}
    prevFrame();
    }

    }


    num1_btn.onRelease = function() {}
    gotoAndPlay (1);
    Stop();

    }
    num2_btn.onRelease = function() {}
    gotoAndPlay (2);
    Stop();

    }
    num3_btn.onRelease = function() {}
    gotoAndPlay (3);
    Stop();

    }

    The problem is most likely the use of _root in code that show you.  Like any swf, the _root will demonstrate to the _root of the main sequence and not the loaded swf file.  Try to use this ._lockroot = true; at the beginning of the code of the imported file, replace GOLD is _root references with _parent references.

  • access loading swf movieclip classiquee on as3

    Hi, I use external swf files add skins to an application. Currenlty, I'm loading elements isolated successfully by using the Loader class. However, now I want to load a more complex structure of skin that will have some movieclips already placed on the stage of the loaded swf. The question is: when I insert a swf athe edit that day, I placed a few elements on stage and that he gave them instance names, how can I access this external swf movieclip structure? It is something like this:

    1. first of all, I create the external file by placing some items on its stage, naming instances of these elements, such as 'console_bar' and 'console_button '.
    2. then I load this swf using the Loader class (in a magazine called "playerConsole", for example) and, when he finished loading I try to access the items placed on stage:

    this.addChild (playerConsole);
    playerConsole.console_bar.x = 0; won't work no-how can I access this instance?

    mount the content as a movieclip.

  • to access methods and variables to an external loaded swf

    OK, I've been at this now for 2 straight days without success. I use external SWF as a way to customize the GUI design. The main swf default is supposed to load the external SWF and manipulate variables and methods. When I have the debug, it seems to appear on the stack which load upward variables of the external swf file. but when I try to handle it on the maintimeline, such as _level0.active_comp.name_space_header = 'Hello', it is no longer as original value defined in the SWF external or worse still undefined. I shopped, in tutorials, guide assistance, search engines, and there is no indication in the right direction, only that it should work, not that it works.


    in other words, in the external compiled swf, I put a text box empty, give the name of the instance 'name_space '.
    in the main timeline of the swf by default, I perform a simple operation createEmptyMovieClip/loadmovie.
    then on the second image, I enter custom text to be put in the external clip loaded, in the form of _level0.active_comp.name_space_header = "Hello"; and that's all, nothing. I can not even access the variables on
    any point given the default timeline. HHHEEEELLP. !!! Arrrrrgh

    The Movieclip object is only part of the answer, the real answer is the FPS of the main sequence, load the external swf file. The faster you set the time, faster it ends the loading process. So ideally, you want to set the main.swf to 120 frames per second, which is the maximum and movies of time forced as an external process. All external swf which carries only action script, inline must also be set to 120 images per second. You can create a custom Init() function to run only when the byte loading criteria has been made. This prevents a hiccup in the code and have a process of interrupted line. Anyone interested in the code example, please do not hesitate to send me an e-mail to [email protected]

  • Removal of the external loaded swf does not decrease memory

    I'm developing a desktop application using flash builder 4.7, where I am loading swf external swf main, but after his withdrawal, it remains in the process (check in the Task Manager. os: windows 7), process decreases a little, but not as much as it should be. so, whenever I insert again and remove, process increases and after multiple loading, application crash down. I'm removing it like this

    if (_loader.numChildren>0)

         _loader.removeChildren(0,_loader.numChildren-1);

    _loader.unload();

    _loader.stopAllMovieClips();

    _loader.unloadAndStop(true);

    _loader.loaderInfo.removeEventListener(Event.COMPLETE, onComplete);

    this.removeChild(_loader);

    _loader = null;

    I have added custom destroy the external inside swf method and started calling him. I was almost everything, remove (almost say because it might be something I missed, because it's huge project) but still the long process.

    That I created empty swf (new project without code and nothing in it) and tried to integrate and to see what is happening. It was just the same...

    Then I thought again Air SDK may have solved this problem, so I've updated SDK for 19.0.0.207 currently more recent, but still nothing, even if the process now increases above.

    I think that it comes to Flash gc. One of the solutions is to have one and only instance of swf external and removeChild and addChild it whenever you need. It is a bad way to do it. Process will not increase all the time, but in my case I have many SWFs to load and it will slow down my request for computers of RAM low resources it could cause the crash and it is bad to have unnecessary things running in the background process

    so any suggestions are welcome

    No need to stop the video clips and remove... use unloadAndStop() and it will all stop and unload the file... as it is not possible to call the content of charger (clips) stop after the unload method, it is already removed... So, try to use only 3 lines only to unload the file.

  • Externally loaded SWF X & amp; Position Y

    I spent the last 2 hours looking for this forum for a solution to my problem. I read more than 20 topics and tried all... nothing works.

    My problem:

    I have a file that uses the following script to load another swf SWF:

    loadMovieNum("Base/BASE_ALL.swf",2);

    I would like to place the "BASE_ALL.swf" exactly 100pixels from the top edge of the scene. The 'BASE_ALL.swf' is w786 by h503, while my "container.swf" is by h603 w786.
    As you might guess, my problem lies in the fact that no matter what I try, I can't force the "BASE_ALL.swf" to load and reposition FLF = 100. It's very frustrating because I'm sure that the answer is simple...

    Could someone help?

    (More info: the 'BASE_ALL.swf' load externally many other SWF files that the user clicks on the menu - it is a Web site.) All these files are by h503 w786. The only file that is h603 is 'container.swf '. The 'container.swf' is biggest 100px to allow space for a company logo that will be visible when the user accesses within the site.)

    If you have been load lines.swf and nav.swf and main.swf in a BASE_ALL.swf, then by positioning BASE_ALL.swf would position the loaded SWF.

    but these sovereign wealth funds are not loading in BASE_ALL.swf. they charge in _levels. and _levels do not inherit anything from the swf that causes their existence.

    Thus, you should use preloader code to ensure your _levels exist and when they do, you can position the _levels.

    Therefore, in container.swf, you can remove all of the code except the code that loads BASE_ALL.swf. and in BASE_ALL.swf you can use:

  • External loading swf problem

    Hello

    I think it's my last stop to find the answer to my problem

    I made a simple project with flash CS5 that contain

    main SWF that load an external swf into movie empty

    I was able to load external swf everything smoothly but

    Problem

    the external swf file has drag-and - déposer only work perfect, but when it is called stops working

    external text in swf input do not work as when he called

    I scoured the net for a week and that you can't find the answer

    Pllllllllllllllllllllllease help

    Thanks in advance

    The loaded file using _root references?  If so, you must set the _lockroot true inside this file property so that it does not seek beyond itself to the _root of the file that it loads.  If you are not familiar with it, it is documented in the help files for Flash with examples.

  • HTML and external loaded SWF

    I have a Flash movie where I'm loading external SWF. When I saw Flash, it works very well. When I publish to HTML (from Flash), it works fine. When I'm trying to integrate my Flash animation in a different HTML page using Dreamweaver, load external files. I made this a hundred times in the past, but I'm having this problem with a few different Flash movies - that those who are responsible for external content - ideas?

    Looks like he had a security problem between local files and files on the network. Once I downloaded everything, it seems to work very well - what a pain to have to download whenever you want to post something works properly...

  • How to add listeners for the external loaded swf files?

    IAM loading external .swf file in the file main.swf.

    IAM dispatchEvent (new Event ("loaded")) of external .swf.

    How to add the listener for the event "loaded"?

    in your swf file main something like below:

    mcExt.addEventListener ("load", onCongratsClose);

    function onCongratsClose(e:Event):void {}
    Your code

    }

  • to access the variables and functions between external loaded SWF?

    Using AS 3.0: say I have a menu.swf which loads a content.swf below using the following

    var newContent:Loader = new Loader();
    newContent.load (new URLRequest ("fowContent.swf"));
    addChildAt(newContent,0);

    Now I have an image tag in newContent do it is an animation ending to this swf display. When you click another menu key in menu.swf, can I access sequence at the end of this content by:

    newContent.gotoAndPlay (newContent.endingSequence);

    Alternatively, you can use while loops in AS 3.0? I would like to have a Boolean variable "completed" in the newContent don't which evaluates to true after that end animation played.



    While (newContent.ended! = true)
    {
    wait
    }

    then to have it perform the function to load and display the new content.swf

    :

    PS you can not use a loop for and you can't use a while loop to perform any time. They both run from end to end before something is updated on stage and no other code can run outside of these loops (except if it is called from in the loop).

  • latest and greatest: conditional statements for referring to the loaded swf format click

    Good forum,

    I'm so close indeed with this update of the site, it's exciting! I'll be sure to throw it here for you to see, because without this forum I was wrong!

    The last big hurdle I have, is this, and I hope that someone can just throw me a bit of advice on this.

    I'm looking for a way to write a function, that the click on my button 'next' in the script, made reference to my loaded swf MovieClip (imageLoader.content) he said to go to the next image tag, so really a compound if/then situation - simply evoking the loaded file throws me.

    So, my next button is 'pNext', and what I'm looking for something in the sense of is:

    If (loaded film) is on frames 12-144, then go here (click).

    If (loaded film) is on the 144-155 frames, then submitted here (click)

    etc. etc.

    Thank you very much! Here is my code that works on one click Next, so you can see bodies etc.

    b

    pNext.addEventListener (MouseEvent.CLICK, nextClick);

    function nextClick (e:MouseEvent): void {}
    MovieClip (imageLoader.content) .gotoAndPlay ('aboutS1');
    }

    If I'm just reading your request, what you can try is to create a table of image tags in the order they appear and use the currentLabel property to determine where you are and indicate where to go...

    var labels: Array = new Array("one","two","three","four","five"...etc...);

    pNext.addEventListener (MouseEvent.CLICK, nextClick);

    function nextClick (e:MouseEvent): void {}
    var mc:MovieClip = MovieClip (imageLoader.content);
    var nextLabel:String = labels [labels.indexOf (String (mc.currentLabel)) + 1];
    mc.gotoAndPlay (nextLabel);
    }

  • Events and loaded SWF

    Hi all

    I have an app built with Flex 3, which is in charge of various swf files.  Some of the SWFs have buttons.  The main flex application has an event listener for mouse events.  The effect click on the main application is to display a grudge at the location of the mouse. This sprite is then removed after a short delay. What happens is the below button sprite blocks and prevents the reception of the click event.  I'm looking for a technique to treat this completely in the application main flex. Any ideas?

    That should happen is the following:

    1. User clicks on a main application
    2. Sprite appears and is deleted automatically after about 1/2 second
    3. At the same time, the click event happened in the loaded swf file so it can respond.

    What is happening now is the following:

    1. the user clicks on the main application
    2. Sprite appears and is deleted automatically
    3. loaded SWF does not define this event unless the mouse action (IE physically lift the mouse button) is deferred until the sprite is removed.

    As a click of the mouse is really a mouse, an event, the sprite receives the mouse upwards and is not in him the way.  I have a mouse listener on the sprite, but I have to do?  I can issue a new mouse event of this method of earphone? I can but the sprite will receive once again and I'm in a loop.  Do I have to remove the mouse listener, deliver the mouse up to the event, then wait, and then add the listener.  This seems a bit awkward!

    Thank you

    Jeff

    If the temporary sprite a buttonMode = mouseEnabled = mouseChildren = false, it shouldn't block the activity of the mouse to the button located below

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • Calling functions / set variables in loaded SWF

    You know how you can create a Movieclip object, add a function or a variable, and then call this function or change this variable to the SWF file that includes? I want to be able to do it, only with SWFs that are loaded at run time.

    My "main" SWF is just something the type of menu. The user clicks a button in my HAND. SWF and the HAND. SWF and then load the SWF associated with this button, using the AS 3.0 method Loader () - URLRequest () - addChild () that everyone always asks questions on prescribed.

    It works very well. But now I have a few custom and other objects (ie., not only the channels) in my HAND. SWF I want power sharing with the loaded SWF files. preferably, I'd use a function of the type of accessor (ie., LoadedSWF.GiveMeTheCoolObject (MyCoolObject)); Although at this point, I'm willing to hack the object itself (ie., LoadedSWF.CoolObject.CoolField = MyCoolObject.CoolField ;) if that's what it takes.

    I tried to call the functions and setting the fields, but the AS 3.0 compiler doesn't care for this kind of nonsense on its objects defined by the generically. Also note that, at runtime, a call to LoadedSWF.hasOwnObject ("GiveMeTheCoolObject") returns true.

    So my colleagues big brain, what is the magic?

    In advance, thank you for the help!
    Scott

    Kglad,

    Quote:
    Posted by: kglad
    the error message, seems, your function expects a member of the class MyCoolObject, correct?
    and MyCoolObject is not an instance of this class. so, you have to fix that. That is to say, create a member of this class, and use this class as a parameter of the function member.

    Heh, that's what the error message says all right. But the object IS actually an object of class MyCoolObject. I looked at this thing for hours and MyCoolObject IS an instance of this class. I tried different combinations of casting (including the cast on an object and passing that) but had no luck whatsoever.

    So I googled this particular runtime error message ("Error #1034: has no Type constraint: cannot convert '" ") and found a ton of links to other people with a similar problem. As a general rule, the problem was just as you say, someone passes a button as a string, that kinda thing. But a guy had a problem with an object that it has derived from the event class. Once the hours spent trying to make it work, he has tried to override clone() of the base class method and got it to work:

    http://www.assertTrue.com/articles/2006/10/14/custom-events-in-ActionScript-3-0

    As for my project, I took a long, hard look at the overall architecture of my project and decided it would be better if all the 'real work' is held in the HAND. SWF file. This approach would solve some other problems, and it makes sense in a mindset of "separating the display of data.

    If (and this is the interesting part) I changed the API for the LOADED. SWF to accept the pairs of strings (ie., LoadedSWF.AddToDisplay (String Name, String Data)) rather than accept MyCoolObj. Ran and Viola, now we work without any throw exceptions in. After this moment of glory, I created a couple of other APIs that comes from base classes (a type int, the other a type function) agreed and was happily on my way.

    On this basis, I understand while passing another base class objects (IE, the derived class) to load MovieClips via custom function API is... perhaps not so simple you'd expect. In the grand scheme of things well, not a big deal: as far as I'm concerned AS3 rocks.

    Kglad, thanks again for all the help: your comments on how this was the big push that I needed to get through the last barrier of this project.

    For those who read this topic for the ' how to call functions or set variables in a loaded SWF file?

    The short answer is cast to the SWF file that is loaded as a MovieClip content object and then call the function or change the variable:

    Load the SWF file (you saw this code a million times)
    var LoadedSWFObj:Loader = new Loader();
    var MyURL:URLRequest = new URLRequest("LoadThisSWF.SWF");
    LoadedSWFObj.load (MyURL);

    It is within your Event.COMPLETE Manager:

    Cast as a MovieClip object and work with it.
    var LoadedSWF:MovieClip = LoadedSWFObj.content as MovieClip;

    or another way to perform a cast:
    var LoadedSWF:MovieClip = MovieClip (LoadedSWFObj.content);

    Call yer function:
    LoadedSWF.CallMe ();

Maybe you are looking for