Load SWF on stage with button

Hallo everybody,
I am a new Flash user so please forgive me if my question is
a bit "simple". I want to obtain a flash button that can load SWF
file on stage in a precise position without taking tha button
place. As example please click www.suit-e.de . I have read about
loadMovie e loadMovieNum but I do not not if I am in the right
place. Thank you

To do that you need to design the whole website using the
keyframes and some tweening technics, you dont really need much
complicated actionscript/loadmovie etc. Get to know alittle more
about tweening and using the keyframes plus imagination.
Good luck.

Similar Messages

  • Dynamically loaded swf to communicate with MovieClip on the stage

    I have a heck of time here with an issue. I have an xml document that when a certain button on the stage is clicked it loads it's corresponding external swf into an empty movieclip on the stage. This empty movie clip is a holder for all external swfs.
    So what I'm trying to do is when an external swf is loaded that has buttons on it, I need those buttons to communicate with the main timeline and remove a mc that is on the Stage. I need the currently loaded swf(s) to be able to do this. So whatever the currently loaded external swf is that's loaded, I need it to talk to the main timeline. (I have quite a few external swfs that need to do this) So I imagine I need to somehow target the currently loaded external swf to get it to talk to the main timeline.
    The code below in summary doesn't work but it doesn't give errors either. I don't pretend to know what I'm doing and I haven't been successful in searching for a solution to this particular issue. If someone could give me guidance or direct me to a solution. I'd so much appreciate it.
    // main timeline object
    var index:Object=this;
    function loadComplete (e:Event) {
            TweenMax.to(index.mcholder,1, {alpha: .5});
    // add the current module to the mcholder movieclip by using addChild
            index.mcholder.addChild(e.currentTarget.content);
           (e.currentTarget.content as MovieClip).addEventListener("eventTriggered", startListener);
    function startListener(e:Event):void {
    var ext_swf:MovieClip;
    ext_swf = e.currentTarget.content as MovieClip;
    trace("external swf");
    ext_swf.button1.addEventListener(MouseEvent.CLICK, talktomainswf);
    function talktomainswf():void {
    TweenMax.to(index.mc_thatsonthestage, 1, {x:1000});
    // now we have the first load we set firstLoad to false
            index.firstLoad = false;
        function loadError (e:Event) {
            trace("error");

    You can use the event dispatcher to communicate between external swfs and a main timeline,
    like so:
    //in an external swf
    //Once loaded
    function onLoadComplete(event:Event):void
         //dispatch an event in the form of a string
         dispatchEvent(new Event("Talk to Main Timeline")); 
    //On the Main timeline
    //listen for "Talk to Main Timeline"
    stage.addEventListener("Talk to Main Timeline", listenForCallsFromExternalFiles, true);
    //if the event is heard, do this:
    function listenForCallsFromExternalFiles(e:Event):void
         trace("I heard ya, now do stuff...");
    That's the basic idea anyways, I use it all the time.
    hope that helps,
    ~chipleh

  • Loading movie clip to stage with button click AS3

    I'm trying to figure out how to load a movie clip to the stage with a button click and have the movieclip close again using a close button. Does anyone have a step by step on how to do this or links to some tutorials.
    Below is an example of what I'm trying to do.

    Alrighty I changed the publish settings to as3. I'm still getting two errors:
    Scene 1
    1046: Type was not found or was not a compile-time constant: Popup1Btn.
    Scene 1, Layer 'as', Frame 1, Line 3
    1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
    So my setup on my main timeline is I have an actionscript layer with this code now:
    var popup1:Popup1
    Popup1Btn.addEventListener(MouseEvent.CLICK,addF);
    ClosePopup1.addEventListener(MouseEvent.CLICK,closeF);
    function addF(e:MouseEvent):void{
    popup1=new Popup1();
    addChild(popup1);
    function closeF(e:MouseEvent):void{
    removeChild(popup1);
    popup1=null;
    On the stage I have a button with the isntance/AS linkage name Popup1Btn. Inside my Popup1 MC I have a box with text and then a button with the instance/linkage name ClosePopup1 to close the popup.
    What am I missing?

  • Flushing loaded swfs from stage target mc?

    Hi, I'm using buttons to send the playhead to frames in which swfs are then loaded into an otherwise blank movieclip called "stage_target_mc" ...how can I then flush out the previously loaded swf so only a newly loaded swf displays in "stage_target_mc"?  For example, after clicking upon the 'about' button the 'about' swf loads...then if the 'concepts' button is clicked the 'concepts' swf loads -- but the previously loaded 'about' swf still plays...I would like to be able to flush the 'about' swf so only 'concepts' is display, in this example.  Thanks!
    code associated with buttons used to send playhead to frames "concepts" or "about":
    about_btn.addEventListener(MouseEvent.CLICK, displayAbout);
    function displayAbout(e:MouseEvent):void {
    root.gotoAndStop("about");
    concepts_btn.addEventListener(MouseEvent.CLICK, displayConcepts);
    function displayConcepts(e:MouseEvent):void {
    root.gotoAndStop("concepts");
    code on frame called "concepts":
    stage_target_loader.load(new URLRequest("swfs/stages/concepts.swf"));
    MovieClip(root).stage_target_mc.addChild(stage_target_loader);
    code on frame called "about":
    stage_target_loader.load(new URLRequest("swfs/stages/about.swf"));
    MovieClip(root).stage_target_mc.addChild(stage_target_loader);

    Before loading, try using the unloadAndStop() method of the Loader class if you are using a newr version of Flash

  • Allow loaded swf's communication with the internet

    Hi,
    I have an air application that is loading in swfs, the swfs then intern request data from internet.
    For example I have one swf thats loaded into the air application that requests data from the flickr api.
    But I keep getting adobe air security pop ups. "adobe air has stopped a potentially unsafe operation tring to comunicate with this internet-enabled location:
    This application is going on a kiosk of types. Is it possible to add some sort of text file to the machines that has predetermined list of allowed internet-enabled locations so that this pop up doesnt keep appear and the application works with out us having to manually set each kiosk to allow a location?
    Thanks
    Aidan

    Have you found an answer for this. I am running into the same
    problem.

  • Loader SWF keeps covering up buttons.... :(

    i have my buttons connected to loaders which bring in swf files......and these swf files are the same size as my project......i want to set the X, Y coordinates to 0,0 so that the swf will line up perfectly in the project, but every time i do this, the swf ends up covering the buttons.....
    so i guess my question is: how do i bring in the swf, so that it sits beneath the buttons?
    thanks, guys
    -dean

    hmmm....i think i may have stated my question wrong....
    my Flash project settings are at 900x600 pixels...and my loader is loading an SWF which is 900x600.....
    so, i want the SWF to fall directly on the scene ( i don't want to move it out of frame and lose any of the image )
    ....i simply want the buttons to lay over the SWF
    thanks again,
    -dean

  • Cant load image to stage with loader

    thoughts?
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" borderColor="#FFFFFF" creationComplete="init()"
         width="100%" height="100%">
    <mx:Script>
         <![CDATA[
             import flash.media.Sound;
             import flash.media.SoundChannel;
             import flash.net.URLRequest;
             import flash.display.Loader;
             private var song:SoundChannel;
             private var request:URLRequest = new URLRequest("Gun_44magnum.wav");
            private var soundFactory:Sound = new Sound();
            private var img:Loader = new Loader();
              private function init():void{
                   addEventListener(MouseEvent.CLICK, shootScreen);
                  soundFactory.load(request);
                  img.load(new URLRequest("bulletHole.jpg"));
                  img.contentLoaderInfo.addEventListener(Event.COMPLETE, shootScreen);
              private function shootScreen(e:Event):void{
              // song = soundFactory.play();
                   trace("loaded");
                   addChild(img);
         ]]>
    </mx:Script>
    </mx:WindowedApplication>
    error
    TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Loader@157ea281 to mx.core.IUIComponent.
         at mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::addingChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:3259]
         at mx.core::Container/addChildAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2207]
         at mx.core::Container/addChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2140]
         at bangBang/shootScreen()[/Volumes/Files/Canulla/Brodeur/prof_dev/bangBang/src/bangBang.mxml:41]

    img.addEventListener(Event.added, loadImage);//img is your loader, loader is not image...
    func loadImage(e)
    var image:Image = new Image();
    image.source = e.currentTarget.content;
    addChild(image);

  • How to effectively remove a loaded SWF from the stage?

    I can not figure out a proper coding to remove a loded SWF from the stage.
    Here is my set up.
    I have a layout segmented into labeled section. In the section labeled "products" I have a layout consisting of product images acting as buttons which bring a user to another labeled section "prdctsPopUps"
    In the "prdctsPopUps" section I have placed an instance of LoaderMax placed into an mc container. Placing LoaderMax into an mc container automatically resolved an issue of clearing loaded SWFs from stage when I come back to "products" section.
    I specified the variable in the "products" section with the following set up:
    var sourceVar_ProductsPopUps:String;
    function onClickSumix1PopUp(event:MouseEvent):void {
                        sourceVar_ProductsPopUps="prdcts_popups/sumix1-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    So each button has its own "....swf" URL and they all open fine and I can come back to "products" section without any issues.
    However inside the swf (which loads through LoaderMax which is placed into an mc) there are other buttons which bring a user to labeled section "xyz". Which also functions properly. It opens as it is supposed to be and without any previously loaded "...swf" on the stage.
    At the labeled section "xyz" there is a limited set of buttons repeating from section "products" which has to bring a user back to the same set up in the "prdctsPopUps" labeled section and open a corresponding "...swf" .
    However only the last opened "...swf" will appear in that section. Effectively the one which was originally opened from the "prdctsPopUps" section and not the one which was supposed to be opened from the "xyz" section.
    I can not understand why it would work from one labeled section and not from another. I can not figure out on which section which code/function needed to be placed.
    Here is the set up from a button from the "xyz" section whcih supposed to bring a user to the same "prdctsPopUps" section but to load a different "...swf"
    var sourceVar_ProductsPopUps_fromXYZ:String;
    function onClick_floralytePopUp_fromXYZ(event:MouseEvent) :void {
                        sourceVar_ProductsPopUps_fromXYZ="prdcts_popups/floralyte-popup_tl.swf";
                        gotoAndPlay("prdctsPopUps");
    Here is the code set up for the LoaderMax from the "prdctsPopUps" section:
    var loaderProductPopUps:SWFLoader = new SWFLoader(sourceVar_ProductsPopUps,
                                                                                                        estimatedBytes:5000,
                                                                                                        container:holderMovieClip,
                                                                                                        onProgress:progressHandler,
                                                                                                        onComplete:completeHandler,
                                                                                                        centerRegistration:true,
                                                                                                        alpha:1,
                                                                                                        scaleMode:"none",
                                                                                                        width:540,
                                                                                                        height:730,
                                                                                                        crop:true,
                                                                                                        autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();
    Is there something which needs to be imported, or specific function needs to be specified in a specific labeled section?

    actually, i think you'll need to use something like:
    var loaderProductPopUps:SWFLoader;
    if ((loaderProductPopUps){
    if(loaderProductPopUps.content)){
       loaderProductPopUps.unload();
    loaderProductPopUps= new SWFLoader(sourceVar_ProductsPopUps, //the value of sourceVar_ProductsPopUps allows to load mulitple SWFs from the products page.
                                                                                                         estimatedBytes:5000 ,
                                                                                                         container:holderMov ieClip,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)
                                                                                                                                                                         // if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,
                                                                                                                                                                         // can be any size, can not be scaled as it distorts the content
                                                                                                         onProgress:progress Handler,
                                                                                                         onComplete:complete Handler,
                                                                                                         centerRegistration: true,
                                                                                                         //x:-260, y:-320, //no need for this is if used: centerRegistration:true,
                                                                                                         alpha:1,
                                                                                                         scaleMode:"none",
                                                                                                         //scaleX:0, scaleY:0,
                                                                                                         //vAlign:"top",
                                                                                                         width:540,
                                                                                                         height:730,//scales proportionally but I need to cut off the edges
                                                                                                         crop:true,
                                                                                                         autoPlay:false
    function progressHandler(event:LoaderEvent):void{
              progressBarPopUp_mc.gradientbarPopUp_mc.scaleX = loaderProductPopUps.progress;
    function completeHandler(event:LoaderEvent):void{
              var loadedImage:ContentDisplay = event.target.content;
              //TweenMax.to(loadedImage, 1.5, {alpha:1, scaleX:1, scaleY:1});//only need this line if corresponding values are changed in SWF loader constructor
              TweenMax.to(progressBarPopUp_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
    loaderProductPopUps.load();

  • Loading from library conflicts with loading external swf

    I'm very new to ActionScript, so this might be incredibly basic. However, I've Googled and read myself into a coma and I'm not finding a solution.
    I have a movie with 6 navigation buttons.  Four of them load external .swf slideshows, and they work fine - as each file loads, the previous one clears the stage, etc.  The other button that I currently have set up is loading, from the library, an image.  The problem I'm having is that the slideshows replace each other on the stage - they're not stacking, they're replacing - but when the user selects the button that loads the image, the image overlays the last-selected slideshow.  If the user selects the image first, the image is visible when two of the external files transition.  Because of that 6th button, which is not yet even started, it's not desirable to me to simply set up the single image as another external file; if it's at all possible, I need to be able to pull from a library file when I build that last button.
    What I'd like to do - because there is no logical order that the buttons should be selected in - is figure out how to tell every button to remove the image file on click.  I've tried using this in the four buttons that link to the slideshows, to deal with the image (that's the one called quoteImage):
         if(myLoader != null && contains(quoteImage)){
            myLoader.removeChild(quoteImage);
    which has the advantage of not giving me any errors, but doesn't actually fix my problem.  I've tried many, many other things, and I'm just really stumped on what exactly I need to do to make this work the way I want it to.  Based on the fact that the books and online resources I've been using don't really cover this specific example, I suspect it might be an incredibly idiot thing to do, but I'd really like it to work this way if that's possible.
    The code as it stands, with the global variables and the first two buttons (the next three are identical to the second button and the sixth button doesn't exist) looks like this:
    var myLoader:Loader=new Loader(); 
    var quoteImage:Bitmap;
    stop();
    // Loads quoteImage from library
    btnQuotes.addEventListener(MouseEvent.CLICK, showquote);
    function showquote(event:MouseEvent):void {
    var myBitmapDataObject:myBitmapData = new myBitmapData(500, 350);
    var quoteImage:Bitmap = new Bitmap(myBitmapDataObject);
    quoteImage.x=150;
    quoteImage.y=180;
    addChild(quoteImage);
    // Loads industrial.swf from external file
    btnIndustrial.addEventListener(MouseEvent.CLICK, showindustrialcontent);
    function showindustrialcontent(event:MouseEvent):void {
    var myURL:URLRequest=new URLRequest("industrial.swf");
    myLoader.x=150;
    myLoader.y=180;
    myLoader.load(myURL);
    addChild(myLoader);
    Help is very much appreciated.

    I see now how to import and display a library class object
    using:
    var MovieClipClass:Class =
    Class(loader.contentLoaderInfo.applicationDomain.getDefinition("myLibraryAsset"))
    var movieClip:Sprite = new MovieClipClass();
    addChild(movieClip)
    But this seems to only work for SWF's published for AS3 Flash
    Player 9.
    I need to do the same for SWF's published with AS2 Flash
    Player 7.
    Any ideas?

  • Loaded SWF file CANNOT be made into button DIRECTLY?

    I'm experiencing a problem which may have no solution, but I
    would like to know why I cannot do what I want to do.
    PROBLEM:
    I am attempting to load in an external SWF file and once it
    is loaded, I wish to directly make the new Sprite/MovieClip into a
    button. However, the newly loaded Sprite/MovieClip seems to be
    resistant to be made into a button DIRECTLY. I would like to know
    why this is.
    WORKAROUNDS:
    Here are a couple of workarounds, but again I wish to know
    why I cannot do what I want to do.
    1) I place the new Sprite/MovieClip into an empty Sprite on
    stage and make the once empty sprite into a button.
    2) Construct the external SWF in such a way so i can refer to
    a MovieClip within the SWF file and make that MovieClip into a
    button.
    CODE EXAMPLE:
    I am loading a SWF file thru a Loader and then taking the
    loaded SWF file and adding it to an existing sprite on the stage. I
    then attempt to make a button out of the newly loaded swf file, but
    it fails to be clickable.
    The following is some quick code to illustrate my problem. I
    already have workarounds in place, so please let me know WHY the
    following code is impossible. thanks!
    ==============================================================================

    There should be no problem with what you are trying to do. If
    you want someone to look at what you've done, you have to be
    careful to show that and not possibly errant code because that is
    the substance of your post and what you requested be looked at--we
    cannot guess what you may have done wrong in setting things up or
    for code that you do not show.
    I tried your code before posting my response and it worked
    fine except for your error with the COMPLETE aspect. I did not
    utilize any objects for loading things into, so I suggest you look
    there.

  • Controling a loaded swf with another loaded swf

    I have a blank stage with only AS that loads an swf
    addChildAt(0) and a second one addChildAt(1). This works. When the
    user interacts with (1) it calls another addChild (not indexed) and
    possibly that one loads another, depending on the choices made by
    the user. How can I get any of these to control that very first
    child that was loaded at (0)? I have run out of ideas.
    Some of the code:
    (on the main swf, nothing on the stage, only code that loads
    the next two)
    addChildAt(pHolder, 0);
    pLoader.load(pURLReq);
    pLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    pLoaded);
    and for the second:
    addChildAt(mHolder, 1);
    mLoader.load(mURLReq);
    mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    mLoaded);
    On the child of childAt(1), I have:
    function replaceSWF(e:MouseEvent):void
    pLoader = new Loader();
    pLoader.load(new URLRequest("p.swf"));
    pLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    placeNewClip);
    function placeNewClip(e:Event):void
    removeChildAt(0);
    addChildAt(e.target.content, 0);
    If I use this exact same code from that very first swf, the
    one that loads the first two external swfs, it works, but once I
    put it on one of hte other loadeds and sub loaded swfs, I can't get
    it to work. In the current state (0) it just makes everything on
    the stage disappear, so I figured then using the index of (1) would
    do it, but that or any other number results in absoluly nothing.
    Help! I am really out of ideas here.
    (the stacking looks like this) ---
    sub second loaded SWF <==== needs to tell first loaded SWF
    to unload then load a new swf at same index
    second loaded SWF <==== loads the next one above
    first loaded SWF <=== needs to be removed and another swf
    loaded at the same index
    mainSWF (loads two others) <=== code placed here works for
    first loaded SWF

    Kglad,
    I tried your code and ran into some problems with stopping
    the mc's, as the embedded mc's within the loaded swf need to stop
    as well. I found the attached code to stop the mc's, but now am
    having trouble with the sound objects.
    Here's the issue, I used this:
    this.soundPosition = currentMovie.loop1.position/1000;
    this.currentMovie.loop1.stop();
    ... for the sound object stop commands and listed a new one
    for each loop I was using. On the play button I started them back
    up again. This all works, but when I start them up again they all
    play, not just the one that is currently paused. Do you mind giving
    me some guidance with the for (obj in mc) loop? My loop experience
    is nil. What I want to do is have the code cycle through all of the
    loops to see which one is playing, then store that information in a
    variable, then pause and play the variable. Does that sound right?
    Thanks again for the help!
    -Sandy

  • Loaded swf does not recognize stage of parent correctly

    I have an issue that is probably easily solved, but my attempts to solve it have been frivolous. 
    I am creating a “lightbox” to display artwork, but I have come across a slight hiccup.
    I am executing the lightbox functionality from a swf file that is loaded by a parent swf.  For testing purposes, when the lightbox button is clicked, the image should fill the entire stage.  Even though both the loaded swf and the parent swf recognize the same stage dimensions at all times(validated through tracing statements) and the lightbox image is positioned to the top/left corner of the stage, the image instead aligns to the top/left corner of the loaded swf.  And if the stage is resized after the lightbox image is displayed, the container MC (which is located in the parent swf and centers all the site’s content) re-aligns to the top/left corner of the stage . 
    To better illustrate these points, click the link below to see some screenshots with captions:
    http://newsite.katech.com/assets/images/lightbox_screenshots.jpg
    Also, here is the code applicable code from the loaded swf:
    stop();
    picture.visible = false;
    picture.x = 0;
    picture.y = 0;
    picture.width = stage.stageWidth;
    picture.height = stage.stageHeight;
    lightboxBtn.buttonMode = true;
    trace("embedded swf says the stage is " + stage.stageWidth + " X " + stage.stageHeight);
    function onStageResize(event:Event):void
                    trace("embedded swf says the stage is " + stage.stageWidth + " X " + stage.stageHeight);
                    picture.x = 0;
                    picture.y = 0;
                    picture.width = stage.stageWidth;
                    picture.height = stage.stageHeight;
    stage.addEventListener(Event.RESIZE, onStageResize);
    function showImage(event:MouseEvent):void
                    picture.visible = true;
    lightboxBtn.addEventListener(MouseEvent.CLICK, showImage);
    And for the applicable code from the parent swf:
    stop();
    trace("MAIN swf says the stage is " + stage.stageWidth + " X " + stage.stageHeight);
    //aligns site content to center of stage
    function onStageResize(event:Event):void
                    trace("MAIN swf says the stage is " + stage.stageWidth + " X " + stage.stageHeight);
                    container.x = (stage.stageWidth/2) - (container.width/2);
                    container.y = (stage.stageHeight/2) - (container.height/2);
                    if (container.x < 0)
                                    container.x = 0;
                    if (container.y < 0)
                                    container.y = 0;
    stage.addEventListener(Event.RESIZE, onStageResize);
    How can I get the loaded swf to display the lightbox image correctly in respect to the parent swf?  What am I doing wrong?

    I have still yet to resolve this issue on my own, if anyone could point me in the right direction, it would be greatly appreciated.
    Also, when I updated my previous post something "screwy" happened with the edit, so I went back and corrected the mistakes in case it made things unclear.
    Thanks.

  • Help with buttons accessing loaded layers

    Hi all...Using Flash CS3 and AS3 to build a learning module that will load different layers of SWF files based on buttons on the main screen.  Got this working with no problems.  What I want to do is add buttons to provide learners some functionality, specifically a forward button, back button and a check box that will keep advancing automatically.  I've done massive searches and so far nothing seems to work.  Seems like what I am acccessing so far is the main layer, not the new layers as they are loaded.  Below is what I have been trying with the back button; the foward button uses nextFrame and is Handler2.  It isn't working.  Not even sure how to start with the checkbox for auto advance.  Any help would be GREATLY appreciated.
    Mark
    back_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler1);
    function mouseDownHandler1(event:MouseEvent):void
                    MovieClip(root).prevFrame();

    Thank you for your reply.  This is what I have so far - the module has four differentSWFs that load depending on what the user selects.  The modules are titled Introduction, Standards, Elements, and Traits.  When clicked, the button loads that specfic SWF and the previous one is unloaded. Hope I am using the correct terminology - I'm more familiar with AS2 than 3!

  • How do I interact with a loaded swf?

    Hi,
    I have a "lesson" that I'm building that will display a series of "pages" based on an XML file. I have simple navigation buttons that work to page through the XML file. but I'd like to use load an external SWF file with buttons to use as my navigation panel. Everything is AS 3.0. The code to load the navigation movie looks like this:
    // load navigator
       navLoader = new Loader;
       navLoader.contentLoaderInfo.addEventListener(Event.INIT, handleInit);
       navLoader.x = 50;
       navLoader.y = 200;
       lessonSprite.addChild(navLoader);
       navLoader.load( new URLRequest("Navigator1.swf"));
    The loaded navigation movie has two buttons. How do I add an event listener to those buttons so that they call a function in the parent movie so I can detect when the user clicks on the button named "GoNext" in the loaded movie?  I've tried several ways but I've had no luck. Could someone please point me in the right direction? This navigation panel is only one application of this sort of communication that I'll need in other parts of this type of lesson so I really need to figure out how to detect user interaction interaction with the loaded movie. Guess I need to know how to call a function in the parent movie from the loaded movie.
    Thanks,
    Peter H.

    Hey Pete,
    The answer that you seek and the simplest one as well will be from the MouseEvent. that  you will most likely have applied to your loaded swf.
    As long as both swfs are in the same domain, you wont have any issues with security and therefor, the MouseEvent. which bubbles up, will be able to reach your swf file which has loaded it.
    You can then write your code in your loaded swf to simply listen to the loadedMovieClip  by targeting the contents of navLoader just like this,
    navLoader.content.addEventListener(MouseEvent.MOUSE_DOWN,onDown)
    protected function onDown(me:MouseEvent){
    now providing you have given your two buttons names in your loaded swf, you will be able to perform addition tasks by receiving the name of the target.
    protected function onDown(me:MouseEvent){
    var btnClip:Movie= me.target as MovieClip
              var btnName=btnClip.name
    if(btnName==(button1)){
         //do the following
    }else{
           //it was button two
    button1 was just a random name in this case .
    This will do the trick

  • Can't target main stage from dynamically loaded swf...

    A part of the Flash app. I'm working on right now does the following -
    Main stage loads an external swf using the following function:
    function loadAsset(evt:String):void{
    var assetName:String = evt;
    if (assetName != null){
      var assetLdr:Loader = new Loader(); 
      var assetURL:String = assetName; 
      var assetURLReq:URLRequest = new URLRequest(assetURL); 
      assetLdr.load(assetURLReq); 
      assetLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded) 
      assetLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayAssetLoaderProgress);  
      function loaded(event:Event):void { 
       var targetLoader:Loader = Loader(event.target.loader); 
       assetWindow.addChild(targetLoader);
    The externally loaded swf loads another external swf into itself using the following function:
    function loadQuiz(evt:String):void{   
    var quizName:String = evt;
    if (quizName != null){
      var quizLdr:Loader = new Loader();
      var quizURL:String = quizName;
      var quizURLReq:URLRequest = new URLRequest(quizURL);
      quizLdr.load(quizURLReq);
      quizLdr.contentLoaderInfo.addEventListener( Event.INIT , loaded)       
      quizLdr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, displayQuizLoaderProgress); 
      function loaded(event:Event):void {
       var targetLoader:Loader = Loader(event.target.loader);
       quizWindow.assetLoader.addChild(targetLoader);     
    Everything loads fine, but from the quizWindow.assetLoader.addChild(targetLoader) level, I want to send a message/fill in a dynamic text box on the Main Stage. I have been "parenting" my brains out and I'm not sure how to communicate with that level.
    can anyone show me the proper path or method based off the above, or have a suggestion?
    Cheers,
    ~Chipleh

    Andrei1,
    Thanks again for your help. I was finally able to get the solution you posted below to work for me.
    Much appreciation,
    ~Chipleh
    "In your loaded movie write:
    function traceMyself(e:MouseEvent):void{
         dispatchEvent(new Event("I_WANT_TEXT"));
    function writeText(text:String):void {
         xmlFileName1.text = text;
    In the top movie that loads external swfs something like that:
    loadedSwf.addEventListener("I_WANT_TEXT", onTextRequest, true);
    function onTextRequest(e:Event):void {
         Object(e.target).writeText(tQuizXmlFile1.theQuizXmlFile.text);
    This way these two entities are independent and, most importantly, don't care who is the parent or grandparent."

Maybe you are looking for

  • Payment Program issue

    Hi, I'm working on Automatic Payment Process in the form of Letter generated by SAP SCRIPT. The program program initially it was standand form for the letter/receipt generation, now they want to do the same using another custom FORM which is used by

  • Missing Task Outcomes in ADF Project for BPEL Human Task

    Hi I am using SOA Suite 11g (11.1.1.5) and have created a Human Task in my composite application and then auto-generated the appropriate task form using the wizard which has been successful and created the ADF project. My task has 3 outcomes the resp

  • Can I use APEX Packaged applications for commercial purposes

    Hi, When you download and Install APEX, it comes with pre build packaged applications. Can I use it to make money? I understand that I will not be able to get any support for Oracle and all that.  But  using  Database XE with APEX, can I start shippi

  • Exporting HD MPEG-2 CBR

    I'm not very familiar with streaming content for an internal TV channel but I've been put in a place where I have to. I'm using the newest version of Apple's Compressor and having some difficulty. I have to get a video uploaded to an MPEG-2 format wi

  • HT4623 My iPod touch 5 can't install iOS 7. I need help

    I need help