AS3.0 External Interface: Pass variables to flash using javascript

Hello all,
I am looking for a simple and straightfoward example of how I can pass the value of a variable into flash using javascript.
Specifically, I'd like to use javascript to pass the filename of an external video file that I would like to load into my flash movie.
I'd also like to call a function in the SWF that plays the movie once the filename as been passed to the flash movie.
External Inferface looks like the way to go.
I've found a few decent AS2.0 examples, but converting them to AS3.0 has proven difficult and many of the examples are much too complex for what I am trying to do.
If you have any code samples or tutorials showing the HTML/Javascript and the associated actionscript I'd really appreciate it!
Thanks!
Tim

if you create a swf (eiTest.swf) and html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title>eiTest</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script language="JavaScript">
         function thisMovie(movieName) {
         if (navigator.appName.indexOf("Microsoft") != -1) {
             return window[movieName];
         } else {
             return document[movieName];
     function f1(value) {
         thisMovie("eiTest").jsF(value);
</script>
    </head>
         <body onload="f1('yourfilename.ext');">
     <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
             id="eiTest" width="550" height="400"
             codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
         <param name="movie" value="eiTest.swf" />
         <param name="quality" value="high" />
         <param name="bgcolor" value="#869ca7" />
         <param name="allowScriptAccess" value="sameDomain" />
         <embed src="eiTest.swf" quality="high" bgcolor="#869ca7"
             width="550" height="400" name="eiTest" align="middle"
             play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
             type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer">
         </embed>
     </object>
    </body>
</html>
you can use:
import flash.external.ExternalInterface;
ExternalInterface.addCallback("jsF", asF);
function asF(fileS:String):void{
trace(fileS);

Similar Messages

  • Can Captivate pass variables to Flash?

    I have a Captivate 4 quiz embedded in a .FLA (AS2).  Can this quiz pass user-defined and/or system variables to the .FLA?  If so, can someone give me an example code of how this would work?  Let's say I have a user-defined variable in Captivate, varTest with initial value of 0.  On the last slide of the quiz I assign varTest a value of 1.  How do I pass this variable to Flash and how will Flash listen for this value change?  I'm looking for something similar to the following code, but I can't seem to get all of it:
    //code that loads movie here; I have this piece working fine.
    //code that listens for varTest1 value in Captivate
    myListener = function():Void
         var myFlashVar = this.mc_Container.varTest //I load my captivate SWF into mc_Container
         if(myFlashVar == 1)
              trace("myFlash Var = 1")
    some listener code here...
    Thanks.

    samprakash,
    You are going into difficult territory.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?catid=464&threadid=1325387
    There is no solution other than a custom solution, likely
    involving many days and hours of work. If you must do this, you can
    begin by analyzing the swf files for variables while in-use (loop
    through the Captivate swf mc object).

  • Reading flash using javascript

    Is it possible to use JavaScript to detect changes in a Flash
    movie and retrieve the infromation that is displayed on screen at
    that time as is done with screen readers?

    if you create a swf (eiTest.swf) and html:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
        <head>
            <title>eiTest</title>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <script language="JavaScript">
             function thisMovie(movieName) {
             if (navigator.appName.indexOf("Microsoft") != -1) {
                 return window[movieName];
             } else {
                 return document[movieName];
         function f1(value) {
             thisMovie("eiTest").jsF(value);
    </script>
        </head>
             <body onload="f1('yourfilename.ext');">
         <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                 id="eiTest" width="550" height="400"
                 codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">
             <param name="movie" value="eiTest.swf" />
             <param name="quality" value="high" />
             <param name="bgcolor" value="#869ca7" />
             <param name="allowScriptAccess" value="sameDomain" />
             <embed src="eiTest.swf" quality="high" bgcolor="#869ca7"
                 width="550" height="400" name="eiTest" align="middle"
                 play="true" loop="false" quality="high" allowScriptAccess="sameDomain"
                 type="application/x-shockwave-flash"
                 pluginspage="http://www.macromedia.com/go/getflashplayer">
             </embed>
         </object>
        </body>
    </html>
    you can use:
    import flash.external.ExternalInterface;
    ExternalInterface.addCallback("jsF", asF);
    function asF(fileS:String):void{
    trace(fileS);

  • Trouble in passing variable to flash

    I want to pass the current login username from php to flash. So I have written the following code.
    PHP Code:
    <?php
        require_once('C:\xampp\htdocs\moodle\config.php');
        $r=$USER->username;
       echo "val=$r";
    ?>
    Actionscript code
    var myLoader:URLLoader = new URLLoader();
    myLoader.dataFormat = URLLoaderDataFormat.TEXT;
    var myRequest:URLRequest=new URLRequest("http://localhost/moodle/identity.php");
    myLoader.load(myRequest);
    myLoader.addEventListener(Event.COMPLETE,onCompleteHandler);
    var myValue: String;
    function onCompleteHandler(e:Event):void{
              var myvariable: URLVariables = new URLVariables(e.target.data);
              myValue = myvariable.val;
                   trace(myValue);
    There is no error message from both php and actionscript. But I can't see the variable myValue in actionscript. Then I type localhost/moodle/identity.php and I can retrieve the correct login username.But it cannot be passed to flash.
    why is that?

    Most probably there are spaces before val in PHP - trim spaces either in PHP or once you load them.
    To trim spaces in AS3 use:
    var data:String = String(e.target.data).replace(/\s/g, "");
    var myvariable:URLVariables = new URLVariables(data);

  • CF pass variables to Flash

    Hello:
    Basically I want Coldfusion to pass the server date to Flash.
    But I get '#theDt#' instead of the value of 'theDt' please see the
    code below:
    Thank you in advance.
    theDate.cfm
    <cfsetting enableCFoutputOnly="Yes">
    <cfset theDt = dateFormat(now(), 'mm-dd-yyyy')>
    <cfoutput>
    &serverDate=#theDt#
    </cfoutput>
    var my_lv:LoadVars = new LoadVars();
    my_lv.onLoad = function(success:Boolean) {
    if(success) {
    theDate.text = my_lv.serverDate;
    //theDate.text = this['serverDate'];
    //theDate.text = this.serverDate;
    } else {
    var localDate:Date = new Date();
    theDate.text =
    (localDate.getMonth()+1)+"/"+localDate.getDate()+"/"+localDate.getFullYear();
    my_lv.load("C:\\CFusionMX7\\wwwroot\\OC\\theDate.cfm");
    ***************************************************************

    my_lv.load("C:\\CFusionMX7\\wwwroot\\OC\\theDate.cfm");
    You are not "executing" a CF page, just reading the content.
    The route should be something like (if you are testing in
    your machine) :
    my_lv.load("
    http://127.0.0.1//OC//theDate.cfm");
    or the URL corresponding (and the webserver must be configured to
    execute CF pages)
    Regards

  • Pass Variables into Flash from URL

    I have a real simple request for some reason cannot pull it
    off. I have a url that looks like this:
    http://mywebserver/directory1/directory2/webpage.html?name=Mark
    I am trying to pull the variable "mark" into a swf. The URL
    will change depedning on the user and I plan on adding additional
    variables as well (lastname, state, age, etc).
    Easy answer to this? If so, please excuse my ignorance. I use
    actionscript 2 but would consider myelf a novice as I am more into
    design.

    Using FlashVars would work, as would SWFObject - which is
    what I'd use. Glad
    yout got it though.
    Dave -
    www.offroadfire.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How to Read a External File in a livecycle form (using javascript)

    Hi Everyone,
       First of all, i would like to thank you in advanced for your help !!
       I have a situation were i need to load some values into some fields inside a dinamic pdf that was created in livecycle, what can i do so far ?
       I can load the fields with some values using a livecycle event and javascript, the values come from some functions that i have created but ... are fixed of course...
    What i need is to load up the values from the outside world.... from a external file (text or xml) or a webservice... i have some several experiences but nothing has worked so far...
    Can anyone publish a sample code in javascript to load up a file (text or xml) that works inside livecycle ??
    Thanks in advanced.
    Miguel Angelo (migas)

    Hi, Paul,
      Thanks i have looked inside the link (dam big ) but i'm still kind of lost, can anyone please publish a code example ?
    Miguel

  • Passing variables from php to flash and the opposite

    Hi guys, im trying weeks now to solve this problem but nothing yet
    If someone could just tell me how to pass variables from flash to php and the opposite i would be thankful!!! Please help!

    I have recently had to learn this, so this may not be the best way but it worked for me
    I suggest looking at the code below stripping out everything you don't need (e.g. the databse stuff) and just get a simple string going back and forward
    have a go and post any problems here and I'll try and help
    in flash i have
    private function getBalanceAndXP():void
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "getBalance";
              variables.fbid = userID;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.addEventListener(Event.COMPLETE, onBalanceComplete);
              loader.load(request);
    private function onBalanceComplete(e:Event):void
              var loader:URLLoader = e.target as URLLoader;
              loader.removeEventListener(Event.COMPLETE, onBalanceComplete);
              var variables:URLVariables = new URLVariables(loader.data);
              _balance = parseInt(variables.balance); // class variable
              _experience = parseInt(variables.experience); // class variable
    public function setBalanceAndXP(balance:int, experience:int):void
                _balance = balance;
              _experience = experience;
              var request:URLRequest = new URLRequest("utils.php");
              request.method = URLRequestMethod.POST;
              var variables:URLVariables = new URLVariables();
              variables.func = "setBalance";
              variables.fbid = userID;
              variables.balance = _balance;
              variables.experience = _experience;
              request.data = variables;
              var loader:URLLoader = new URLLoader();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              loader.load(request);
    and then I have my php file
    <?php
    $func = $_POST["func"];
    $fbid = $_POST["fbid"];
    $balance = $_POST["balance"];
    $experience = $_POST["experience"];
    $numVariables = 0;
    $link = mysql_connect("localhost","username","password");
    mysql_select_db("databaseName");
    if ($func == "getBalance")
              getBalance($fbid);
    else if ($func == "setBalance")
              setBalance($fbid, $balance, $experience);
    mysql_close($link);
    function getBalance($fbid)
              $query = "SELECT balance, experience FROM tableName WHERE fbid = '".$fbid."'";
              $result = mysql_query($query);
              $row = mysql_fetch_row($result);
              writeVariable("balance", $row[0]);
              writeVariable("experience", $row[1]);
    function setBalance($fbid, $balance, $experience)
              $query = "UPDATE tableName SET balance = ".$balance.", experience = ".$experience." WHERE fbid ='".$fbid."'";
              mysql_query($query);
    function writeVariable( $name, $value )
              global $numVariables;
              if ( $numVariables > 0 )
                        echo "&";
              echo $name . "=" . urlencode($value);
              $numVariables++;
    ?>

  • Cannot pass variables from PHP to actionscript 3.0

    I am using CS3 and I write the following code as to pass variable to flash from PHP
    Actionscript
    var myLoader:URLLoader = new URLLoader();
    myLoader.dataFormat = URLLoaderDataFormat.TEXT;
    var myRequest:URLRequest=new URLRequest("http://localhost/moodle/value.php");
    myLoader.load(myRequest);
    myLoader.addEventListener(Event.COMPLETE,onCompleteHandler);
    var myValue: String;
    function onCompleteHandler(e:Event):void{
              var myvariable: URLVariables = new URLVariables(e.target.data);
              myValue = myvariable.values;
                      trace(myValue);
    PHP file
    <?php
       echo ('values = 8');
    ?>
    But I always get the error and cannot get the values by using trace();
    Before i try to use "myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;" I still get the same error.
    Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs
              at Error$/throwError()
              at flash.net::URLVariables/decode()
              at flash.net::URLVariables$iinit()
              at flash.net::URLLoader/flash.net:URLLoader::onComplete()
    Can anyone help me?

    The error is fixed.The new version is like that
    Actionscript
    var myLoader:URLLoader = new URLLoader();
    myLoader.dataFormat = URLLoaderDataFormat.TEXT;
    var myRequest:URLRequest=new URLRequest("http://localhost/moodle/value.php");
    myLoader.load(myRequest);
    myLoader.addEventListener(Event.COMPLETE,onCompleteHandler);
    var myValue: String;
    function onCompleteHandler(e:Event):void{
              var myvariable: URLVariables = new URLVariables(e.target.data);
              myValue = myvariable.values;
                      trace(myValue);
    php file
    <?php
       echo "values=8";
    ?>
    The output finally is "null" in flash file. Why does it happen? It should give me 8 when I input trace(myValue);

  • Rename an XML tag using javascript

    Dear adobe experts,
    I have a requirement to rename XML tags, in the interface for an adobe form, using javascript.
    the XML looks like this:
    <ELEMENT>
         <DATA>
              <ROW_IID>0</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </DATA>
         <DATA>
              <ROW_IID>1</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </DATA>
    </ELEMENT>
    and the result should look something like this:
    <ELEMENT>
         <CHAIR>
              <ROW_IID>0</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </CHAIR>
         <TABLE>
              <ROW_IID>0</ROW_IID>
              <PARENT>0</PARENT>
              <CHILD>0</CHILD>
         </TABLE>
    </ELEMENT>
    Is this possible and how can I do this? I was hoping that something like renameNode() (for instance) is also possible in the javascript set for adobe forms.
    If it's not possible I'm going to have to create new nodes, put the data from the existing node in the new node and remove the original node. This will be a lot more work and just renaming is easier :-).
    Kind regards,
    Niels

    Hi,
           Thanks a lot Jeff...
            I'm doing a huge program with lot of tasks. While doing that,my mind didn't strike to check if the tag is not already exist, then only to create new tag...  Thanks for all of the indesigner experts for their replies...
    I used the following codes with ur idea.
                        var renamewith = textbox1.text;
                        try
                            alert(app.activeDocument.xmlTags.item(renamewith).name);
                            if(app.activeDocument.xmlTags.item(renamewith).name)
                               var testTag = app.activeDocument.xmlTags.item(renamewith);
                        catch(e)
                            var testTag = app.activeDocument.xmlTags.add({name: renamewith});
    With Regards,
    Vel.

  • LoadVars-using send to pass a variable from flash to php

    For the life of me, I've tried everything:
    I've researched LoadVars on Adobe forum, used David Powers'
    books, googled 'flash to php', LoadVars, etc. and tried
    sendAndLoad, send, and using $_POST, $_GET, $_REQUEST.
    $HTTP_POSTVARS but I keep getting this same error. any advice
    please?
    I have a Unix server running Apache/PHP 4 - LoadVars worked
    to load name-value pairs into an array -see thread)
    My goal with this simple app is to prototype being able to
    pass a variable from flash to a variable in php.
    Parse error: syntax error, unexpected T_VARIABLE in
    flash_to_SQL.php on line 5
    Actionscript 2.0 code:
    var c :LoadVars = new LoadVars();
    c.testing = "123FOUR";
    c.send ("
    http://127.0.0.1/flash_to_SQL.php","_self","POST");
    php code: (I also tried $_POST, $_GET, $_REQUEST.
    $HTTP_POSTVARS)
    <?php
    //mysql 4.1.2, php 4 , NO mysqli
    ecbo $_REQUEST ['testing'];
    /?>

    var formData:LoadVars = new LoadVars();
    formData.fname = "Name";
    formData.send("
    http://www.website.com/flash_php.php",
    formData, "POST");
    <?php
    $name = $_POST['fname'];
    echo $name;
    ?>

  • Passing variables from AS3 to PHP

    Hi there
    I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php].
    I've stuck with this for two days.. Here's what I have done. Please help!!!
    header.fla [Actionscript in the timeline]
    stop();
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.net.*;
    var url:String = "http://localhost/0000/try.php";
    var req:URLRequest = new URLRequest(url);
    var loader:URLLoader = new URLLoader();
    var variables:URLVariables = new URLVariables();
    send_btn.addEventListener(MouseEvent.CLICK, sendForm);
    function sendForm(evt:MouseEvent):void
        // add the variables to our URLVariables
        variables.asd = "value";
        // send data via post
        req.method = URLRequestMethod.POST;
        req.data = variables;
        loader.dataFormat = URLLoaderDataFormat.TEXT;
        // add listener
        loader.addEventListener(Event.COMPLETE, onLoaded);
        loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        //send data
        loader.load(req);
    function onLoaded(evt:Event):void
        var result_data:String = String(loader.data);
        if (result_data)
            trace(result_data);
        else if (!result_data)
            trace("error");
    function ioErrorHandler(event:IOErrorEvent):void
        trace("ioErrorHandler: " + event);
    try.php
    <body>
    <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="563" height="280">
      <param name="movie" value="header.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
      <param name="expressinstall" value="../Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="header.swf" width="563" height="280">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="../Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
    <?php
    if($_POST['asd'])
    echo "value of var1 is <b>".$_POST['asd']."</b>";
    else
    echo "bad luck";
    ?>
    </body>
    BIG THANKS!!

    the problem is nothing your showed.   did you see a security warning that you ignored?
    to test, if that's the problem go here and adjust your security settings:  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
    if that fails, upload your files to a server and confirm everything works.  then start working on your local configuration.

  • Using query strings to pass variables...

    I'm trying to use the query string method to pass some
    variables into a SWF, but I can't seem to get it to work. All of
    the documentation I've seen references the object/embed method for
    displaying the SWF, but I'm using Dreamweaver's
    AC_RunActiveContent.js method to display the SWF. Would this cause
    a problem for the query string?
    Here's what I'm trying in the HTML that houses it:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Untitled Document</title>
    <link href="../bk.css" rel="stylesheet" type="text/css"
    />
    <script src="../Scripts/AC_RunActiveContent.js"
    type="text/javascript"></script>
    </head>
    <body>
    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','wid th','301','height','240','src','videoplayer','quality','high','pluginspage','http://www.ma cromedia.com/go/getflashplayer','movie','videoplayer'
    ); //end AC code
    </script><noscript><object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
    width="301" height="240">
    <param
    name="movie" value="videoplayer.swf?vid=dbc2006" />
    <param name="quality" value="high" />
    <embed
    src="videoplayer.swf?vid=dbc2006" quality="high"
    pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="301"
    height="240"></embed>
    </object></noscript>
    </body>
    </html>

    I've been doing a little research... not being a programmer,
    I'm a little out to lunch on this stuff. I now realize that what I
    put in the HTML page is meaningless, unless the viewer's browser
    won't use JavaScript.
    I now know that I need to define my variables in the HTML
    page, and have the .js file recongnize and use them.
    That's where my lack of knowledge really gets in the way. :)
    Does anyone have any thoughts on how to modify the .js file to put
    my "?vid=dbc2006" into the string?
    Thanks!

  • Passing variables to loaded external movie

    Ok, this problem has beaten me for the last 2 days. It seems
    to be extremely simple, I am on main movie and I am using
    MovieClipLoader class to load external movie callMe.swf into movie
    holder called holder_MC, then from main using onLoadInit or
    onLoadProgress listeners I can target dynamic text inside
    callMe.swf as holder_MC.myTXT.text = "blablabla" or I can change
    frames in callMe.swf by holder_MC.gotoAndStop(5). But HOW TO PASS
    VARIABLE myVar to callMe.swf so it executes something there? Using
    holder_MC.myVar DOESN'T WORK!!!!!!!!!!!!!!
    Thanks for any help,
    Zbynek

    UPDATE... I copied the link to another page with my variables in the image attributes as I posted above. And it works using the values that are cached for those items. Is there any way to do this on the same page as my original link without my users having to change to a different page?

  • Pass Variables into AS3 through Query String?

    Man! I've been searching ferociously and can't seem to find a solution that works for me. I am trying to pass variables via query string on a PHP page to Flash, and then have the swf add movie clips to the stage depending on the information it receives.
    Here is what the PHP outputs:
    swfobject.embedSWF("flash/detailScore.swf?a=0-0&b=0-0&c=30-54&d=30-20&e=42-18", ...
    And here is my AS3 code:
    function loaderInfoSh(e:Event):void{
    var myQueryStrings=this.loaderInfo.parameters;
    a = myQueryStrings.a;
    b = myQueryStrings.b;
      c = myQueryStrings.c;
    d = myQueryStrings.d;
    e = myQueryStrings.e;
    addTheResults(a,1);
    addTheResults(b,2);
    addTheResults(c,3);
    addTheResults(d,4);
    addTheResults(e,5);
    this.loaderInfo.addEventListener(Event.COMPLETE, loaderInfoSh);
    The addTheResults function takes the coordinates, adds a MC instance to the stage and positions it accordingly.
    var colorMCArray:Array = new Array();
    function addTheResults(val,colnum:Number){
    if(val == null){val = "52-46";} // so I can test it locally
    var daColor:String;
    switch (colnum){
    case 1:
    daColor = "f3951c";
    break;
    case 2:
    daColor = "74b47d";
    break;
    case 3:
    daColor = "436494";
    break;
    case 4:
    daColor = "9b74ac";
    break;
    case 5:
    daColor = "b43d44";
    break;
    var dash:int = val.indexOf("-");
    var lateral = val.slice(0,dash);
    var vertical = val.slice(dash+1);
    lateral --;
    vertical --;
    // adding the MC instance
    var comm:tileB = new tileB();
    comm.name = "comm"+colnum;
    addChild(comm);
    colorMCArray[colnum] = comm;
    //Change the color
    var colorTransform:ColorTransform = colorMCArray[colnum].transform.colorTransform;
    var thiscolor = "0x"+daColor;
    colorTransform.color = thiscolor;
    colorMCArray[colnum].transform.colorTransform = colorTransform;
    colorMCArray[colnum].x = 5;
    colorMCArray[colnum].y = 536;
    colorMCArray[colnum].x += (lateral * 9);
    colorMCArray[colnum].y += (vertical * 9)*-1;
    colorMCArray[colnum].addEventListener(MouseEvent.MOUSE_OVER, btnro);
    colorMCArray[colnum].addEventListener(MouseEvent.MOUSE_OUT, btnrout);
    I don't know what I'm doing wrong here.

    Was this the "e" in the code below you were pertaining to as the culprit? "e" is not a keyword. It's just the shortcut for the word "event" for the variable name of type Event which is the Event object that triggered the call of function loaderInfoSh. In your code you assigned e = myQueryString.e which should have given you a type mismatch error.
    function loaderInfoSh(e:Event):void{
    var myQueryStrings=this.loaderInfo.parameters;
    a = myQueryStrings.a;
    b = myQueryStrings.b;
      c = myQueryStrings.c;
    d = myQueryStrings.d;
    e = myQueryStrings.e;
    addTheResults(a,1);
    addTheResults(b,2);
    addTheResults(c,3);
    addTheResults(d,4);
    addTheResults(e,5);
    this.loaderInfo.addEventListener(Event.COMPLETE, loaderInfoSh);

Maybe you are looking for