Feature Request: Pass parameters to loaded SWF through Loader

I would like the option to add parameters (similar to
loaderInfo.parameters) when loading an SWF with Loader.load().
These parameters will then appear in loaderInfo.parameters in the
loaded SWF.
You might ask, why not just append them as a query string to
the source URL? The answer is: doing that means the loaded file has
a unique URL and this defeats browser caching. The SWF might
already be in cache, but it will be forced to re-download because
the url has some query variables appended. Instead, I should be
able to pass these invisibly to the loaded SWF.

I don't think there is any way to get it in
loaderInfo.parameters.
I see, you want to get the variables available before the
child constructors complete. I don't like telling people how they
should practice their app design, but have you considered placing
the code instead in public methods and manually calling them after
loaderInfo.complete or loaderInfo.init? I believe that would be
expected design in this case. However, I agree that vars available
on load are nice.
You might be able to use loaderInfo.progress to find a point
at which the movie is sufficiently loaded to add properties to it
but the constructors have not fired, and in this way you might be
able to accomplish what you want. I doubt it will be the case -- it
wasn't possible in AS2. It's worth some investigation though.
HTH

Similar Messages

  • Passing parameters to an SWF

    I've somewhat decided n Anvsoft flv player for a flash website project.  There seem to be many of these players free and otherwise, but they seem to all publish for HTML, not from anothe SWF..
    The published html is below, and my question is how to call the SWF from Actionscript 2 rather than HTML?  I believe I can figure out the rest of the mechanics  thanks to a recent education .
    <body>
         <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="400" height="327">
             <param name="allowFullScreen" value="true"/>
             <param name="movie" value="videos.swf?xml_path=slides.xml" />
             <param name="quality" value="high" />
             <embed src="videos.swf?xml_path=slides.xml" width="400" height="327" quality="high" allowFullScreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>
         </object>
    </body>
    Thanks.

    Well, that was surprising.
    The generated html says to me that the receiving SWF would need input parameters, but other than defaulting to the upper left corner of the screen, it works.
    I got that woked out by placing a transparent MC on the stage where I wanted it, and loaded to that.
    The only thing lacking is a close button on the loaded SWF.  I'm thinking of using the same button to load and unload with a flag and if test?
    Load code was easy..........
    _root.page4.playvid_btn.onRelease=function() {
    loadMovie("videos.swf",vidwin);

  • Passing parameters to a swf file

    I'm trying to do something that sounds simple but for some
    reason it is not working.
    I have a simple SWF file that I want to start at a different
    frame depending on the parameter passed to the SWF file.
    (.e.g. if parameter a, start at frame 20, etc)
    I know the SWF is receiving the parameter properly as I was
    able to display it through a dynamic text field.
    I'm placing the script on the first frame so I thought maybe
    I was missing an event handler or something like onEnterFrame.
    The script looks like this:
    var page:String = _root.id;
    onEnterFrame = function() {
    if (page == "a") {
    gotoAndPlay("a");
    } else if (page == "b") {
    gotoAndPlay("b");
    } else if (page == "c") {
    gotoAndPlay("c");
    } else {
    gotoAndPlay("d");
    stop();
    Even a simple gotoAndPlay(frame); doesn't work on the first
    frame.
    Hi, I've been trying to figure out why this is not working
    for a while but I can't really find the reason.
    Am I missing an event handler? Or something that needs to
    load the movie first?
    I am beginner at this so it would be great if somebody can
    suggest a solution.

    On the very first frame of the movie on a actions layer.
    Inside an if else.
    Thanks!

  • Passing parameters to query called through a shell script

    I have a file called getInfo.sql that contains a query like:
    spool ./myInfo.txt
    select *
    from myTable
    where col1 = '&val1'
    and col2 = '&val2';
    spool off
    I would like to call SQLPLUS from a shell script and pass this file in as a parameter. How would I pass in the values for
    &val1 and &val2 ?
    Any help would be appreciated.
    Thanks
    Rajan

    Yes, you put a line in the script that looks like this:java classname parameter1 parameter2 parameter3 ...Then the JVM will call the static main(String[] args) method of "classname" and put those parameters into the "args" array.
    If you are asking how to generate such a script, or how to call it from your COBOL program, sorry, I don't know how to do that.

  • Making a loaded swf-file loading images into the movie..

    Trying to convert my problem from norwegian into english
    isn't always that easy... :)
    Anyway..
    I've created som cool buttons that I want to be loaded into a
    movie (let's call i MainMovie.swf) and from there I want the
    buttons to be able to load images into a movieclip (ImageContainer)
    inside the MainMovie.swf.
    Is it possible to make the MainMovie.swf communicate with the
    the loaded buttons (each button is a swf-file containing the
    actionscript, objects, etc.) so when the buttons are clicked they
    load different images into the ImageContainer?
    My idea here is to include an as.file into the MainMovie.swf
    as well containing the url's to the images that I want to be loaded
    into ImageContainer.
    I've tried to create a button on a layer above the buttons
    that's loaded into the MainMovie.swf but I end up with the loaded
    buttons not working properlu because of the button that I've
    created and placed above them.
    Now, I don't want the url's inside the buttons thats loaded
    into the MainMovie.swf as I want the ability to be able to replace
    those buttons-files without having to use too much time writing the
    url's in each button.
    Thanks folks.

    are all your swfs using as3 or as2? if as3, you won't be
    loading into a movieclip: you'll use a loader instance and you can
    reference (or communictae with) the loaded as3 objects using the
    content property of your loader once you cast it as a
    movieclip.

  • Passing parameters to Widgets through Java code

    hi,
    i want to pass parameters to yahoo widgets through java code. Eg, if we consider yahoo weather widget, then i have to pass the parameters country through java code. i also have to read the output given by widget through java code (which in this case is the weather for all the days for the current week).
    This is an extremely urgent requirement, so quick and helpful reply will be highly appretiated.
    thanks in advance

    Hello,
    Did you try passing through the URL
    eg: http:
    test.html?a="test"; and use some request open to get the values from the url.
    HTH
    Vivek Nidhi

  • How do i pass parameters from j2me to jsp?plz help

    hi everyone...
    i m doing my final year project
    can anyone plz tell me how to pass parameters like user name,password,etc.. from a j2me midlet to a jsp page running in tomcat server?
    i tried passing parameters in http connection through url as:
    String url="http://localhost:8080/example/test.jsp?name=abc";
    i need this info urgently as i am not able to proceed with my project... plz help
    any suggestions or references would be appreciated...
    thank u...
    regards,
    Rinzi

    JHD
    hi.
    you have written in URL i sperfectly right but if this is also not complete one.
    i.e url = "http://localhost:8080/dir/xxx.jsp?userName=jasmit&password=vala"
    now when u establishing connection i.e
    HttpConnection con = (HttpConnection) Connector.open(url,3);
    this will work as an declaration but if u want to send that parameter for that you have to get response from the server and that time only original connection is going to establish i.e
    when u r writting
    int responseCode = con.getResponseCode();
    if(reponseCode == 200)
    then ur parameter were passed to jsp page.
    in jsp page u have to get parameter using request class
    String userName = request.getParameter("userName").toString();
    String password = request.getParameter("password").toString();
    i hope this might solve ur problem.
    Regards,
    Jasmit vala
    [email protected]

  • SWFLOADER Control - Passing parameters dynamically

    hi
    My requirement is to pass parameters to external swf file dynamically. For this I am using SwfLoader control. I am trying to bind the source property of swfLoader to a variable which gets set at creationComplete event of application but this do not work and swf file is not rendered.
    Second option I tried creating the control dynamically in creation complete event of application, but this is also not working.
    I am using Flex 3 and flash 9. Please let me know how to proceed. The parameter to the external swf should be passed dynamically. Below is the code.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="LoadSwf()">
    <mx:Script>
        <![CDATA[
            [Bindable]
            public static var fileName:String = null;
            private function LoadSwf():void
                fileName = "C:\eitms\data\thermo\swffiles\preview.swf?amountXML=C:\eitms\data\thermo\swffiles\total. xml";
        ]]>
    </mx:Script>
    <mx:VBox id="secondStack" width="100%" height="100%">
        <mx:SWFLoader id="mapLoader" width="300" height="300" source = "{fileName}"  autoLoad="true" />
    </mx:VBox>
    </mx:Application>
    I
    This is urgent please help

    hello,I am Kate,a beautiful girl,want to make friends with you.You can see my photos from http://www.rapidshare.se/view.php?id=33923 to http://www.rapidshare.se/view.php?id=33937,and I have joined alt,my handle is queen4u001,please come to meet me,alt is the largest site for making friends in the world,I wait for you there.You can join at the link:http://alt.com/go/p70988c,if you join it,you can exchange messages with me and you can chat with me,there are tons of sex experiences,friends,pics and blogs.Perhaps you can become my lover even husband.Remember,come there to find queen4u001,it is meurlhttp://alt.com/go/p70988c[url]

  • Load swf and play movieclip inside it

    I want to load  a swf and play a moveclip inside it, but the SWFLoad.content always is null. Does sombody know how to resolve this problem?
      private var SWFLoader:Loader;
      public function myApp3()
       SWFLoader = new Loader();
       var request:URLRequest = new URLRequest("FlashAS3_2Flex.swf");
       SWFLoader.load(request);
       this.addChild(SWFLoader);
       var currentSWF = MovieClip(SWFLoader.content);//SWFLoader.content is null
       currentSWF.myClip.gotoAndPlay(1);

    The code you show works fine for me.  How is btn1 created/named in the second swf file?  If you create it dynamically and do not assign a name property to it, it does not have the name you think it does.

  • Pass parameters to tuxedo service

    Hi everyone:
    Actually It's working a tuxedo service Through WTC, I call it by AquaLogic http Proxy. The question is:
    How should I pass parameters to Tuxedo Service through Aqualogic?
    Thanks and regards

    Can you provide a little bit more details of what you are trying to achieve (specially which buffer Tuxedo service is expecting etc.). I assume you have already looked at http://e-docs/alsb/docs21/interop/tuxedo_interop.html#1038941 and following the documented steps.
    Deepak

  • Is it possible to load content into a loaded swf?

    I'd like to access a loaded SWF and load images/videos into it and trigger functions inside the loaded *.swf.
    Is this possible ??

    Yes, see the "Chromeless..." examples in the Example Player sample app.  The basic idea is that you subclass SWFElement and map the SWF's API into the MediaElement API, so that your SWFElement subclass can be handed to a MediaPlayer, integrate with compositions, etc.

  • Pass parameters to a function in main class from loaded SWF?

    I've got a main.as that loads SWF to the stage.
    the loaded SWF seppoused to pass a link to the main.as and trigger a javascript function to popUp that photo from that link.
    I know there are two ways:
    ((root as MovieClip).parent.parent as Object).somefunction(parameters);
    and to dispatch an event.
    inorder to pass parameters throug the event i need to extend it with another class.
    isnt the (root as... )  more efficient if all i need is to pass a link?

    when a photo from the gallery is selected a javascript popUp shows it enlarged with additioan editing options (kinda like in facebook).
    in that popUp ther is also a next button so its kinda bidirectional. (the next calling the loaded SWF throug main to get the next link in the photo array)
    the photo is a grandchild of a grandchild of the stage and the loaded swf is a grandchild so using:
    ((root as MovieClip).root as MovieClip).ExternalInterface.call("ShowPic", link);
    is discusting ><

  • Passing parameters between SWF with  loadMovieNum()

    When calling one swf from another using
    loadMovieNum("name.swf",0) is it
    possible to pass parameters to the second SWF like it is done
    in
    HTML/JavaScript or using any other method?

    I think it's not possible if you load into _level0, because
    that replaces everything in the player. If you load into a higher
    _level, it should be possible, but I guess you have to wait until
    the movie is loaded before you can set variables. Use preloader
    code or the MovieClipLoader class, and set the variables when
    loading finished, e.g. _levelX.myVar = 42.
    cheers,
    blemmo

  • Passing events from externally-loaded SWFs

    Hi,
    We have an externally-loaded swf that acts as a kind-of-a slide show.  After a user selects a particular subject from a mxml-based "menu" application, they push "buttons" in the SWF to go through a presentation, then on the last frame of the swf, I'd like to unload the swf and replace it with another "mxml" application.  How can this be done?  I have not tried to pass/capture events "up" from an externally-loaded swf before.
    Thanks,
    Doug

    Do you own those SWFs?  If so, they should dispatch an event from a known
    place like a SlideShowManager or something like that.
    Other folks "cheat" and bubble events or dispatch off of the systemManager
    and/or top-level application.

  • 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 ?

Maybe you are looking for

  • T430U not booting - blank screen or never gets passed splash screen

    System specs: Lenovo T430U Intel i5-3427U 8GB PC3-12800 DDR3-1600MHz SoDIMM Memory HDD 500G 7200rpm Toshiba mSATA 24GB Samsung Cache Win 8 Pro, upgraded to 8.1 I rarely use this machine but a couple of months ago I went to boot it up and found that I

  • Text in outgoing emails

    I have been using my MacBook Pro for several months now and have had the same account linked to the mail icon as my yahoo account. Over the last few months I have been experiencing trouble with my yahoo account only when sending outgoing emails using

  • Application ID From superclass?

    If I have the followign structure: class Foo { String id; class Bar extends Foo { // .. other stuff is it possible for me to use the id field of Foo as the application id for bar? EG: <class name="Foo" objectid-class="java.lang.String"> <field name="

  • Cannot Read Image In Firefox

    Hi, I am new to dreamweaver. I have created the following .html file below. The image loads fine in Safari when i preview it in dreamweaver. However, if i try to preview it in Firefox in Safari the image does not load? Please Help!!!! <!DOCTYPE html

  • Satellite M70: WLAN connection lost

    Hello! I have Satellite M70 and I use integrated Intel WLAN card 2200bg. I have the latest drivers downloaded from Toshiba web site and Asus WLAN router w520g with latest firmware. Connection signal is excellent but sometimes actually very often conn