Control swf from separate swf in main file

Im loading 2 swfs into my main swf. So I have a top swf and a
bottom swf being loaded in externally into my main swf that makes 3
swfs, 1MAIN swf loading TOP swf & BOTTOM swf.
Is there a way to have the bottom swf control or command the
top swf? I need a button on in the bottom swf to tell the top swf
to load a movie.

in AS2 you can point directly from one to the other with the
correct pathing.
IE:
_level0.TopSwfLoader.content.FunctionToCall();
or
_level0.TopSwfLoader.content.Property = NewPropertyValue;
_level0 takes you to the main swf (_root, but this works
around if lockroot is set)
TopSwfLoader.content is the content of the Loader component
that has your Top.swf loaded into it. If you are not using a Loader
component, then you can change this to the instance name of the
Movie Clip that has the swf loaded into it.
FunctionToCall()/Property is what you want to control. Either
a function call or a property.
In AS3 this works a bit differently. I would dispatch a
custom event from the Bottom swf. Then the main swf would catch
that event, and call the appropriate function/property in the top
swf. I can elaborate more on this if you need.

Similar Messages

  • How to unload swf from anather swf

    I am calling 3 different swf in to test.swf.
    now i want to unload only 1 swf from test.swf
    can any 1 tell me how it is possible i am trying
    with removeMoviClip() and unloadMovie()
    but its of no use.
    regards
    Justbipin

    Maybe that's not really what you're doing?
    I would guess you rather have
    loadMovieNum("myFiLe.swf",99);
    This would be unloaded with
    unloadMovieNum(99);
    Good luck
    Wolf
    PS Or do you have a container movieClip called "99" to fool
    us all? :-)
    PPS watch your capitalization. If you call a file "myFiLe"
    (and mis-spell it somewhere) it might work on Windows, but not on
    Unix-derivatives. A potential source of "Why did it work when I
    tested it but not when I uploaded it?"

  • Controlling swfs from other swfs.

    hi there. the site i've designed has a background layer, a
    navigation panel layer(menu) and the content is loaded as separate
    swf files on levels behind the navigation panel. to allow for
    seamless unload of the content i want to control the transition
    from the navigation panel layer.
    eg. When the user clicks on "Story" button, the navi panel
    layer communicates with the content layer (eg. Welcome page), tells
    it to play from frames 50-60 and then unload. After this, the
    desired content layer (in this case "Story") is loaded into, say
    layer 5.
    how do i go about coding this in actionscript? i'm slightly
    bamboozled by the actual script for it and i'd really appreciate
    some direction.

    If you load your movieClips into levels, you simply use those
    levels to direct them, e.g. _level5.gotoAndPlay(50)
    You can't tell a movieClip to play from frame 50 to 60 and
    then stop. I mean you could, but judging from the question you ask
    I guess you don't want to get into so much complexity.
    You tell the clip to play, and the clip should know itself
    when to stop. If you want to be a bit more flexible, you can set a
    variable in the clip and check it at certain keyframes via
    actionscript:
    in the controlling clip:
    _level5.stopFrame = 60;
    _level5.gotoAndPlay(50);
    And in the controlled clip in possible stop frames:
    if(stopFrame == _currentframe) { stop(); }
    You could enable this for every frame via an onEnterFrame
    event handler.
    Of course you need to tell the controlling clip to continue
    in some way, e.g. by sending it to another frame....
    This of course is very linear and old style programming, not
    object oriented.
    It would be better not to load into levels, but into named
    movieClips at certain depths. This allows you to use the
    movieClipLoader class, and program all that event-driven.

  • Having problem controling resizing of a swf from another swf

    I'm trying to build a site where all the pages are full browser and maintain aspect ratio. I would like to control the resizing from the menu page.  The resizing works fine from the page that's being resized but when I try to let the parent swf do that it has issues.
    Here's what the home page looks like with the controls built in  http://www.mespinach/example1/
    This example is the site it has a menu page that I open the others from I remove the resizing code from the home page and try to resize from menu.swf.
    here's the code from menu.swf
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    var holder:btnHolder = new btnHolder();
    addChild(holder);
    stage.addEventListener(Event.RESIZE, moveHolder);
    moveHolder();
    function moveHolder(e:Event = null):void {
        holder.x = stage.stageWidth - (holder.width +25);
        holder.y = 50;
    holder.mcHome.buttonMode = true;
    holder.mcAbout.buttonMode = true;
    holder.mcMovies.buttonMode = true;
    //holder.mcLocation.buttonMode = true;
    holder.mcStore.buttonMode = true;
    //var objFileToLoad:URLRequest = new URLRequest();
    var swfLoader:Loader;
    addListeners();
    function addListeners():void {
        holder.mcHome.addEventListener(MouseEvent.CLICK, homePage);
        holder.mcAbout.addEventListener(MouseEvent.CLICK, aboutPage);
        holder.mcMovies.addEventListener(MouseEvent.CLICK, moviesPage);
        // holder.mcLocation.addEventListener(MouseEvent.CLICK, locationPage);
        holder.mcStore.addEventListener(MouseEvent.CLICK, storePage);
    var currentPage:*;
    var xImage:Sprite = new Sprite();
    homePage();
    function homePage(event:MouseEvent = null):void {
        SoundMixer.stopAll();
        addListeners();
        if(swfLoader){this.removeChildAt(0);}
        holder.mcHome.removeEventListener(MouseEvent.CLICK, homePage);
        var loadRequest:URLRequest = new URLRequest("home.swf");
        swfLoader = new Loader();
        swfLoader.contentLoaderInfo.addEventListener(Event.INIT, positionContent);
        swfLoader.load(loadRequest);
        this.addChildAt(swfLoader, 0);
        function positionContent(e:Event):void {
            currentPage = swfLoader.content;
            var loadedImage = currentPage.onStage;
            xImage = loadedImage;
    //        loadedImage.x= 0;
    //        loadedImage.y= 0;
            fillBG();
    function aboutPage(event:MouseEvent):void {
        SoundMixer.stopAll();
        var objFileToLoad:URLRequest = new URLRequest("about.swf");
        loader.contentLoaderInfo.addEventListener(Event.INIT,positionContent);
        loader.load(objFileToLoad);
        this.addChildAt(loader, 0);
        function positionContent(e:Event):void{
           loader.x= 0;
           loader.y= 0;
    function moviesPage(event:MouseEvent):void {
        addListeners();
        holder.mcMovies.removeEventListener(MouseEvent.CLICK, moviesPage);
        SoundMixer.stopAll();
        if(swfLoader){this.removeChildAt(0);}
        var objFileToLoad:URLRequest = new URLRequest("Movies.swf");
        swfLoader.contentLoaderInfo.addEventListener(Event.INIT,loadedHandler);
        swfLoader.load(objFileToLoad);
        this.addChildAt(swfLoader, 0);
        function loadedHandler(e:Event):void {
            currentPage = swfLoader.content;
            xImage = currentPage;
    function locationPage(event:MouseEvent):void {
        SoundMixer.stopAll();
        var objFileToLoad:URLRequest = new URLRequest("location.swf");
        loader.load(objFileToLoad);
         this.addChildAt(loader, 0);
    function storePage(event:MouseEvent):void {
        SoundMixer.stopAll();
        var objFileToLoad:URLRequest = new URLRequest("store.swf");
        loader.load(objFileToLoad);
         this.addChildAt(loader, 0);
    holder.addEventListener(MouseEvent.MOUSE_OVER, over);
    holder.addEventListener(MouseEvent.MOUSE_OUT, out);
    holder.addEventListener(MouseEvent.MOUSE_DOWN, down);
    holder.addEventListener(MouseEvent.MOUSE_UP, up);
    holder.mcAbout.buttonMode = true;
    holder.mcHome.buttonMode = true;
    holder.mcMovies.buttonMode = true;
    holder.mcStore.buttonMode = true;
    //holder.mcLocation.buttonMode = true;
    var myColor:ColorTransform = transform.colorTransform;
    function over(e:MouseEvent):void {
        myColor.alphaMultiplier = 3;
        e.target.transform.colorTransform = myColor;
    function out(e:MouseEvent):void {
        myColor.alphaMultiplier = 1;
        e.target.transform.colorTransform = myColor;
    function down(e:MouseEvent):void {
        myColor.alphaMultiplier = 5;
        e.target.transform.colorTransform = myColor;
    function up(e:MouseEvent):void {
        myColor.alphaMultiplier = 1;
        e.target.transform.colorTransform = myColor;
    //var cpc = this.child.child.getChildByName("onStage");
    //trace(cpc);
    var ratio:Number;
    var rRatio:Number;
    ratio = xImage.height/xImage.width;
    rRatio = xImage.width/xImage.height;
    var newRatio:Number;
    function fillBG(evt:Event = null):void {
        trace("width: " + xImage.width);
        trace("height: " + xImage.height);
        trace("ratio: " + ratio.toString());
        trace("rRatio: " + rRatio.toString());
        trace("newRatio: " + newRatio.toString());
        newRatio = stage.stageHeight/stage.stageWidth;
        holder.x = stage.stageWidth - (holder.width +25);
        holder.y = 50;
        if (newRatio > ratio) {
            trace("newRatio > ratio: ");
            xImage.height = stage.stageHeight;
            xImage.width = stage.stageHeight * rRatio;
        } else {
            trace("else");
            xImage.width = stage.stageWidth;
            xImage.height = stage.stageWidth * ratio;
        stage.addEventListener(Event.RESIZE, fillBG);
    messages from trace statements here:
    width: 939
    height: 704
    ratio: NaN
    rRatio: NaN
    newRatio: NaN
    else
    width: 561
    height: 704
    ratio: NaN
    rRatio: NaN
    newRatio: 0.49376114081996436
    else
    The height never changes
    retio and rRatio are NaN even though they are the Quotient of numbers.

    First, it is too much code to go through so I don't think I will give a complete answer. I assume this is a timeline code.
    Here is what I was able to notice:
    1. You declare the variables outside the scopes of the functions:
    var ratio:Number;
    var rRatio:Number;
    ratio = xImage.height/xImage.width;
    rRatio = xImage.width/xImage.height;
    var newRatio:Number;
    Naturally, they are NaN because neither xImage.height nor xImage.width are available at this point.
    I suspect that you anticipate that when code hits these lines - swf is already loaded but IT IS NOT. Flash executes ALL THE CODE to the end NOT WAITING for swf to load - this is one of the premises of asynchronous event model.
    To remedy this you need to place value assignments into the event handler:
    Version One:
    Declare variable at the top of the code before you start loading:
    var ratio:Number;
    var rRatio:Number;
    var newRatio:Number;
    Calculate values in event handler:
    function positionContent(e:Event):void {
            ccurrentPage = swfLoader.content;
            var loadedImage = currentPage.onStage;
            xImage = loadedImage;
            ratio = xImage.height/xImage.width;
            rRatio = xImage.width/xImage.height;
            fillBG();
    Or do it inside  fillBG(); method (version two)
    2. Nested functions are evil and I would like to suggest you reconsider using them and bring them outside of other methods' scopes. I am talking about positionContent handlers you use.

  • Error when opening swf from another swf

    Hi all,
    I'll try to explain this as good as possible.... I made a maze game that works perfectly when I run it by clicking on it's own .swf file, but when I try to access it from another .swf file which is a menu for the games I created, it does not work.
    I have absolutely no idea where to look for the error, so my question is: can it be that the main.swf (which is the menu for games) could be the problem, or the problem must be in the maze.swf?
    Thanx in advance!

    no, all code is in the first frame of actions layer:
    stop();
        var rightArrow:Boolean = false;   
        var leftArrow:Boolean = false;
        var upArrow:Boolean = false;
        var downArrow:Boolean = false;
        var speed:int = 5;
        stage.addEventListener(KeyboardEvent.KEY_DOWN, stage_onKeyDown);
        stage.addEventListener(KeyboardEvent.KEY_UP, stage_onKeyUp);
        stage.addEventListener(Event.ENTER_FRAME, stage_onEnterFrame);
        function stage_onKeyDown(event:KeyboardEvent):void {
            if(event.keyCode == Keyboard.RIGHT) rightArrow = true;
            if(event.keyCode == Keyboard.LEFT) leftArrow = true;
            if(event.keyCode == Keyboard.UP) upArrow = true;
            if(event.keyCode == Keyboard.DOWN) downArrow = true;
        function stage_onKeyUp(event:KeyboardEvent):void {
            if(event.keyCode == Keyboard.RIGHT) rightArrow = false;
            if(event.keyCode == Keyboard.LEFT) leftArrow = false;
            if(event.keyCode == Keyboard.UP) upArrow = false;
            if(event.keyCode == Keyboard.DOWN) downArrow = false;
        function stage_onEnterFrame(event:Event):void {
            var rect:Rectangle = player.getBounds(this);
            var i:int = 0;
            var xBump:int = 0;
            var yBump:int = 0;
            if(rightArrow) {
                xBump = speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(rect.right + i, player.y, true)) {
                        xBump = i - 1;
                        break;
            if(leftArrow) {
                xBump = -speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(rect.left - i, player.y, true)) {
                        xBump = -i + 1;
                        break;
            if(upArrow) {
                yBump = -speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(player.x, rect.top - i, true)) {
                        yBump = -i + 1;
                        break;
            if(downArrow) {
                yBump = speed;
                for(i = 0; i < speed; i++) {
                    if(maze.hitTestPoint(player.x, rect.bottom + i, true)) {
                        yBump = i - 1;
                        break;
            player.x += xBump;
            player.y += yBump;
            if(rightArrow) {
                xBump = speed;
                for(i = 0; i < speed; i++) {
                    if(cilj.hitTestPoint(rect.right + i, player.y, true)) {
                        xBump = i - 1;
                        nextScene();

  • Opening a swf from other swf

    Hello Readers,
    I have been working on an application.
    There is a login screen for the application, in one of the swf's I have been writing the login code, along-with communications with XML.
    Now once the user has been validated, I want to redirect the user to some XYZ.swf  file and close the login.swf file else if not then I have to display an error message.
    The issue may sound simple, but I am a beginner at this.
    I would be encouraged to explore my endeavors, if some one could help me out with it.
    Thank You for reading.
    Regards,
    Jayesh Sidhwani

    Absolutely! Yup, you got it! If you want to use a SWF with all its script and interactions, you have to put it in another place and treat it as an external URL. It has to be boss of its territory (I almost said 'domain' but of course it can be in the same domain).
    Go navigateToURL() and you have no problems.
    The problem is, we often want to load a SWF without navigating outside our main compiled SWF, and it's frustrating to find out that it loads but doesn't use its timeline code. When you want to do this, you should forget using a SWF and make the object an MC instead.

  • RemoveChild in parent.swf from child.swf (AS3)

    Hi! How do I remove a child from a parent timeline with an externally-loaded swf? Specifically, I have a main.swf that loads movie_1.swf and movie_2.swf. In the movie_1.swf, I have a button to remove movie_2.swf from main.swf.
    //--------- main.swf code:
    var loader1:Loader = new Loader();
    var loader2:Loader = new Loader();
    loader1.load(new URLRequest("movie_1.swf"));
    loader2.load(new URLRequest("movie_2.swf"));
    addChild(loader1);
    addChild(loader2);
    //------------- movie_1.swf code:
    removeMovie2_btn.addEventListener(MouseEvent.CLICK , removeMovie2);
    function removeMovie2(event:MouseEvent):void
    this.parent.parent.removeChild(this.loader2); // this does not work (get error code 2007, "Parameter child must be non-null")
    // Thank you!

    Here's how your code will change:
    //--------- main.swf code:
    var loader1:Loader = new Loader();
    var loader2:Loader = new Loader();
    loader1.contentLoaderInfo.addEventListener(Event.COMPLETE, assignMovie1Listener);
    loader1.load(new URLRequest("movie_1.swf"));
    loader2.load(new URLRequest("movie_2.swf"));
    addChild(loader1);
    addChild(loader2);
    function assignMovie1Listener(evt:Event):void {
          MovieClip(evt.currentTarget.content).addEventListener("eventTriggered", removeLoader2);
    function removeLoader2(evt:Event):void {
          loader2.unloadAndStop();
          removeChild(loader2);
    //------------- movie_1.swf code:
    removeMovie2_btn.addEventListener(MouseEvent.CLICK , removeMovie2);
    function removeMovie2(event:MouseEvent):void
          dispatchEvent(new Event("eventTriggered"));

  • Reference to main.swf from nested swf

    Hi,
    I have main.swf that loads page.swf . I want to have a button
    inside page.swf that tells main.swf to do something.
    How do I refernce the timeline of Mian.swf
    I use mx2004
    Thanks,
    Robert

    See:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=194&threadid=1173850&en terthread=y
    If you target what you want to do just like if it was in the
    same swf. The mc you want to load won't work correctly until it's
    tested in the movie your loading into. Like my code. _root with dot
    in between each nested element. My code has the an empty mc called
    'empty' that MARK_EXPAND is loaded into. And 'empty' is nested in
    'InterfaceYO' which is nested in HEADERfadeout which in turn is
    (obviously) in the _root, which is the source.

  • Record or output SWF from dynamic SWF

    Hello everyone
    I have a SWF that pulls images from a database and dynamically creates a slideshow.  Each time the URL is loaded with different parameters, a new slideshow is shown.
    I was wondering if it is possible to record or output a SWF - for each dynamically generated slideshow?
    Meaning: The original slideshow is dynamically generated and at the same time, a copy of that slideshow is recorded and or an output of a second SWF is performed....
    Is that possible??
    Thank you for your time and attention

    1. You can't bind in the table name. You would have to use string concatenation for the table_name. But should still use binds for the variable.
    2. The syntax for execute immediate is not
    execute immediate 'select into ...'but
    execute immediate 'select ....' into variable.extending your example to include the table_name, you would end up with something like this:
    set serveroutput on;
    declare
    myvar varchar2(200);
    mytablename varchar2(30) := 'DUAL';
    secondvar number;
    begin
    EXECUTE IMMEDIATE 'select 1 from '|| mytablename ||' where rownum = 1' into secondvar;  --using 'using' if binding in the variable for a predicate
    dbms_output.put_line(secondvar);
    end;Edited by: dombrooks on Sep 23, 2009 4:17 PM

  • Controlling a Movie Clip on the Main Timeline from a loaded SWF?

    Is it possible to control a MovieClip on the main timelne from another loaded clip?
    I see posts that control loaded clips, but most are all from the loader in the main timeline.  I have a moviclip on the main timeline that I want to make visible or invisible depending on what keyframe is playing in another loaded swf.
    If I try to call the movieClip from the loaded SWF I get "error #1119.  Access of possibly undefined property...." because it doesn't exist in the loaded SWF, just the main timeline. 
    The old AS2 way just used "_root".  Since "_root" doesn't exist any more, how do you control items on the main TimeLine from a loaded SWF?

    I am not clear what you mean because you are saying you are trying to target a movieclip that does not exist where you are trying to target it.
    Try using a trace to see what you are targeting when you you target the MovieClip(parent.parent)....
    trace(MovieClip(parent.parent));
    The other approach I mentioned earlier is the more OOP-correct approach if you would rather try that way.  Here's a rough outline of it...
    AS3 - Dispatch Event
    http://forums.adobe.com/thread/470135?tstart=120
    Example:
    Add something to trigger the event in the child (your loaded swf):
    dispatchEvent(new Event("eventTriggered")); (
    if dispatchEvent problem, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)
    In your loading/parent swf, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf.
    // event handler triggered when external swf is loaded
    function loaderCompleteHandler(event:Event) {
        MovieClip(event.currentTarget.content).addEventListener("eventTriggered", eventHandler);
    function eventHandler(event:Event):void {
        trace("event dispatched in loaded swf");
       // this is where your main file can set the visible property of your movieclip

  • Controlling sound of separate html files within the same html page.

    I need to allow users to preview audio files for purchasing. I have CF pages that return records form a SQL database. Each record contains the same swf file however, each swf file points to a different mp3 for previews of different audio examples. So far, everything is working fine. My problem is that I need to be able to stop the sound from one  swf when I click to play a second swf.  The only solutions I see in Flash forums deal with loaded swf files. These are not loaded files they are separate files within a page. The question is: How do control one swf from another swf in the same page.  The following items have not worked:
    soundChannel.stop();,
    soundMixer.stopAll()
    I think my solution may be to use ExternalInterface but I am not sure where to begin with this. Any suggestion would be appreciated.

    you need to use the localconnection class to communicate between swfs open at the same time by the same client.

  • How to pass a "Button" reference in one swf to anthor swf file?

    Dear all:
    Please let me describe my problem first.
    In my application, there are two swf files:"sender.swf" and
    "receiver.swf"
    A button named "re_Button" is in "receive.swf", and now i
    wanna operate the "re_Button" through the "sender.swf".
    How to do this?
    Can I access the "re_Button" reference through another swf
    application??
    And I've tried the "locaconnection" class, but it doesn't
    help.
    AnyOne helps me?
    Thanks in advance -_-

    I tried the localconnection class:
    1).Sender.as:
    private var send_tf:TextField;
    private function sendMessage(event:MouseEvent):void {
    conn.send("myConnection", "lcHandler",send_tf); // to send
    the "send_tf" reference to the "Receiver"
    2). Receiver.as
    public function lcHandler(tf:Object):void {
    tf as TextField ==null // here, i find that the "send_tf" is
    not a "TextField" any more!!!!!!!!!!!!!!!!
    I wanna operate one instance reference in one swf from
    another swf.
    Is it possiable??
    Thanks in advance.

  • Cfpresentation with a swf from captivate 3

    I have a swf file that I created with captivate 3 for some
    user training. I thought it would be a good idea to include it in
    the new cfpresentation tag. When I run it, the cfpresentation tag
    starts and then I see the captivate starting icon comes up and then
    it is a white screen. I can run the swf from the browser and the
    file runs find. I put a cfpresentationslide before this slide and
    that one comes up fine but then it goes to this next slide and I
    again only get a white screen. THe swf file runs about 30-45
    seconds. Am I doing something wrong? Here is the code. I just have
    the basic since I just want to see it run.

    I built a SWF in a program called Articulate and tried to
    include it in a cfpresentation and it had the same result.
    I also included a SWF built in Adobe Flash that included
    sound and the sound does not make it into the cfpresentation.
    I think the <cfpresentation> tag is a good start, but
    it certainly isn't the jaw-dropping, WOW, this changes everything
    tag that I initially thought it was.

  • Controlling multiple external swfs from main timeline

    Hi, I've been trying to combine the features of two tutorials I found, one that deals with controlling external swf's from the main timeline and the other that explains how to load and unload multiple external swf's.  I'd like to be able to load and unload multiple external swf's, and control these swf's buttons from the main timeline. 
    I asked this same question on the forum of the site where I found these tutorials, and receive only one reply saying that "it should'nt be hard to do." but they did not elaborate any further.  This left me think that I was missing something very obvious and I've spent too much time now trying to work what it is now.  I understand pretty much how both pieces of code work, but just can't work out how to combine them.
    If someone could explain it to me, I'd much appreciate it.
    Tutorial One code - controlling an external swf from the main timeline.
    var ldr:Loader = new Loader();
    var urlReq:URLRequest = new URLRequest("swfs/balls.swf");
    ldr.load(urlReq);
    function loadHandler (event:Event) {
    var myClip:MovieClip = event.target.content;
    addChild(myClip);
    function myClipOver(event:MouseEvent):void {
    myClip.myBlueBalls.stop();
    function myClipOut(event:MouseEvent):void {
    myClip.myBlueBalls.play();
    // set listeners
    myClip.addEventListener(MouseEvent.ROLL_OVER, myClipOver);
    myClip.addEventListener(MouseEvent.ROLL_OUT, myClipOut);
    // listener
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
    Tutorial Two code - loading and unloading multiple external swfs.
    var Xpos:Number = 110;
    var Ypos:Number = 180;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    // Btns Universal function
    function btnClick(event:MouseEvent):void {
    removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
    loader.load(newSWFRequest);
    loader.x = Xpos;
        loader.y = Ypos;
    addChild(loader);
    // Btn listeners
    eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
    stingray.addEventListener(MouseEvent.CLICK, btnClick);
    demon.addEventListener(MouseEvent.CLICK, btnClick);
    strongman.addEventListener(MouseEvent.CLICK, btnClick);

    I will not be able to help you with whatever relaxatraja provided though it is purported by relaxatraja to be clearly explaining what I was explaining (???).
    Your loadHandler function appears a bit confused.  For the code you show I don't see you assigning any event listeners for the events that will be dispatched in the loaded file.  As I showed earlier, your loadHandler function should be assigning a listener for the event that will be dispatched (modified slightly below). and if you have three different events being dispatched in the loaded file, then you'll do better to have three different listeners.  I show only one below for one of the events you dispatch...
    function loadHandler (event:Event) {
      // assign a listener for the loaded file's goExit function's event
       MovieClip(event.currentTarget.content).addEventListener("close", event1Handler);
    // I can't make sense of what you have here
        removeChild(myClip); // why ?? - it hasn't been added yet as far as I can see - error 2007?
        var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf"); // the event.target is the Loader
        ldr.load(newSWFRequest); // this will load over the file you just finished loading??
        ldr.x = Xpos;
        ldr.y = Ypos;
        addChild(myClip);  // why?? it has nothing in it
    function event1Handler(e:Event):void {
        // do whatever is involved with what the "close" event is supposed to do
        trace("goExit function executed");
    As far as what you have in the loaded file, you appear to be trying to pass the files names as if they were parameters.  The file naming should be done at the receiving side for the event handler function for the event listener.  While you could create a custom event that include parameters that you can pass, that's another level of coding that is better left for a future experience.
    Study the following - understand it before you try to use it.
    Below is a link to some files I made for another posting that demonstrates what I have been explaining.  The neurope file is the main file.  Publish the netherlands file so that you have an swf to load for it, and then run the neurope file.  The file that gets loaded (netherlands) only has a button in it that when clicked dispatches an event for which the main file (neurope) has assigned a listener.  The main file displays a message when the button gets clicked in the loaded file.
    http://www.nedwebs.com/Flash/neurope.zip

  • Control main timeline from loaded swf.

    Hi,
    I'm using a textfield for debug information.
    I'm loading an swf on the main timeline and I'm showing the status in the debug textfield.
    function swfLoaderCompleteHandler(event:Event)
         Debug.text +=  "Swf loaded.";
    That works.
    But,
    I'm loading a png file in the loaded swf. , I'm trying to show the status of the png file as I showed the status of the swf.
    function pngLoaderCompleteHandler(event:Event)
         MovieClip(parent).Debug.text += "Png loaded.";
    I can't control the main swf from inside the loaded swf. Even gotoAndStop or calling a function doesn't work.
    Do I need to add something when I load the swf, saying it's a MovieClip or something?
    Here's a fla too. http://flashfocus.nl/forum/attachment.php?attachmentid=9885&d=1282509233

    Thank you! you're brilliant!
    For people with the same problem:
    If you use CS5 and you have a TLF text on the stage, it doesnt work... I think it's a bug. But when I converted my TLF textfield to classic and everything works fine!

Maybe you are looking for

  • Spotlight no longer working on iPad 4, iOS7

    I am installed iOS 7 on my iPad 4. Now Spotlight is no longer working. I do not get any results. Searching for "mail" or a contact does not show anything. Spotlight is enabled in the preferences for all existing information types. How to proceed?

  • Safari & mail Icons will not stay in the Dock?

    Two days ago I noticed that both Safari & Mail icons were not in the dock. I opened applications and returned them, they just vanish, when I open them from apps they both work OK. I have worked round the problem by using an alias and placing that in

  • Topic converts to book in merged TOC

    So, I have two HTMLHelp projects, A and B. I'm trying to include B in A's Table of Contents - here's where I am: B is created and appears correctly when viewed alone. At the top level of the TOC is a book (which links to topic B1). Within that book a

  • Last FM..

    There probably has to be an easy solution to this but how do I set it so "Last FM" doesn't auto open whenever I open iTunes...that is, w/o having to remove Last FM, as I don't want that. Thanks.... Message Title was edited by: Host

  • The procedure entry point cmblockbuffercopydatabytes could not be located

    I just updated to the latest version of iTunes and rec'd this message: "the procedure entry point cmblockbuffercopydatabytes could not be located" I tried downloading iTunes from the Apple web site but still get the same error msg when I try to launc