Load SWF file in main SWF with parameters

Hello everybody,
I recently got a new flash Application which is a Photo Gallery.
This App is made of multiple folders (source files), a FLA file, a SWF with its javascript SWFObject and an Html page which instantiate this App with some parameters (size, config file path, ...).
It needs an XML file to find all the Photos it displays, to do it I need to configure my application in the HTML Page and give it the "xml_path" :
var so = new SWFObject("index.swf", "gallery", "249", "249", "10", "#111111");
so.addVariable("xml_path","load/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
so.addParam("allowfullscreen","true"); 
so.write("flashcontent");
By the way, I have a second application, the WebSite, which have to display the Gallery SWF in its "Gallery" page.
Here is how I do it at the moment (in ActionScript3) :
var swfRequest:URLRequest = new URLRequest("C:/......../Galerie/index.swf");
var swfLoader:Loader = new Loader();
//Charge le SWF Galerie dans le SWF Site
swfLoader.load(swfRequest, context);
container1.addChild(swfLoader);
//Positionne le SWF
swfLoader.x=10;
swfLoader.y=120;
It successfully loads the Gallery application but It shows an error telling me it doesn't find the XML configuration file... In the HTML file I simply had to write the "so.addVariable("xml_path","load/config.xml");" to tell where the XML file is...
So, my question is : How can I integrate my SWF application giving it some parameters like above, in Action Script 3?
Thank you ,
Patrick

No, nothing with HTML.
I have 2 SWF applications. One is the Gallery, and the second is my Main Page.
My Main Page must integrate the Gallery module in one of its page.
The problem is when I try to integrate it, I think I must give de future loaded SWF some parameters like this :
(My Main SWF loading in HTML)
var so = new SWFObject("WebSite.swf", "flashcontent", "520", "700", "10", "#111111");
so.addParam("allowfullscreen","true");
so.addParam("allowScriptAccess","always");
so.addParam("menu","false");
so.addParam("wmode","opaque");
so.addParam("bgcolor","#000000");
so.setAttribute("id","flash");
so.write("flashcontent");
It was for the Main App. For my Gallery SWF I had to load it like this (in HTML) :
var so = new SWFObject("Gallerie.swf", "gallery", "249", "249", "10", "#111111");
so.addVariable("xml_path","Galerie/config.xml"); // this line is adding the path to the xml file make sure that it's name is xml_path
so.addParam("allowfullscreen","true"); 
so.write("flashcontent");
So at the beginning I had 2 different projects with an HTML page for each.
Now I wan't to directly integrate the Gallery SWF into the Main SWF. And as you have seen I must give it some parameters such as the "xml_path" and "allowfullscreen". This must be done in ActionScript 3 and I don't know how...
I think I have to use FlashVars but I don't know how. As I said before, I have tried using the loaderinfo.parameters, but it is in read-only...
Do you have an idea of how I can make it work ?

Similar Messages

  • Loading external swf files in a swf - Error#1009

    I have been having trouble using a swf file within a swf file.   The external swf files all work as expected.  However when used within another swf file I get the standard TypeError #1009 for some of my swfs.   The external swf files are mainly actionscript 3 files.  A typical swf file will have an object (or objects) in the library which has an export for ActionScipt property enabled and an addEventListener(Event.ENTERFRAME, somefunction).   About four years ago when I had to do some work with AS2 I seemed to get around a similar issue with the _lockroot method but this is no longer part of AS3. I have searched various forums and note that I am not the only one with this issue but did not find any relevant solutions.   If anyone could give me any ideas on how to get around this it would be appreciated.
    Regards
    Norman

    Hi,
    I have added a download to rapidshare and its link is:
    Download link: http://rapidshare.com/files/380202712/ExtSwfs.zip
    The main file Training01.fla has been set up with links to download several swf's.   The links that do not work properly are those labelled :  Module6 and Module 8.   The first Module 6 connects to a function that is a variation of how I was trying to load external swfs using Application Domain, while Module 8 is a link to a swf that uses and external class.  Module 8 is supposed to load with rotating stars, while Module 6 loads the same file as the link called Module 1.   As soon as I use the two links Module 6 or Module 8 the whole lot ceases to work properly.  I did also follow through the examples on the Adobe site.  The examples for Module 6 and Module 8 are tutorials I have used from the Internet as part of my training from the site FlashMyMind.com but they replicate the type of work we have been doing with respect to using ActionScript3.
    Re my background, at this stage I am self-taught using tutorials on the web and whatever books I can lay my hands on here.  There is no structured training available where I live as there is insufficient demand and no books available on Flash or ActionScript at the local book stores or libraries so the books are ones I have ordered via the Internet.  The one I am currently using apart from Adobe Classroom in a Book Flash CS4 is O'Reilly's Learning ActionScript 3.0 a Beginners Guide.
    The other problem I have been trying to solve and still researching is why one loses sound in the flash player when playing flv files, if the user has selected or restarted a video (or videos) many times eg 25 to 30 times as we create video training files and serve them to the user within the flash environment using Flash Player 9 and IE6.
    Regards
    Norman

  • How to load swf files within another SWF and still maintain actionscript

    Hi I was wondering how to embed an swf file inside another
    swf file, If i simply import it to the stage or the library it will
    become a symbol but the actionscript interactivity is lost, another
    question is can I have an actionscript 2 file play within an
    actionscript 3 file?
    The actionscript 2 code for embedding is something like this:
    don't mind the _mc titles
    this.cargame_mc.onRelease = function (){
    loadMovie ("Crusty Rusty's.swf", empty_mc)
    empty_mc._xscale=60;
    empty_mc._yscale=55;
    empty_mc._x=210;
    empty_mc._y=140;
    Please Help its for my uni portfolio, i want to use as2, but
    if i do i would lose the 3d possibility of as3, is there any way to
    export an as3 file and then embed in as2, using a program or
    anything? Thanks!I
    I would just like to say thanks in advance because everyone
    on here is so helpful!

    you can load an as2 file into an as3 file (using the loader
    class) and the actionscript will work in both.

  • How to call a .swf file in another .swf file?

    Hi all,
    I am new to flash and ActionScript3.0. Presently, I am using
    flash CS3 and the code I need is in ActionScript 3.0.
    Suppose, I have a .swf file(viz., file1.swf). Now, i am
    developing one more .swf file(viz., file2.swf), in which I need
    to execute file1.swf when a CLICK event is listened on button
    present in second file(i.e., file2.swf).
    In how many ways, we can get this.
    And, please I need code very urgently.
    Help me.

    You use the Loader class to load external content like swf's
    or images. If
    you click the main entry for Loader Class in the AS3 help,
    there's an
    example of loading an external swf.
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Linking SWF file in another SWF file

    Hi All,
       I need to open  a SWF file by clicking a a button in another SWF file(both SWF files are in the same folder). Can I use URL button(in Xcelsius 2008) for getting this done?

    It is possible to use the URL button to open another SWF file.  The SWF file would need to be hosted with an http address.

  • Making xml playlist to play swf files inside one swf

    Hi,
    I have made an swf file and xml playlist.
    I want to include swf filepaths in xml playlist so i would be able to choose from my the list, which file i want to play.
    My list-component reads data from the xml, but i cannot get the swf files open there.
    I will attach my .fla file so you understand what i'm talking about.
    the .fla:
    http://www.mediafire.com/file/m24dz0gmzwz/Untitled-1.fla
    xml file:
    http://www.mediafire.com/file/gdyzzymy5mn/swfList.xml
    would you guys look at my files? i know i can play .flv files but i want to know how to play swf files inside another swf. The swf files should be loaded to  by the xml list.

    Hi
    we want to give some clarifications
    As per our requirement we need to play same swf file ( about
    5 in number) always.
    These swf files are kept in some folder and during run time
    we need to play these swf files inside our Mac / windows
    application using flash player.
    we don't need to play any swf file, but the same swf files
    we need a api / sdk to implement this
    Any help will be very well appreciated
    Sudesh

  • Trouble loading external .SWF into my main page with preloaders

    Dear All,
    I am working on my first Flash project with AS3.
    The structure of the flash site is pretty simple. I have a
    stage 1165px wide x 710px height
    Inside my Stage I have an horizontal bar with a menu followed
    by a container right under.
    **** My goal
    is that whenever I click on one of the button on the menu, that the
    related external .SWF loads into
    the container with a preloading bar and %. *****
    I already did all my .SWF files and it is pretty frustrating
    at this point to be stuck at this point of development.
    Please help.
    -Alex

    Visit gotoandlearn.com. There is a video tutorial there
    regarding preloading that should answer most, if not all, of your
    wonderings.

  • Load external SWF file into another SWF

    Hello all.
    I've tried loading a .swf file externally into another .swf file on my  local drive, and it works. Now, when I try to Simulate Download, the  preloader in the 2nd file doesn't get played and the images in there  take a while to get displayed.
    I need to load a .swf file from a server into the parent .swf file(I'm  working on using a "thin flash file" for added security for the company I  work for - blank file which loads the content from another file on  their server).
    So far, I have:
    try
        var myLoader:Loader = new Loader();
        addChild(myLoader);
        var url:URLRequest = new URLRequest("newBook.swf");
        myLoader.load(url);
    catch (e:Error)
        trace("ruhroh");
    When I replace the "newBook.swf" with the URL of another .swf, there's just a blank page.
    I'm not too sure how to proceed, and I hope you will be able to help me out. I'd greatly appreciate the help.
    Many thanks,
    -Nazgul

    What happens is...when I set the speed to DSL(32.6kbps), the screen is blank and the preloader doesn't show up. It just goes directly to the Main screen. And then, the pages inside don't get loaded properly.
    This only happens when I try to Simulate Download.
    But that's not really the problem. I need to load a .swf file from a server into another .swf file, and just adding the link to the child .swf isn't working.
    Anyway, thanks for your help
    -Nazgul

  • SWF file doesn't open with Flash Player

    Hi,
    1) I have a swf file on my desktop. Where in my computer should i go to launch Flash Player in order to play the swf file? When I double click on th swf file, it launched Adobe Flash, rather than Flash Player.
    2) Furthermore, I have just uninstall Flash Player and re-install the latest version, as the safari browser confirms that I have the ver 14 of Flash Player installed. When I check my Adobe Flash folder, it still has the old Flash Player. How do I get this updated?
    3) How can I get the recently installed Flash Player app into my applications folder?
    Thank you

    Thank you for pointing out that I need to download the projector. How do I ensure that every time I double click on a swf file, it does not launch Adobe Flash Professional, but instead, it launches Flash Player ver 14. Do I have to place the Flash Player Projector in the library or applications, where exactly should it be placed.
    Next, when I launched Flash Player ver 14, to open the swf file, I clicked on a button that is linked to a website - I get a message:
    "Adobe Flash Player has stopped a potentially unsafe operation,... To let this application  communicate with the Internet, click on settings" I clicked on settings and get the attached panel, which does not make sense to me. And I cannot launch a website by clicking on the button contained in the swf file. Please advise.
    I am using a Mac Book Pro, OSX 10.9.3

  • .css and .swf files are getting generated with Ibot email

    Hi Team,
    I have an Ibot which use to run on daily basis which contains graph and normal table views, .css and .swf files are getting generated and attached with Ibot email to the users. I'm facing this issue from last two days. Earlier there was no such attachments sent to the users.
    Could anybody let me know what might be the reason for that?

    any inputs?

  • How can I control a button from one swf file to another swf file?

    Hi,
    I have a main.swf file. From that file I am accessing the external.swf file which is an external file.
    Now, how can I write code on my main.swf file for the button which is on my external.swf file?
    Activities.MainPanel.close_btn.addEventListener(MouseEvent.CLICK, btnClickClose);
    Activities.MainPanel.close_btn (This buttons is actually on external.swf file, but I want to write code on main.swf file to execute it on external.swf) how can I control one swf button on other swf file?
    Thanks.

    Here's some example code that you should be able to adapt to your needs.
    // create a new loader object instance...
    var loader:Loader = new Loader();
    // make the download request...
    var request:URLRequest = new URLRequest("external.swf");
    // add a complete event listener to the loader
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    // start the actual loading process...
    loader.load(request);
    // create a new empty movieClip instance, you will put the loaded movie into this movieClip once its loaded
    var externalMovie:MovieClip;
    // this function is called when the download has finished and the file is ready to use...
    function completeHandler(event:Event):void {
       // set the contents of the loaded movie to the new empty movieClip...
               externalMovie = MovieClip(event.target.content);
       // add this new movie to the display list...
       addChild(externalMovie);
    Now you can refer to the loaded movie with the instance name "externalMovie". So if, for instance, you want to address a button in the loaded movie, you could write something like this on the main timeline:
    externalMovie.addEventListener(MouseEvent.CLICK, btnClickClose);
    function btnClickClose(event:MouseEvent):void {

  • I need to access/pass variables'(s) of a .swf file into another .swf file.

    Hi all,
    I have basic knowledge of Flash and AS3.0.
    Suppose i have a flash swf file(main.swf). In this main.swf
    file, i loaded another swf file(sub.swf) by writing the following
    code snippet in main.swf file as shown in Attach Code:
    Now, how to acess the data present in main.swf into sub.swf.
    Note: Here data represents values/data stored in
    variables/objects of main.swf file.

    Does this actually work -- assigning variables directly on the loader?  I'm interested in setting flash variables on the loaded SWF, but I get a compilation error when trying something similar:
    Error: Access of possibly undefined property x through a reference with static type flash.display:Loader.
         [exec]
         [exec]             textLdr.x = 50;
    I also tried casting the loader to Object, which compiles but then fails at runtime.
    -Dave

  • Joining several swf files into one swf file

    hello everybody
    i've been dealing this issue for too long and decided to ask for  help - how can I unite 15 swf files which placed in one folder to a one swf file???
    i tried all kindes of merging softwares like "Join (Merge, Combine) Multiple SWF Files Into One Software" and "WinMerge" without success and tried to convert swf to flv (cause i found other merging software for flv files) but again...
    I have CS5 so if i'll have to open Flash for this i will, though i'm trying to avoid that and even then i'm gonna need full instructions.
    All i need is this simple thing so i'll appreciate very much any help
    Thanks & Good Day
    Keren

    Hi Ned
    Again - thank you very much.
    I've got the source files and i'm on the run now.. kind of..
    I did as you recomצended and used a code from one of the AS3 UILoader tutorials , and it seems to work:
    import flash.net.URLRequest;
    import flash.events.ProgressEvent;
    import fl.containers.UILoader;
    var myLoad1 = "fastflipPage.swf";
    var request:URLRequest = new URLRequest(myLoad1);
    loader.scaleContent = false;
    loader.addEventListener(Event.COMPLETE, completeHandler);
    loader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    loader.load(request);
    loader.load(request);
    function progressHandler (event:ProgressEvent):void
    status_txt.text = "Percentage Loaded" +
    Math.round(event.target.percentLoaded);
    function completeHandler (event:Event):void
    status_txt.text = "Loaded Done";
    So... i'm tring to find some answers to my next step : in the code above im loading only one file and i need to load 30 files so they could play one after another. i noticed that i can create many uiloader instances and load several external SWFs in the same scene without writing a script to each one of them... is that right? and if so, how can i do that???
    I'm full of hope to figure this task, meantime will look for more answers
    Thanks in advance
    Keren

  • How to call swf file within another swf file using xml

    hii,
    I am facing some problem to call a swf file via xml when this xml file loaded it calls another swf file which includes a new xml file. now if i call this nested swf calling without xml it works but in case case of xml it is not showing the result. i m confused. how to nested xml file calling done in as2/as3. i need some logics. thanks in advance

    This is the AS3 forum and your posting involves AS2 code.  You should repost in the AS2 forum...
    http://forums.adobe.com/community/flash/flash_actionscript
    Aside from that, your problem might lie in the following lines...
    _root.createEmptyMovieClip("sub_container1", 1);
    loadMovie(sub_SWFPath[1].attributes.url, "sub_container1");
    You create the new movieclip, sub_container1,  in the _root, but you do not assign the loadMovie to load into that same movieclip (unless you have a _lockroot = true assigned in your sub-swf).  In any case, you should repost in the AS2 forum to pursue resolution.

  • Loading html file that is stylizied with css in Flash

    Anyone know of any tutorials of how to do this with AS3 or give me a quick break down of how to load html files?
    Thanks.

    Have a look at these example files. Its not a tutorial, but it should get you started.
    http://www.ddg-designs.com/downloads/importedTextwithCss.zip

Maybe you are looking for

  • OHW Top-Level entry in tree-based TOC navigator

    Hi Team, Is it possible to specify the text string in the "Top Level" location? We would prefer to have our product name rather than the words "Top Level". We are combining multiple helpsets through a master helpset file. The <title> string from each

  • Not able to login from front-end

    Hi, My application was running on https previously.Now I have configured it to run on http. I executed AutoConfig after making changes to the context file. It comlpeted successfully. But when I tried to open the login page it showed 500 internal serv

  • Maxl Import - Export L0 data crashes

    Hi to all,We have an automation Maxl script, for a mission critical application where we export 6 times a day all L0 data, then import them back again, .It has been running for sometime smoothly, but suddenly it startet to crash, meaning it doesnt ex

  • Program different on re-compile

    Hi, I downloaded the open source project Guitar Tuner (http://sourceforge.net/projects/guitartuner/) Inside it there is an index.html file, a TunerApplet.jar file and a TunerApplet.java file (As well as some images and GPL etc.) When i open index.htm

  • Captivate, Flash, & Authorware

    I know you can import a published SWF file, but... Is it possible to import a captivate or Flash 8 library directly into Authorware? -- Ken