Passing variables: Functions

Sorry if this is nooby questions:
How can i pass variables between functions in AS. I know how
to return a value and you can pass parameters into a function but
say I had an outer function (say "a") with a local var (say "vara")
with a subtended function (say "b") how can i pass "vara" into
function b and then return it out so the value of "vara" has been
updated. Sorry if bad explanation. Is this possible with local
vars? or would i have to use a regular var which both functions can
access?

> This will basically do what your asking. If I missed the
mark let me know.
I think you did
>> say I had an outer function
>> (say "a") with a local var (say "vara") with a
subtended function (say
>> "b") how
>> can i pass "vara" into function b and then return it
out so the value of
>> "vara"
>> has been updated.
Short answer .. no .. you can only pass things by value, and
you can only
return values.
You cannot pass a variable into a function and have the
function modify the
variable.
If you want to update a single variable with the result of a
function, then
you can do as TimSymons suggested: vara = b(vara);
But that doesn't seem to be what you're asking.
You can, however, put your variables inside an Object, pass
the Object to a
function, and modify the variables inside the object, then
when the function
returns, the object has the modified variables. eg
function a() {
var myvars = { vara : 123, varb : 456};
b(myvars);
trace(myvars.vara);
trace(myvars.varb);
function b(myvars) {
myvars.vara = myvars.vara * 2;
myvars.varb = 789;
Jeckyl

Similar Messages

  • How can I pass variable to eventdriven startElement() function?

    I am new to java and SAX. Could anybody tell me how to pass variable to eventdriven startElement function? I tried the following code but didn't work.
    public class ReadXmlSax extends DefaultHandler
    String elementName;
    String requestName;
    Vector v = new Vector();
    public Enumeration getAttribute(String sFileName, String sTagName, String sAttrName)
         Enumeration e;
         elementName=sTagName;
    requestName=sAttrName;
    File f = new File(sFileName);
    // Use an instance of ourselves as the SAX event handler
    DefaultHandler handler = new ReadXmlSax();
    // Use the default (non-validating) parser
    SAXParserFactory factory = SAXParserFactory.newInstance();
    try {
    // Parse the input
    SAXParser saxParser = factory.newSAXParser();
    saxParser.parse(f, handler);
    } catch (Throwable t) {
    t.printStackTrace();
    e = v.elements();
    return(e);
    //===========================================================
    // SAX DocumentHandler methods
    //===========================================================
    public void startDocument()
    throws SAXException
    public void endDocument()
    throws SAXException
    public void startElement(String namespaceURI,
    String sName, // simple name
    String qName, // qualified name
    Attributes attrs)
    throws SAXException
              //System.out.println(elementName);
              if (qName.equals(elementName))
                   String serverName = attrs.getValue("",requestName);
                   v.addElement(serverName);
    }

    I attached the main call the ReadXmlSax class. I added the
    "system.out.println(elementName);" in the function getAttribute and startElement as well. I got printing out "name" for elementName from function getAttribute but got others printing out "null" for elementName from function startElement. Any suggestions? thanks
    import java.io.*;
    import java.util.*;
    import ReadXmlSax;
    public class ReadElement
         public static void main(String argv[])
              ReadXmlSax r = new ReadXmlSax();
              Enumeration e = r.getAttribute("dre.xml","server","name");
              try{
                   while (e.hasMoreElements()) {
                   System.out.println((String)e.nextElement());}
              }catch(Throwable t){
                   t.printStackTrace();
    <strong>test</strong>

  • How? Flex pass variables or call function in SWF

    Dear All:
    I am new in Flex.
    But I stuck with a problem for weeks.
    I wish to communication between Flex and Flash(swf).
    I tried to pass variable from Flex to Swf. (Call function in Swf also pass variables)
    I did some tourital on google by using SWFLoader, which works fine.
    BUT the AS code in SWF must in MAIN FRAME.
    I need put my AS code by using DOCUMENT CLASS.
    BUT when I using Document class, the method is not working.
    The flex cannot find function in Flash.
    PS.I already set main.as class as public
    Hope some one can give some hint.
    I really get a huge headache.
    Many thanks,
    Henry

    myIP wrote:
    > or perhaps more ideal;
    >
    > for(var sVar in flashVars)
    > {
    > i++;
    > //var mcName = sVar.substr(0,3);
    >
    > // create the MCs:
    > duplicateMovieClip(_root.testBut,"medium"+sVar,i);
    > _root["medium"+sVar].testText.text=sVar;
    > _root["medium"+sVar].mcName = sVar.substr(0,3);
    >
    >
    > // assign the function to each created MC:
    > _root["medium"+sVar].onRelease = function()
    > {
    > trace(this.mcName)
    > _root[mcName]._x=0;
    > }
    > }
    >
    thanks but this does not work.
    I think that the problem is that the variables defined in the
    for loop do not exist in the scope of
    the function.
    when the MC is clicked, and the onRelease function says:
    _root[mcName]._x=0;
    the variable "mcName" is empty.
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    An Ingenious WebSite Builder:
    http://sitelander.com

  • How to pass variable in a function

    I would like to ask how to pass the value "char" into the
    "onSoundComplete" function? many thanks! many thanks!
    _root.playVO = function(pageNum, char){
    var myVO:Sound = new Sound();
    myVO.loadSound("vo/vo" + pageNum + ".mp3", true);
    _root.myVO.onSoundComplete = function(char){
    _root.attachMovie("indicator", "indicator",
    _global.curLevel++);
    _root[char].mouth.gotoAndStop("mute");
    _root.indicator.clickIndicator_btn.onRelease = function(){
    _root.play();
    _root.currentPage++;
    _root.display(_root.currentPage);
    this._parent.removeMovieClip();
    }

    I don't think you can pass variables into the onSoundComplete
    handler function. But you don't really need to as you've written
    the code. You're passing it into the playVO function so it should
    be availble to the onComplete handler (which you've written inside
    playVO) without having to restate it. As long as you pass it in
    when calling playVO (e.g. playVO(myVar);)
    Hope that helps!

  • The function javascript:doSubmit not passing variables between pages

    Hi,
    I have an report that has a link to another page, and I'm trying to pass 2 variables. If I use a target URL as such the variables do not get passed, but if I use a page target and explicitly add the item name and values it works fine. Here is the call I'm using to javascript:doSubmit:
    javascript:doSubmit('f?p=&APP_ID.:32:&SESSION.::&DEBUG.:32, CIR:P32_PROJ_ID,P32_DID:#AWARD_NUMBER#,#ID_PROVIDED#');
    Does anyone have any insights?
    Thanks,
    Joe

    You can't use doSubmit to pass variables; it will only submit your page with the request you passed in.  All normal page processing and branching will be followed..  Why are you using doSubmit?  Just put the URL in the URL field.
    f?p=&APP_ID.:32:&SESSION.::&DEBUG.:32, CIR:P32_PROJ_ID,P32_DID:#AWARD_NUMBER#,#ID_PROVIDED#

  • Passing variable having value as whole SOAP request to command while invoking ODI WS call

    When passing variable in place of soap request message (variable value is whole SOAP request message prepared using procedure) in ODI Invoke WebService command like -->
    OdiInvokeWebService "-URL=url...." "-PORT_TYPE=..." "-OPERATION=..." "-RESPONSE_MODE=NEW_FILE" "-RESPONSE_FILE_CHARSET=UTF8" "-RESPONSE_XML_ENCODING=UTF-8" "-RESPONSE_FILE=..." "-RESPONSE_FILE_FORMAT=SOAP" "-HTTP_USER=..." "-HTTP_PASS=..."
    #SOAPREQUESTMESSAGE
    Gives error :
    ODI-1226: Step OdiInvokeWebService 1 fails after 1 attempt(s).
    ODI-1241: Oracle Data Integrator tool execution fails.
    Caused By: com.sunopsis.wsinvocation.SnpsWSInvocationException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '#' (code 35) in prolog; expected '<'
    at [row,col {unknown-source}]: [1,1]
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.loadFromXML(AbstractMessageImpl.java:333)
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.loadFromString(AbstractMessageImpl.java:348)
        at com.sunopsis.wsinvocation.client.impl.AbstractMessageImpl.fromString(AbstractMessageImpl.java:403)
        at com.sunopsis.wsinvocation.client.impl.AbstractJWSDLParserImpl.fromXML(AbstractJWSDLParserImpl.java:272)
        at com.sunopsis.wsinvocation.client.impl.AbstractJWSDLParserImpl.getWebServiceRequestByOperation(AbstractJWSDLParserImpl.java:260)
        at com.sunopsis.dwg.tools.common.WebserviceUtils.getSOAPMessage(WebserviceUtils.java:94)
        at com.sunopsis.dwg.tools.common.WebserviceUtils.invoke(WebserviceUtils.java:138)
        at com.sunopsis.dwg.tools.InvokeWebService.actionExecute(InvokeWebService.java:327)
        at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java:276)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java:3437)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeOdiCommand(SnpSessTaskSql.java:1509)
        at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:44)
        at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:1)
        at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
        at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
        at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
        at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
        at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
        at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
        at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
        at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
        at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
        at java.lang.Thread.run(Thread.java:662)
    Thanks in anticipation...

    the used variable 'SOAPREQUESTMESSAGE' is being created in a procedure using jython.
    1. Can we use this variable (SOAPREQUESTMESSAGE) value in the next step that is while invoking web service request (can it persist) ?
    2. If not then how can we use this variable value to invoke ws request in next step ?
    Would like to appreciate help.
    Pls reply.

  • How to pass variable form javacript to java BackingBean

    Hello,
    I am trying to pass variable from Javascript method (which is written in jspx) page to a Java BakingBean.
    here is the Javascript code:
    <SCRIPT type="text/javascript">
    function OnSave() {
    alert("The signature you have taken is the following data: " + SigPlus1.SigString);
    </SCRIPT>
    of course, this method will be called after the use press save button as follow:
    <INPUT id="submit1" name="Save" type="submit" value="Save" onclick="OnSave()"/>
    As you can see this Javascript will alert the result to the user. Instead I want to pass the object ( SigPlus1) to a Java Bean.
    I am using ADF technology with JDveloper 11.1.2.3

    here is the answer:
    ADF RichClient API - af:serverListener

  • How to pass variables between loaders

    Hi,
    I am trying to load an image, with descriptive text and a back button on the click of a thumbnail of the image. I am using a MovieClipLoader instance to do this.
    Here are my problems:
    1. I tried loading the image, with the text(which is within an external swf), using the same loader, but since I am placing them dynamically, depending on the dimensions of the image, I need to pass variables between the two. The image loader is taking longer than the text (obviously) but I need the dimensions of the image before I can place the text. How do I do that??
    2. I tried using two loaders, with separate listeners, and the problem once again is that the text loads before the image, and is hence placed with default values instead of the values derived from the image. The code is within onLoadInit(). Is it possible for me to get the dimensions of the image from onLoadStart()???
    3. There is a back button within the text.swf. I want the image and the text.swf to be unloaded when this button is clicked. How can I achieve that? Can I call loader.unloadClip(target), from within this? Will it recognize the variable?
    4. Is there a much easier way to do this, which I am sadly unaware of?
    Any help will be appreciated.

    Tried the onloadstart() function, but it gives target._width and _height as 0. So that is ruled out...any other suggestions?

  • How to pass variables to Skin applied with skinClass?

    Hi all,
    I'm experimenting with new skin for a SkinnableContainer, and I would like to pass variables to that skin to dynamically change some elements.
    This is how I would like it to work, but it doesn't. Is there a way to make it work? (Or something similar... like defining new stylesheet-elements in the skin.)
    <s:SkinnableContainer skinClass="skins.SkinnableContainerBackground" gradient1="0xFFF000" gradient2="0x000FFF>
    <s:RichText id="rt1" width="400" height="200"  />
    </s:SkinnableContainer>
    Skin:
    <s:Skin xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:d="http://ns.adobe.com/fxg/2008/dt"
            xmlns:ai="http://ns.adobe.com/ai/2008"
            height="100%"
            width="590">
        <s:layout>
            <s:BasicLayout/>
        </s:layout>
        <s:states>
            <s:State name="normal"/>
            <s:State name="disabled"/>
        </s:states>
        <fx:Metadata>[HostComponent("spark.components.SkinnableContainer")]</fx:Metadata>
        <fx:Script>
            <![CDATA[
                [Bindable] public var gradient1:uint;
                [Bindable] public var gradient2:uint;
            ]]>
        </fx:Script>
        <s:Group top="0"
                 bottom="0"
                 left="-11"
                 right="0">
            <s:Group x="15"
                     top="0"
                     bottom="0"
                     id="kaft">
                <!--            <s:filters>
                     <s:DropShadowFilter alpha="0.4"
                     blurX="6"
                     blurY="6"
                     distance="4.24264"
                     quality="3" />
                     </s:filters>
                -->
                <s:Rect width="586"
                        ai:knockout="0"
                        d:userLabel="kaft"
                        top="0"
                        bottom="0">
                    <s:fill>
                        <s:LinearGradient y="82.3125"
                                          scaleX="585.975"
                                          rotation="-0">
                            <s:GradientEntry color="{gradient1}"
                                             ratio="0.466667"/>
                            <s:GradientEntry color="{gradient2}"
                                             ratio="1"/>
                        </s:LinearGradient>
                    </s:fill>
                </s:Rect>
            </s:Group>
        </s:Group>
        <s:Group id="contentGroup"
                 left="20"
                 right="20"
                 top="10"
                 bottom="20">
            <s:layout>
                <s:BasicLayout/>
            </s:layout>
        </s:Group>
    </s:Skin>

    ou can also define custom CSS styles:
    MySkinnableContainer.as
        [Style(name="gradientA", type="uint", format="Color", inherit="no")]
        [Style(name="gradientB", type="uint", format="Color", inherit="no")]
        public class MySkinnableContainer extends SkinnableContainer
            public function MySkinnableContainer()
                super();
    MySkinnableContainerSkin.mxml
    <s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/halo"
                 xmlns:s="library://ns.adobe.com/flex/spark">
        <fx:Metadata>
            <![CDATA[
            [HostComponent("MySkinnableContainer")]
            ]]>
        </fx:Metadata>
        <s:states>
            <s:State name="normal" />
            <s:State name="disabled" />
        </s:states>
        <s:Group bottom="0" left="-11" right="0" top="0">
            <s:Group id="kaft" x="15" bottom="0" top="0">
                <s:Rect width="586" bottom="0" top="0">
                    <s:fill>
                        <s:LinearGradient y="82.3125" scaleX="585.975" rotation="-0">
                            <s:GradientEntry color="{getStyle('gradientA')}" ratio="0.466667" />
                            <s:GradientEntry color="{getStyle('gradientB')}" ratio="1" />
                        </s:LinearGradient>
                    </s:fill>
                </s:Rect>
            </s:Group>
        </s:Group>
        <s:Group id="contentGroup" bottom="20" left="20" right="20" top="10" />
    </s:SparkSkin>
    styles.css
    @namespace local "*";
    local|MySkinnableContainer {
        gradientA: #FF0000;
        gradientB: #000FFF;
        skinClass: ClassReference("MySkinnableContainerSkin");   
    main app:
        <fx:Style source="styles.css" />
        <local:MySkinnableContainer width="590" height="100%">
            <s:RichText id="rt1" width="400" height="200" color="#000000" text="test" />
        </local:MySkinnableContainer>

  • Passing variable data into XSLT

    Hai all, I am trying to pass variable contents into a XSLT. I am trying the procedure given in the link below.I am not able to pass the parameter values into XSLT file.I am failing in the last step.
    Has anyone tried this example
    http://blogs.oracle.com/rammenon/2007/05/passing_bpel_variable_contents.html
    or
    Is there any other way to pass variable data into XSLT. Kindly help.
    Thank You

    True, the sample also uses the same function that I mentioned :
    <!-- convert Invoice to PO using XSLT service -->
              <assign name="transformVehicle">
              <copy>
                   <from expression="ora:processXSLT('InvToPo.xslt',bpws:getVariableData('input','payload') )"/>
                   <to variable="output" part="payload"/>
              </copy>                    
              </assign>

  • Passing variable trouble

    I have created a few arrays in a frame and am trying to pass
    a variable from the main array to choose a second array by passing
    a variable using a function after a button is clicked. I use this
    code to select the name of the new array:
    _root.m1[name].menuTwoID = homeMenu
    [0];
    from this array
    var homeMenu:Array = [["residential", "resMenu"],
    ["commercial", "comSubMenu"],.....
    That should produce a passed variable "resMenu" correct?
    It doesn't work later later in a new function when I put it
    into:
    _root.m2[name].main_text.text = menuTwoID[count-1][0];
    to get the names from the second array.
    If I put "resMenu" directly in the code (below) it works
    fine.
    _root.m1[name].menuTwoID = resMenu;
    Any ideas of what I'm doing wrong?
    Thanks

    Here's an example of the idea:
    I create a menu and when it's clicked try to use the
    menuTwoID to pass the name of the new array to create a new sub
    menu. But that doesn't work. Is it that's it's a string and not an
    array?
    var AllColors:Array = [["reds", "colorsOne"], ["blues",
    "colorsTwo"]];
    var colorsOne:Array = [["Fire Engine", "colors1a"],
    ["Sunset", "colors1b"]];
    var colorsTwo:Array = [["Sky Blue", "colors2a"], ["Cyan",
    "colors1b"]];
    function buildAllColors() {
    var spacing:Number = 20;
    for (var i = 0; i < 2; ++i) {
    var name:String = "flipper" + i + "_mc";
    var y:Number = i * spacing;
    _root.m1.attachMovie("flipper", name, i);
    _root.m1[name]._x = 0;
    _root.m1[name]._y = y;
    _root.m1[name].main_text.text = AllColors
    [0];
    _root.m1[name].menuTwoID = AllColors[1];
    _root.m1[name].item_btn.onPress = function () {
    itemClicked (this._parent.menuTwoID);
    for (var i = 0; i < 2; ++i) {
    _root.m1["flipper" + i + "_mc"].flipper_bg._alpha = 50;
    this._parent.flipper_bg._alpha = 100;
    buildAllColors();
    function itemClicked (menuTwoID:String){
    var spacing:Number = 20;
    for (i=0; i<2; i++){
    var y:Number = i * spacing;
    var name:String = "flipper" + i + "_mc";
    _root.m2.attachMovie("flipper", name, i);
    _root.m2[name]._x = 0;
    _root.m2[name]._y = y;
    _root.m2.attachMovie("flipper", name, i);
    _root.m2[name].main_text.text = menuTwoID
    [1];
    stop();

  • 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);

  • How we can pass variable to ODI scanerio running by weblogic ODI console

    Hi
    I have to execute scanerio by ODI weblogic console and pass variable as argument during run time to scanerio.
    Is there any way to implement this?
    Thanks

    Hmmm...never tried this.
    But you can create a function that returns a value and try invoking it through "SELECT func1() FROM dual.." in the Refresh section. See if that works.

  • 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);

  • Passing variables with page redirect

    I have a cfform. After it is filled out and submitted, the
    action page generates a random reference_no and puts the data into
    a database. I then do a cflocation url and pass the reference_no to
    another page. This page takes the reference_no and does a cfquery
    again to get all the information just entered and displays it on
    the form. A javascript popup/alert message then tells the user the
    form was submitted with the reference_no and to print the form. I
    was advised to do it this way so that the form cannot be
    resubmitted again. Everything works fine the way I have it.
    Now here is what I would like to do. After the form is
    displayed with the popup, I would like to pause 3-5 seconds and
    then redirect that page to another page that is identical (minus
    the javascript popup message) with the cfdoucment tag because I
    want them to print the form in pdf format. The problem I am having
    is when I do another cflocation url at the end of the display page
    and pass the referendce_no, to go to the pdf page, it works but it
    never stops at the display page to display the javascript popup
    message. So I tried to use the meta tag refresh rediredct set at 3
    seconds and pass the reference_no. The display page with the
    javascript message works then the page is redirected but the
    reference_no is never passed and the pdf form comes up but without
    anything to display. I guess you cannot pass variables in a meta
    tag since that is not cf ?
    How can I go from the page with the javascript popup to the
    page with cfdocuement pdf format ?
    Thanks

    You would have to craft the url of the popup page to pass the
    reference_no. I'm going to assume that you're using the "Post"
    method on your form, which means you have to pass the reference_no
    form value as a url/GET value.
    <cflocation
    url="somesite.com/popup.cfm?reference_no="#form.reference_no#">
    and then on the popup.cfm page, consume the url.reference_no
    again as part of the url in the meta refresh
    <cfoutput>
    <meta http-equiv="refresh"
    content="10;url=http://somesite..com/pdfDisplay.cfm?reference_no=#url.reference_no#"
    />
    </cfoutput>
    If you're just trying to prevent double submission, you could
    just lock the
    form from double submission clientside. In the method below,
    it actually hides the form. There are other options such as
    displaying an inline IFRAME which would simulate a popup and would
    remain until the page was refreshed from the form submission. I
    would also consider this old school. You might want to check out
    other options as far as Web 2.0 using AJAX and frameworks such as
    JQuery.
    <script language="javascript">
    function formSubmit(){
    if (document.myForm.isSubmitted.value != "no"){
    return false;
    }else{
    document.myForm.isSubmitted.value = "yes";
    document.getElementById('submitdiv').style.display =
    "block";
    document.getElementById('formdiv').style.display = "none";
    document.myForm.submit();
    </script>
    <div id="submitdiv" style="display:none">
    Your Form has been submitted.
    </div>
    <div id="formdiv" style="display:block">
    <form method="post" name="myForm" id="myForm"
    action="HandleSubmission.cfm">
    <input type="text" name="isSubmitted" value="no">
    <input type="button" name="manSubmit" value="submit"
    onclick="formSubmit();">
    </form>
    </div>

Maybe you are looking for

  • How can I limit the number of simultaneous downloads on my Mac?

    Hi Everyone, I'm using an old Powerbook G4 runnnig 10.4.11. Whenever I'm downloading a large number of files simultaneously, my OS insists on downloading them all at the same time. When I've got 50+ files coming in, it gets kind of messy and makes it

  • Can't Sleep or Shut Down - Getting Worse

    I have a new MBP with WinXP Home installed on a separate partition created with Boot Camp 1.2. I use Windows to access a work system, otherwise, I am always in OS 10.4.9. Everything worked perfectly for about two weeks. Beginning about a week ago, I

  • Sudden 0.2mb connection

    Hey guys and gals. My problem has only been happening maybe a week and a half. I usually have between a 3mb to 5mb connection, this has nose dived to 0.2mb. I have tried resetting the hub both standard and to defaults. I have noticed my home hub also

  • Print of sales receipt

    It would help if HP could fix the receipt for print out if it only printed on one page.  I am aware one can choose pages and print only the selected page but a receipt for my business records means I do not wish to miss anything.   Thanks  Lots of op

  • LMS 4.2 compliance license

    Hello, all Recently I look around Cisco Prime Infrastructure. Looking Datasheet and Installation guide... and... It's so hard. in licensing, I know how Lifecycle and Assuarance licenses are running. but, I can't understand about the compliance licens