Loading a SWF in an MC on the maintimeline

I use the component of the tree to hold my options menu to load separate SWFs in my film. The tree is nested within a clip, because I need to open and close using the motion tweens. The content is fed by an xml file and has an url for each label attribute. Problem is that I need the url to open in a video film vacuum so that it is BEHIND the menu. I have an empty movie clip in my main script which has a relationship of _parent._parent to the menu itself. I can't however it loads using loadMovie(url,this._parent._parent.instancename); I tried to create an empty mc with a local relationship to the menu, but he has motion clip loads, but also movements with the menu. No idea how vacuum mc is set to stay, or to load to the main timeline? Thank you!

Just figured it out... I was using a path relative mode and not absolute.
so _root.instancename with mode value is made absolute.

Tags: Adobe Animate

Similar Questions

  • Loader class: How can I go to the specific scenes and frames?

    Is there a way to go to a specific scene and the image in the file that I'm loading using the loader class? For example, I would go to the 3 image in scene 2 of the file I am loading "File.swf".

    Here is the code I use to load the file. Now, I would go to a specific image and scene within the file:

    var LoaderHome:Loader = new Loader();

    LoaderHome.load (new URLRequest ("File.swf"));

    addChild (LoaderHome);

    Question #2

    Also, when I add the file "File.swf" should I remove the film exist for performance/memory management? If so, how would remove a child where the code is another movie?

    Before you can try to manipulate the file, you need to know that it has finished loading.  For this you need to add an event listener to the object/property contentLoaderInfo the loader.  You can then use the function handler for this listener action for the loaded file.

  • Loading a swf into an AS2 clip file

    I had some problems with loading a swf into a clip.  The code I use is as follows

    {We (Release)}
    contentbox.loadMovie("contact.swf",0);
    }

    It works fine on the loading plan, but it loads the swf file so that the upper left corner is at the center of the content area, pushing the bottom and the right side of the way of content off the screen.

    Looks like the contentbox registration mark is centered.

  • Load external swf

    /*
       #############################################################
       ##   Homepage                                              ##
       ##   - Choose from 3 random images                         ##
       #############################################################
    */
    
    // Attach random homepage image
    var rnd = Math.floor(Math.random() * (4 -1)) + 1;
    var homeimg = this.attachMovie("homeimg"+rnd, "background_mc", 1);
    _root.currentContentWidth = homeimg._width;
    _root.currentContentHeight = homeimg._height;
    _root.updatePositions();
    
    
    startContent = function() {
        // nothing to do
    };
    

    It's that I have for my homepage, but I want to load an external swf (lights.swf)

    Can anyone help on how to modify the actionscript code to do?

    Thank you

    This code "attaches" a picture of home page.  If you want to load a swf file, you can use the movieclip loadMovie() method:

    remove or comment your code attachMovie()

    this.createEmptyMovieClip ("homeImageMC", this.getNextHighestDepth ());

    this.homeImageMC.loadMovie ("lights.swf");

  • run the error when go to the "home" button after loading external swf

    I work to develop an Android app to learn Arabic, it's very simple.

    to explain the alphabet, I create and load files SWF external, first and second Chargers work well (loading and when click the buttons there is not any question)

    but the third charger charge well also, but the problem when I test project, I make me run error when press home.

    (it does not occur when you load other chargers)

    Here are the sisters Project.rar Android - Google Drive files

    Thank you

    the problem is in the way that you use to add the listeners to events for the buttons, you add a listener for them different click events each keyframe, so you need to remove the headphones before you leave for another frame.

  • Load external swf and stopping on the 1st frame.

    Hello everyone

    I use following code to display an external swf file on the iPad.

    var request: URLRequest = new URLRequest ("http://< server ip > / test.swf");

    loader = new Loader();

    Loader.Load (request);

    The file load passes through each image and closes the application.

    Y at - it will be a way to stop the 1st frame once the file is loaded and move between the ribs to the?

    Thank you

    If you listen to when the charger is finished, you can stop the swf file:

    var mc:MovieClip;

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, swfloaded);

    function swfloaded(e:Event) {}

    MC = e.target.content as MovieClip;

    MC. Stop();

    }

    Now you can do what you like in this clip. As:

    mc.gotoAndStop ('some ' label');

    or:

    mc.gotoAndStop (10);

  • How to load external swf file and unload the swf file parent?

    I have a question. Let's say I have file1.swf, file2.swf and file3.swf, how can I link this 3 files together.

    Let's assume that file1.swf is the main content file, but as I load file2.swf, I want the file1.swf get replaced by file2.swf. How could unload file1.swf at that time, so that my file2.swf will become the main content file?

    and even once, when my current post file2.swf and I want it get replaced by file3.swf tinkle of a button. so that i can unload the file2.swf and let them file3.swf become the main content file...
    Anyone have ideas on this?
    Thank you..

    If you're publishing to fp 10 + use:

    var loader: Loader = new Loader();

    var urlR:URLRequest = new URLRequest();

    addChild (loader);

    Btn1.addEventListener (MouseEvent.Click, f);

    btn2.addEventListener (MouseEvent.Click, f);

    function f(e:Event):void {}

    {if (Loader.Content)}

    loader.unloadAndStop ();

    }

    {if(e.currentTarget==btn1)}

    urlR.url = "file2.swf";

    } else {}

    urlR.url = "file3.swf";

    }

    Loader.Load (urlR);

    }

    p.s. Please check the useful/correct, if there is.

  • How to pass a variable to a swf file in another using the Loader?

    I'm loading a swf file from another swf using the method as follows:

    var myLoader:Loader = new Loader();

    addChild (myLoader);

    var url: URLRequest = new URLRequest ("myExternalMovie.swf");

    myLoader.load (url);

    How to pass a variable to the first SWF in the second?

    I'm not sure that "passage" is a term there, given that this generally applies to what happens with functions that can host variables to pass as arguments in the.

    When using the charger, you can assign an event listener to determine whether the activity of loading is complete and have an event handler that targets its contentLoaderInfo property to the event.currentTarget.content, which in your case would be the loaded swf file.  At this point, you can assign a value to a variable in this swf file by targeting...

    var myLoader:Loader = new Loader();

    addChild (myLoader);

    myLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, loadComplete);

    myLoader.load (url);

    var loadedSWF:MovieClip;

    function loadComplete(evt:Event):void {}

    loadedSWF = MovieClip (evt.currentTarget.content);

    loadedSWF.someVariable = ';?

    }

    It is probably possible you may also have the loaded swf the value rtrieve by targeting to the parent swf file, which would be both parents away because of the charger is the relative of the SWF loaded... unevariable = MovieClip (parent.parent) .someValue;

  • Help with loading a swf from the Google Map API done in AS3 AS2 Flash site

    OK, maybe this can be done, I need to do everything in AS3, or it is a problem of the Google Map API.

    If someone could put me on the right track, I would be grateful.

    I created a Google Map API for Flash Add to my Web site.

    My site has been built using AS2 and the Google Map API was built using AS3

    My site Flash .swf works fine and the Google Map.swf, I created works very well.

    The problem is when I try and do not add the Google Map.swf on my website flash As2 will Google.swf no work.

    I'm trying just to eliminate the error.

    Is it because that...

    1. after having my site flash with AS2, I can't add a .swf with AS3

    2. I need to change the code...

    3. it has nothing to do with AS3, it's because this is a Google Map API.


    I have a button written in AS2 on my main flash site that has a a PreLoader.


    on (release) {}

    Stop behavior MovieClip
    this.gotoAndStop ("Google_Map");
    End behavior


    load film behavior
    If (this.mcContentHolder is {Number (this.mcContentHolder))}
    loadMovieNum ("PreLoaderGoogle.swf", this.mcContentHolder);
    } else {}
    this.mcContentHolder.loadMovie ("PreLoaderGoogle.swf");
    }
    End behavior
    }

    The PreLoaderGoogle.swf was then has a

    Instance of: charger

    contentPath

    Google_Map.swf

    If I change the Google_Map.swf instance in the PreLoader for an another .swf using AS2 it all works.


    or do I just have the wrong end of the stick.

    All advice appreciated.

    If you load an as3 swf into an as2 swf, none of the code in the as3 swf file will work.

    the simplest way around this is: you could create a loader swf (GER) as3 that loads your as2 swf and load your google as3 swf.

  • How can I load a .swf into all the customer?

    Hello world...

    I load a .swf file in all connected clients by pressing a button from another customer.

    Please, help me...

    Emiliano.

    Emiliano,

    What I see wrong in your code is lines like this:

    myLoader.load (new URLRequest ("myParam"));

    If you don't do that you try to load a file called myParam on your server. Try this:

    myLoader.load (new URLRequest (myParam));

    You will then load the file name, your server has sent to your customer.

    On the embeded Apache, when you install FMS Setup asks you whether you want to install a bundled Apache server. In this case you will find the Apache server inside FMS application files and it will be configured for the HTTP proxy for it. To be brief, FMS listen on HTTP port (80) and Apache on port 8134 (default). When FMS receives an HTTP request post it Apache on port 8134 on localhost and the Apache line is sent to the client. So if you need load a SWF over HTTP so it's how it's done.

    The 'train' film is a FLV video that you see on a mini-site comes with the installer of the FMS. When you install it by default your server contains on its base address, port 80, a HTML page where you can see the FLV video. It's a beautiful country side with an old train upview passing. When you read the FMS installation program is how you can check your FMS server and Apache are running.

    If you have installed Apache after FMs that you must do 3 things:

    1. Edit you Apache httpd.conf so that he listens to a port other than 80 (say 8134). Just add the line "Listen 8134" when the httpd.conf file refer to the parameter "Listen."
    2. change the configuration of your FMS applications of HTTP proxy on your localhost, port 8134.
    3. then stop FMS, restart Apache and start FMS then they enter in a port conflict listens.

    See the documentation for the SGF in the Administrator's guide to look at where you can do for the FMS proxy configuration.

    See you soon,.

    François

  • Loading one .swf in another on the top layer

    I load a drop-down list on the file menu in another animation. It works except the menus should fall on the animation below. As the images change in the low-level animation they hide menu drop-down that appears.

    The command I use to load the menus is as follows:

    var myLoader:Loader = new Loader(); addChild (myLoader); var url: URLRequest = new URLRequest ("ncjhs_Menus.swf"); myLoader.load (url);

    I need to load menus - with all its layers - in the surface layer. Is there a simple way to define the target layer during the loading of a movie? I guess you must specify a container/object target in the target...?

    Thank you
    Sam

    You can create a displayobjectcontainer (like a movieclip), add it to your main timeline and then add all your animations to this movieclip.  If you add your charger to the main timeline after this movieclip is added, your menu appears above all your animation objects.

    There are other ways to accomplish the end although, depending on your configuration, there may be better ways to do it.

  • With the help of a ClassLoader to load several SWF files?

    Hello community,

    Pulling my hair out on this one. I want to use a single charger (from the class Loader) to, in order, load a SWF to a single movieclip on the stage. I have a charger that I want to load external files: 'peel0.swf', 'peel1.swf',..., 'peel9.swf' in 10 corresponding clips (that already exist on my scene): 'peel0_mc', 'peel1_mc',..., 'peel9_mc '.

    The problem with my code is that it does not load, but the last peel. Everything seems to be cranking away as you like, until I have look at the contents of my peeling - only the 'peel9_mc' Gets the external file "peel9.swf" in charge. When I slow down things with 'Simulate download' I see the 0-8 "peelX_mc" loaded with the correct SWF but when the 'loop' moves to the next line, it disappears from the mc. It's as if the *.addChild method does not stick.

    Any input would be greatly appreciated,

    -john

    VarioPegged!

    Yes! It worked like a charm. I do * love * this community.

    I sincerely appreciate your time and efforts to help me.

    Kind regards

    -john

  • loading external .swf in the scrolling text box

    I have a scroll in HTML box. Can I use some of the text in the html file to load a SWF extrenal, a href = something.swf - or via actionscript link? And if yes, how and what is the script? Thanks, Mamaglee

    Yes, see the asfunction().

  • Help! How to load several SWF files by using the following code?

    In stock for 1 frame:

    ( var myrequest:URLRequest =new URLRequest ()'A.swf'();
    ( var myloader:Loader =new Loader()();
    myLoader. load () myrequest ();

    img1. addEventListener () MouseEvent. ( CLICK, button click();

    ( function button click ()event: MouseEvent ():void{ }
    Stadium. addChild () myloader ();
    }

    img1.addEventListener (MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);

    function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void

    {

    gotoAndStop (13).

    }

    In action to frame 13: (img2 is another button)

    img2.addEventListener (MouseEvent.CLICK, unloadFunction);

    function unloadFunction(event:Event):void {}

    stage.removeChild (myloader);

    }

    you want to load another swf (for example, B.swf) when you are in frame 13 and img2 is clicked?  If so, and you do not want A.swf continue to play, use:

    In action to frame 13: (img2 is another button)

    img2.addEventListener (MouseEvent.CLICK, loadF2);

    function loadF2(event:Event):void {}

    myLoader.Load (new URLRequest ("B.swf"));

    }

  • Problem with loading external swf files

    Hello

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

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

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

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

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

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

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

    Best regards

    Agata

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

Maybe you are looking for