External SWF Parent??

hello there guys..,
i need help in understanding external swf parent,let me describe it a little more about what i mean:
"is it by default when we load and external swf and eventhought we add it as a child of container (an instance of sprite class which we create and then add it to the stage) that the parent of that loaded swf is stage??? "
i do ask this question because i tried to load an external swf and then add it to the container but when i trace it the loaded swf does not count as the child of the container but the stage (i do this by tracing the stage.numChildren and container.numChildren)
thanks for your time and your help..,
i do appreciate any help greatly..,

if you load a swf (using the loader class), the swf is a child of the loader and the swf's parent is the loader.
if you add the loader to the displaylist, then the loaded swf's parent.parent is a displaylist object.

Similar Messages

  • FAQ: How do I load an external SWF file into a parent SWF file?

    A ton of Flash users visit Adobe’s we site every month wondering  about how to load an external SWF file from within another SWF.
    Adobe's own TechNote on the subject attempts to answer the basic question, along with some common follow-up questions, including:
    How do I load more than one SWF?
    How do I load a SWF into a specific location in the display list?
    How do I resize the loaded SWF?
    How do I set its X and Y location?
    Here are some additional resources that elaborate on loading content and on working with the display list:
    Sample files for the above TechNote. A set of 3 FLA and 3 corresponding SWF files, including a parent SWF and 2 SWFs that the parent loads.
    Help > AS3 Developer’s Guide > Loading an external SWF file
    Help > AS3 Developer’s Guide > Loading display content dynamically
    Loading multiple external SWFs within a main SWF – CreativeCow.net forums
    Video tutorial: ActionScript 101 – Episode 6: Adding named objects to the Stage. By Doug Winnie. An example of how to add the loaded external asset to the Stage and modify its location or other properties.
    Video tutorial: Preloading in ActionScript 3.0.  By Lee Brimelow. A slightly more complicated example, showing how to  make the parent SWF display information about the progress of loading  the external SWF.
    Tutorial: Loading and unloading SWFs - FlashAndMath.com
    This article provides several examples of how to communicate between a parent SWF file and the loaded SWF:
    SWF to SWF Communcation via ActionScript 3.0 (by kglad)

    quote:
    Originally posted by:
    NedWebs
    You now seem to want to get rid of the swf once it has loaded
    and played itself thru. To do that you would need to have something
    in the swf itself that triggers its removal in its last frame. The
    following might work...
    MovieClip(this.parent).removeChild(this);
    Unfortunately I couldn't get this to work. I placed it on the
    last frame of the SWF to be called - is that right?
    I am not sure I am doing it correctly...

  • Loading an external swf and unloading the parent one

    Hi there i have made a navigation in flash and 3 buttons that load some external swf's. Problem is that when they load the parent swf keeps playing in the background. How can i make them play separately and make the navigation stage dissapear completely when they load?

    I have attempted to use the same Loader but it doesnt replace it i dont know why.
    var myLoader:Loader = new Loader();       
    var myLoaderMain:URLRequest = new URLRequest("main1.swf");
    var myLoaderQuiz:URLRequest = new URLRequest("quiz.swf");
    var myLoaderAnimation:URLRequest = new URLRequest("athens_animation.swf");
    var myLoaderVideo:URLRequest = new URLRequest("videogallery.swf");
    videogallerybtn.addEventListener(MouseEvent.CLICK, videoFunc);
    function videoFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderVideo);
              addChild(myLoader);
    Quizbtn.addEventListener(MouseEvent.CLICK, quizFunc);
    function quizFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderQuiz);
              addChild(myLoader);
    Animationbtn.addEventListener(MouseEvent.CLICK, AnimationFunc);
    function AnimationFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderAnimation);
              addChild(myLoader);

  • Loading an external swf into my parent swf?

    Does anyone know how I can load an external .swf file into my
    parent file? I have tried to use loader actionscript but think I am
    using the incorrect script or putting it in the wrong place? If
    anyone can tell me the script and where to/how to use it that would
    be amazing? Thanks

    thanks GWD!
    I am using the unloadMovieNum(); command, i have loaded the
    child into level 5 of my parent swf. the parent has multiple scenes
    this one with a layer with a stop(); action and another layer with
    the loadMovieNum("portfolioone.swf", 5); script. it loads the child
    perfectly. The child has a number of pictures in it and a back
    button at the end. I have been adding the
    on (release) {
    unloadMovieNum(5);
    script to the button which unloads the child but stops
    because of the stop action in the first frame of the particular
    scene within the parent. I want to be able to add a script to this
    button which will take me back to a labeled frame in a particular
    scene of the parent, I tried the this.removeMovieClip(); but
    doesn't seem to be working for me, Thanks for the reply, hope you
    can help me further??

  • Enabling Parent button while external swf is loaded [AS3]

    Hello everyone,
    I am very new to Flash and it takes me a while to understand what code is trying to tell me
    The problem I am currently facing is as follows:
    After searching the net for hours I finally figured out, how to load an external swf into my main timeline. As far as I understand this main timeline is the "parent". Hence the loaded, external swf should be the "child" (a quiz).
    Now the child (a quiz) loads into the flash file and is played properly, but I cannot access the button on the parent anymore. Unfortunately, I really need the home button on the parent to exit the quiz and allow for new navigation within the flash document.
    I would greatly appreciate any help.
    Thank you all in advance.
    Kliph
    my AS3 Code:
    import flash.events.MouseEvent;
    function onClick611 (event:MouseEvent) :void
            gotoAndPlay("home_einf")
    home_btn.addEventListener (MouseEvent.CLICK, onClick611);
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.events.Event;
    import flash.events.ProgressEvent;
    function startLoad()
        var mLoader:Loader = new Loader();
        var mRequest:URLRequest = new URLRequest("quiz.swf");
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
    mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
    mLoader.load(mRequest);
    function onCompleteHandler(loadEvent:Event)
    addChild(loadEvent.currentTarget.content);
        function onProgressHandler(mProgress:ProgressEvent)
        var percent:Number = mProgress.bytesLoaded/mProgress.bytesTotal;
    trace(percent);
    startLoad();
    stop();

    By simply using addChild like you have, you're placing the loaded content above everything on the display list - covering your button. There are a few ways to solve. The easiest, if it works for you, is to just make a new layer in your timeline - make it the top most layer, and place your home button in that layer.
    Then change your addChild line from:
    addChild(loadEvent.currentTarget.content);
    to:
    addChildAt(loadEvent.currentTarget.content, numChildren - 2);
    This will place the loaded content behind the button.
    Alternatively, you can set the button to export for AS and then add it after you add the loaded file. Or you can use content containers - empty sprites that you add first, and then fill with other objects, in order to control layering.

  • Loading an external SWF from an external SWF

    Hello,
    I'm somewhat caught between a rock and a hard spot on a flash
    site project. Here is the situation:
    I have created a parent movie (which loads all external SWFs
    inside of it) that has the menu navigation built into it. However,
    my client wants me to place some more links inside of the external
    SWFs that lead to other pages (external SWFs) of the site. Is this
    at all possible? I was hoping there is a way to tell a button in an
    external SWF to make the parent movie switch between external SWFs.
    Any and ALL help is very much appreciated. Thank you.
    Another question: does this involve using the _parent script?
    Elijah

    Hello,
    Thank you for replying. Here is exactly what I'm needing to
    do:
    We will call the parent file "index.swf". Inside "index.swf"
    I have a "holder" for external swf files to load into when I call
    on them from the main menu buttons on "index.swf". When a customer
    comes to the site, the "index.swf" file initially loads
    "welcome.swf". Inside of "welcome.swf", I have some images that I
    want to make into links to other external swf files.
    My problem is when someone clicks on one of those pictures I
    want the "index.swf" file to open up the corresponding external swf
    file in its "holder", where "welcome.swf" currently resides. Also,
    all of these swf files ("index.swf" included) have stand-alone FLA
    files, none are attached to one another. I have never worked with
    "levels" before, would that be necessary in this case? I have
    attached the code for the external swf loader.
    I hope that gives you a better idea of what I'm trying to
    accomplish.
    Thanks again.
    Elijah
    CODE:

  • Unloading a loaded external SWF with a close button on the external SWF to unload

    I have found some discussion on this topic but I am still having trouble getting it to work and was hoping to get some help here.
    Here I have a file: http://www.dril-quip.com/test/main.swf
    I have: main.swf (a menu) and I have module.swf (content)
    If you navigate to Subsea Wellhead Systems/SS-15 BigBore II and click on that I have it load an external swf which covers most of the parent.
    So far so good. My problem is unloading the loaded 'Child' swf with the button provided on the loaded 'Child' swf.
    below is the code I used to load the file but I cant, for the life of me, find a way to unload it.
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    I am certain it requires the Child to communicate with the parent somehow but I am at a loss. If I could get a bit of advice or a link to something deal with this, it would be a big help. I just need to have my links load my modules and the remove them when the close buttong is hit on the loaded swf. I promise I have done searches and I admit I have found asnwers but still they are not working. I found the code below:
    Main FLA:
    function removeF() {
    removeChild(bigboreLoader);
    var bigboreLoader:Loader = new Loader();
    btnbb2.addEventListener(MouseEvent.MOUSE_UP, bigborecontent);
    function bigborecontent(event:MouseEvent):void{
    var bigboreRequest:URLRequest = new URLRequest("moduletemplate.swf");
    bigboreLoader.load(bigboreRequest);
    stage.addChild(bigboreLoader);
    EXTERNAL FLA:
    btnClose2.addEventListener(MouseEvent.CLICK, bigborecontent);
    function bigborecontent(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    I think I have a misunderstanding of the code. Thanks for any help you might be able to provide.

    This was the original code I got:
    Main FLA: (on AS layer inside DropDownButton Movie Object)
    function removeF() {
    removeChild(myLoader);
    var myLoader:Loader=new Loader ();
    page1_mc.addEventListener(MouseEvent.CLICK, page1content);
    function page1content(myevent:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("page1.swf");
    myLoader.load(myURL);
    addChild(myLoader);
    EXTERNAL FLA: (on main time line of this file)
    close_mc.addEventListener(MouseEvent.CLICK, closeMC);
    function closeMC(myevent:MouseEvent):void {
    MovieClip(parent.parent).removeF();
    Main.FLA
    myLoader=bigboreLoader (my new loader)
    page1_mc=btnbb2 (the button who event will call external swf)
    page1content = bigborecontent (name given to SWF being loaded???)
    myURL=bigboreRequest (my new URLrequest for bigbore)
    page1.swf=moduletemplate.swf (actual address of what I am loading)
    External.FLA
    close_mc=button that will close external swf
    closeMC=movie clip to close?

  • Loaded external swfs with transitions

    I need help getting my loaded swf files to play the "out" transition before the next movie loads. I have a main swf with 5 buttons (movie clips) that load external swf onto the stage.
    package
        import flash.display.MovieClip;
        import flash.display.SimpleButton;
        import flash.display.Loader;
        import flash.net.URLRequest;
        import flash.events.MouseEvent;
        import flash.events.*;
        public class V2 extends MovieClip
            private var sections_array:Array;
            private var section_buttons_array:Array;
            private var loader:Loader;
            private var sectionHolder  : MovieClip;
            private var swf:String;
            private var currentSection:int=0;
            private var nextSection:int;
            private var id:int=0;
            private var homeLoc = "./swfs/home.swf";
            public function V2()
                init();
            private function init():void
                stop();
                stage.frameRate=31;
                preloader_mc.visible=false;
                preloader_mc.fill_mc.width=0;
                sectionHolder = new MovieClip();
                sectionHolder.x = 37;
                sectionHolder.y = 42;
                addChild( sectionHolder );
                sections_array = new Array('./swfs/section1.swf',
                './swfs/section2.swf',
                './swfs/section3.swf',
                './swfs/section4.swf',
                './swfs/section5.swf');
                section_buttons_array = new Array(btn1,btn2,btn3,btn4,btn5);
                addMenuListener();
                addMenuEvents();
                loadHome();
            private function addMenuListener():void
                for(var i:int=0;i < section_buttons_array.length;i++)
                    section_buttons_array[i].id=i;
                    section_buttons_array[i].addEventListener(MouseEvent.MOUSE_DOWN,loadSectionHand ler);
            private function loadHome():void
                swf=homeLoc;//sections_array[0];
                var request:URLRequest=new URLRequest(swf);
                loader=new Loader();
                initListeners(loader.contentLoaderInfo);
                loader.load(request);
                id=0;
            private function changeSection(m:MouseEvent):void
                id=m.currentTarget.id+1;
                loader.unload();
                sectionHolder.removeChild(loader);
                removeListeners(loader.contentLoaderInfo);
                loadSection(m.target.parent.id+1);
            private function loadSectionHandler(evt:MouseEvent)
                id = evt.currentTarget.id;
                loadSection(id);
            private function loadSection(n:int):void
                swf=sections_array[id];
                var request:URLRequest=new URLRequest(swf);
                initListeners(loader.contentLoaderInfo);
                loader.load(request);
            private function initListeners(dispatcher:IEventDispatcher):void
                dispatcher.addEventListener(Event.OPEN,start);
                dispatcher.addEventListener(ProgressEvent.PROGRESS,atLoading);
                dispatcher.addEventListener(Event.COMPLETE,completed);
            private function removeListeners(dispatcher:IEventDispatcher):void
                dispatcher.removeEventListener(Event.OPEN,start);
                dispatcher.removeEventListener(ProgressEvent.PROGRESS,atLoading);
                dispatcher.removeEventListener(Event.COMPLETE,completed);
            private function start(event:Event):void
                preloader_mc.visible=true;
            private function atLoading(event:ProgressEvent):void
                var n:uint=(event.bytesLoaded/event.bytesTotal)*100;
                preloader_mc.fill_mc.width=n;
               private function completed(event:Event):void
                sectionHolder.addChild(loader); 
                preloader_mc.visible=false;
            private function stopAll():void
                for(var i:int=0;i < section_buttons_array.length;i++)
                    section_buttons_array[i].stop();
                    sections_array[i].stop();
            private function addMenuEvents():void
                for(var i:int=0;i < section_buttons_array.length;i++)
                    section_buttons_array[i].mouseChildren=false;
                    section_buttons_array[i].buttonMode=true;
                    section_buttons_array[i].id=i;
                    section_buttons_array[i].isPressed=false;
                    section_buttons_array[i].addEventListener(MouseEvent.MOUSE_OVER,setOver);
                    section_buttons_array[i].addEventListener(MouseEvent.MOUSE_OUT,setOut);
                    section_buttons_array[i].addEventListener(MouseEvent.MOUSE_DOWN,setDown);
                    section_buttons_array[i].addEventListener(MouseEvent.MOUSE_UP,setUp);
            private function setOver(evt:MouseEvent):void
                if(evt.target.isPressed==false)
                    evt.target.gotoAndStop(2);
            private function setOut(evt:MouseEvent):void
                if(evt.target.isPressed==false)
                    evt.target.gotoAndStop(1);
            private function setDown(evt:MouseEvent):void
                nextSection=evt.target.id;
                checkState(evt.target.id);
                evt.target.gotoAndStop(3);
                loadSection(1);
                currentSection=evt.target.id;
            private function setUp(evt:MouseEvent):void
                if(evt.target.isPressed==false)
                    evt.target.gotoAndStop(1);
            private function checkState(n:int):void
                for(var i:int=0;i < section_buttons_array.length;i++)
                    if(i==n)
                        section_buttons_array[i].isPressed=true;
                    else
                        section_buttons_array[i].isPressed=false;
                        section_buttons_array[i].gotoAndStop(1);
            private function removeSWF(e:Event):void
                loader.unload();
                removeEventListener("removeMe", removeSWF);
                var request:URLRequest = new URLRequest(swf);
                loader.load(request);
            private function onClick(e:MouseEvent):void
            targetID = e.currentTarget.id;
            addEventListener("removeMe", removeSWF);
            MovieClip(loader.content).play();
            private function removeSWF(e:Event):void
            loader.unload();
            removeEventListener("removeMe", removeSWF);
    The loaded swf has a stop() an intro animation and on the last frame have.
    dispatchEvent(new Event("removeMe", true));

    your isse begins here ..
    loadSection()
    you use the same loader to not only load files but you are tyring to use it to target the movieClip you also want to play.
    The issue is loader.  The loader can only reference one load at a time.. otherwise you screw up your listeners and the ability to unload files properly.
    You should load all files in Your current system as its own variable so that while one loads you can still control a movie.
    So what type of end transitions do your files have?
    What exactly with this seems like youre getting an issue.. looking at it looks alright aside from the fact that some methods are not used at all by your class

  • External SWF Disappears on Browser resize

    I am loading external swf's inside content_2 and when i resize my browser the external content OR content_2 disappears. Can someone help me as to what I need to do to stop this. I've tried adding an onresize function but that does not work. Here my as3 code:
    scroll_sb2.scrolling("content_2", "area_2", 0.18); // Range from 0.00 to 1.00
    stage.addEventListener(Event.RESIZE, resizeHandler);
    function resizeHandler(e:Event):void
    scroll_sb2.x = stage.stageWidth - scroll_sb2.width - 2;
    scroll_sb2.y = 0;
    scroll_sb2.height = stage.stageHeight;
    area_2.x = stage.stageWidth/2 - area_2.width/2;
    area_2.y = stage.stageHeight/2 - area_2.height/2;
    area_2.y = 0;
    area_2.height = stage.stageHeight;
    content_2.x = stage.stageWidth/2 - content_2.width/2;
    content_2.y = stage.stageHeight - content_2.height;  // comment this line if you whant to remove the carrusel affect on resize browser
    backgroundMC.x=0;
    backgroundMC.y=0;
    backgroundMC.width=stage.stageWidth;
    backgroundMC.height=stage.stageHeight;
    downbg_mc.x = 0;
    downbg_mc.y = 0;
    downbg_mc.width = stage.stageWidth;
    stage.align = StageAlign.TOP_LEFT;     
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.dispatchEvent(new Event(Event.RESIZE));
    var mem:String = Number ( System.totalMemory / 2048 / 2048 ).toFixed ( 2 ) + 'Mb';
    trace ( mem ); 

    Guys can you PLZZZ Help me out with this. I've been researching this ALL day with no solution, I'v
    e posted this in THREE forums and I havent gotten ONE response. Plz assist me!
    ALSO..This is the action script that's in my scrollbar movie:
    var sd:Number;
    var sr:Number;
    var cd:Number;
    var cr:Number;
    var new_y:Number;
    var drag_area:Rectangle;
    var scroll_content:MovieClip;
    var scroll_content_area:MovieClip;
    var scrolling_speed:Number; // 0.00 to 1.00
    //.............. SCROLL BUTTON .............//
    scroll_scroller.buttonMode = true;
    addEventListener ( MouseEvent.MOUSE_OVER, mouse_over );
    addEventListener ( MouseEvent.MOUSE_OUT, mouse_out );
    function mouse_over ( event:MouseEvent ) {
      scroll_scroller.alpha = 0.7;
    function mouse_out ( event:MouseEvent ) {
      scroll_scroller.alpha = 1;
    //.............. END scroll button...........//
    function scrolling( ct:String, ct_area:String, speed:Number ):void
    scrolling_speed = speed;
    if( scrolling_speed < 0 || scrolling_speed > 1 ) scrolling_speed = 0.50;
    scroll_content = parent[ct];
    scroll_content_area = parent[ct_area];
    scroll_content.mask = scroll_content_area;
    scroll_content.x = scroll_content_area.x;
    scroll_content.y = scroll_content_area.y;
    scroll_scroller.x = scroll_scrollable_area.x;
    scroll_scroller.y = scroll_scrollable_area.y;
    sr = scroll_content_area.height / scroll_content.height;
    scroll_scroller.height = scroll_scrollable_area.height * sr;
    sd = scroll_scrollable_area.height - scroll_scroller.height;
    cd = scroll_content.height - scroll_content_area.height;
    cr = cd / sd * 1.01;
    drag_area = new Rectangle( 0, 0, 0,scroll_scrollable_area.height -  scroll_scroller.height );
    if ( scroll_content.height <= scroll_content_area.height )
      scroll_scroller.visible = scroll_scrollable_area.visible = false;
    scroll_scroller.addEventListener( MouseEvent.MOUSE_DOWN, scroller_drag );
    scroll_scroller.addEventListener( MouseEvent.MOUSE_UP, scroller_drop );
    this.addEventListener( Event.ENTER_FRAME, on_scroll );
    function scroller_drag( me:MouseEvent ):void
    me.target.startDrag(false, drag_area);
    stage.addEventListener(MouseEvent.MOUSE_UP, up);
    function scroller_drop( me:MouseEvent ):void
    me.target.stopDrag();
    stage.removeEventListener(MouseEvent.MOUSE_UP, up);
    function up( me:MouseEvent ):void
    scroll_scroller.stopDrag();
    function on_scroll( e:Event ):void
    new_y = scroll_content_area.y + scroll_scrollable_area.y * cr - scroll_scroller.y  * cr;
    scroll_content.y += ( new_y - scroll_content.y ) * scrolling_speed;
    // END

  • What happens when the Main Flash is 25 fps and an external SWF file is 12 fps?

    Hello everyone,
    I have a Main Flash which is set to 25 fps. This Flash is
    used to load an external swf file which was created using 12 fps. I
    would like to know what really happens when the Main Flash loads
    the external swf file? Does the Main file forces the external file
    to be run on 25 fps or the swf file is run with its own 12 fps?
    Any ways, if someone can take the time and explain this, I
    would be greatful.
    Thank you very much and have a great day.
    Khoramdin

    the external swf plays at 25fps - all loaded movies will take
    on the frame rate of the parent movie.
    Chris Georgenes
    Adobe Community Expert
    mudbubble.com
    keyframer.com
    http://tinyurl.com/2urlka
    Khoramdin wrote:
    > Hello everyone,
    >
    > I have a Main Flash which is set to 25 fps. This Flash
    is used to load an
    > external swf file which was created using 12 fps. I
    would like to know what
    > really happens when the Main Flash loads the external
    swf file? Does the Main
    > file forces the external file to be run on 25 fps or the
    swf file is run with
    > its own 12 fps?
    >
    > Any ways, if someone can take the time and explain this,
    I would be greatful.
    >
    > Thank you very much and have a great day.
    >
    > Khoramdin
    >

  • Dispatching Events - External SWF & Main Stage

    Hi Everyone
    I am dispatching two different events showbutton and removebutton from the code inside the LOADED SWF.
    on main file, (the one that is loading the swf file) i m listening for events and either showing or removing the
    buttons based on proper scenario. Here is he error i m getting. I appreciate if someone can help me understand
    the problem thanks.
    ERROR   1180  Call to a possibly undefined Method Event   - - - > dispatchEvent(new Event("showbutton"));
    -----------------EXTERNAL SWF -----------------
    dispatchEvent(new Event("removebutton"));
    dispatchEvent(new Event("showbutton"));
    -----------------MAIN STAGE-----------------------
    movieLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderCompleteHandler)
    function loaderCompleteHandler(event:Event) {
        (event.currentTarget.content as MovieClip).addEventListener("removebutton", categoryClickHandler);
        (event.currentTarget.content as MovieClip).addEventListener("showbutton", categoryClickHandler2);
    function categoryClickHandler(event:Event):void {
        alaarm.visible=false
    function categoryClickHandler2(event:Event):void {
        alaarm.visible=true
        trace("yohoo");

    MathAdor,
    Have you considered solutions that don't involve event handlers available to AS3.
    If I understand correctly you are trying to:
    1.  Control buttons that exist in your main .swf file
    2.  Control the visibility of those buttons from a child .swf called into existence from the main .swf file
    You could control this completely from the child .swf by setting a variable for your parent .swf
    In your child .swf creat a variable that contains the parent movieclip:
    var myParentClip:MovieClip = MovieClip(parent.parent);
    Now control your buttons with the appropriate command from your child
    myParentClip.buttonName.visible = true;
    myParentClip.buttonName.visible = false;
    Total control from your child .swf
    Hope this helps

  • Remove external swf file

    I have loaded an external swf file which plays a flv file by default as swf is loaded. Now the problem is how do i remove the swf file from memory. my code :
        var myLoader:Loader = new Loader();                    
        var url:URLRequest = new URLRequest("ExternalSWF.swf"); 
        myLoader.load(url);                                    
        detailMovieClip.movieHolder.addChild(myLoader);
    I have tried many combinations of removeChild, unload and unloadAndStop but none works. I figure its all about not referencing correctly.

    Hi Jah,
    i understood your problem,i faced this problem many time but couldn't find correct solution.
    I'm using now Event.REMOVED_FROM_STAGE. this method dispatch to parent swf for when the External swf removed from stage.
    The sample example code below for the way of remove externalswf events:
    parent swf actionscript code:
    import flash.events.MouseEvent;
    var myLoader:Loader = new Loader();                   
    var url:URLRequest = new URLRequest("ExternalSWF.swf");
    myLoader.load(url);                                   
    b_mc.addChild(myLoader);
    a_mc.addEventListener(MouseEvent.CLICK,onClick);
    function onClick(event:MouseEvent):void
        a_mc.removeEventListener(MouseEvent.CLICK,onClick);
        myLoader.unload();
        b_mc.removeChild(myLoader);
        myLoader=null;
    ExternalSWF.swf actionscript code:
    import flash.events.Event;
    var num:Number=0;
    addEventListener(Event.ENTER_FRAME,onRun);
    addEventListener(Event.REMOVED_FROM_STAGE,onRemoveFromParent);
    // remove all local events here//
    function onRemoveFromParent(event:Event):void
        trace("remove");
        removeEventListener(Event.ENTER_FRAME,onRun);
    function onRun(event:Event):void
        num++;
        trace(num);
    Thanks/

  • Access a component inside external swf file

    Hi, I loaded a external swf file that it is a dialog.
    var swfLoader : Loader = new Loader();
    var swfURL : URLRequest = new URLRequest("dialog.swf");
    swfLoader.load(swfURL);
    swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imgLoaded);
    function imgLoaded(event:Event):void
    var movie : * = swfLoader.content;
    var clip : MovieClip = movie;
    parent.addChild(clip);
    Now, inside the movieClip there is a TextField component
    named message that i want to change its 'text' property.
    The question is: How can i access to this property to change
    it?
    Regards

    okay,
    I have the image component in ProductCatalogThumbnail.mxml, which has an id of "img"
    so, i created a public variable in the file and a public function that returns the value of the object.
    public var imagecopy:Object;
            [Bindable]
             public function imagecopyfunction():Object{
             imagecopy  = img;
             return imagecopy;
    now, I want to access this image in the mxml file ProductList.mxml in a function
      public function init():void
          ProductCatalogThumbnail.imagecopy.addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
         // accepting a drag/drop operation...
           this.area.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
           // handling the drop...
          //this.area.addEventListener( DragEvent.DRAG_DROP, handleDrop );
    I tried to use the variable, and then i tried to use the function:
    I got this error when I tried the variable : 1119: Access of possibly undefined property imagecopy through a reference with static type Class.
    ProductCatalogThumbnail.imagecopy.addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
    and this error when i tried the function:  1061: Call to a possibly undefined method imagecopyfunction through a reference with static type Class.
    ProductCatalogThumbnail.imagecopyfunction().addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
    i made sure i imported ProductCatalogThumbnail file in the beginning of my application.
    I am not sure what went wrong.

  • External .swf Intro ActionScript Problem

    I have used a loader component to load to an external .swf
    file (an intro animation). Once the external movie finishes playing
    I want my parent movie to move to a certain frame on my parent
    timeline. Nothing I try seems to work.

    So I could use the code that you provided in the timeline of
    the intro movie that I am loading into my main timeline?

  • External swf button to move main timeline

    Hi,
    i made a main(parent) page that loads an swf which has a button(a1) which on click i need it to move the timeline of the parent
    i wrote this code to the external swf and tryed many commands such as Object(root).gotoAndStop(1);
    a1.buttonMode = true;
    a1.addEventListener (MouseEvent.MOUSE_UP,a1a);
    function a1a(event:MouseEvent):void {
    what do i need to write inside to make it work?
    Thanks in advance

    try this:
    a1.buttonMode = true;
    a1.addEventListener (MouseEvent.MOUSE_UP,a1a);
    function a1a(event:MouseEvent):void {
    trace(a1.parent.parent.parent);
    trace(a1.parent.parent);
    //  find the right timeline , maybe with more parent.parent.... and then:
    MovieClip(a1.parent.parent.parent).gotoAndtop(10);

Maybe you are looking for

  • Mac OS X 10.6.8 Blocked plugin message - Adobe Flash player update???

    I am running on a MAC OS X 10.6.8 . After downloading successfully an adobe flash player 11.6.602.180 update for my MAC ( Safari). I now get an error message of Blocked plugin when watching   MOST youtube videos. It will play some youtube videos occa

  • Procedure for SSD boot drive in Mac Pro?

    I just purchased a 115GB SSD that I want to use as the boot drive in my Mac Pro running OS 10.6.8. I've read several articles about how to set this up but none seem to be working for me. On the SSD boot drive I want only the essentials: OS, Home Fold

  • Text Substitutions in Pages

    Text Substitutions in Pages only seems to work when you are typing.  How can I make it work on pasted text as well ? If I take the same text and paste it into TextEdit (with the same substitutions installed in Text/Language Preferences) it immediatel

  • Imovie shut down after 10 min work

    hello all, since 4 days i´m a owner of a macbook with 2 gb ram. i started working in imovie, creation of a holiday movie etc. after 10 to 20 min. work the programm shutdown. this happened several times! do you know what to do? please i need help! how

  • How to trunck the string

    hi one string is there of length 45 character, i want to do display upto 35 character on the window how we can do this?