data call a loader dynamically using variables

I'll call some data from php, which simply retrieves some data from MySQL.  The recovered paintings are called dynamically and so I have a list of tables sent to actionscript below and called by event.target.data.its and event.target.data.ces.  They will have a list of called tables.  I then sends the name/value pairs to actionscript php dynamically using these table names (all inside php here).

$sql3 = ' SELECT * 'SPECIALTY "";

$getit = mysql_query ($sql3);

While ($row2 = {mysql_fetch_array ($getit))}

for ($i = 0; $i < sizeof ($itlist); $i ++) {}

$itones = $row2 [$itlist [$i]];

$fullstr. = '& '. $itlist [$i]. ' = $itones; »

}

for ($l = 0; $l < sizeof ($celist); $l ++) {}

$ceones = $row2 [$celist [$l]];

$fullstr. = '& '. $celist [$l]. ' = $ceones; »

}

}

$fullstr. = "& a = $itrow & these = $cerow;

Print "$fullstr";

As you can see, the names in the name/value pairs are created dynamically.  So in order to know which names the name/value pairs to call ActionScript, I have send their list to actionscript.  The problem is the following.  In actionscript, I have the names of the name/value pairs of. data.its and. data.CES. those who are like a comma-delimited string.  I put those in a table so you can loop through the array and call the appropriate data to php.  However, they are strings and cannot access the data in php.  What I need to know, is what is the evet.target.data. ??? .  What kind of data can I use to convert the string to a vocation little matter.  The string itself will not work.  It does not convert the string to an object.  How can I access specific information (name/value) in .data. When I have a string that represents the name of the name/value data, I try to access?

Glo.bal.ServerPath = "http://localhost/unspro/" ;//http://localhost/unspro/ ""

var contentArray:Array = theContent.split(",");

var rodp:URLVariables = new URLVariables();

var getps:URLRequest = new URLRequest(glo.bal.serverpath+"prep/getspecs.php");

getps. Method = URLRequestMethod.POST;

getps. Data = WSGP.

var leer: URLLoader = new URLLoader();

leer.dataFormat = pouvez;

leer.addEventListener (Event.COMPLETE, rtrieve);

var txet:String = "true";

rodp.wantcol = Txete;

Leer.Load (getps);

function rtrieve(event:Event):void

{

trace (Event.Target.Data.its);

trace (Event.Target.Data.ces);

var itarr:Array = event.target.data.its.split(",");

var cearr:Array = event.target.data.ces.split(",");

for (var i: int = 0; i < itarr.length; i ++) {}

var st:String = itarr [i];

trace (St);

trace (Event.Target.Data.St);

trace (Event.Target.Data.Network);

}

IT IS FAIR TEST, I CAN ALSO PRINT AS A SIMPLE STRING.  I CAN PROBABLY WORK WITH THE DATA AS A STRING, BUT IT IS A PAIN THE *.

/ * var dataXML:XML = XML (event.target.data);

trace (DataXML.ToXmlString ());

var somest: String = (dataXML.toXMLString ());

var fullarr:Array = somest.split ("&");

for (var u: int = 0; u < fullarr.length; u ++) {}

trace (fullarr [u]);

} */

}

In fact, I found the answer.  XML would not have been simpler in my opinion.  Because it would add an additional step (or two) first of all, create the xml in php code, once I got the MySQL data, and then analyze the XML in as3.  XML is a useful tool, but it's more of a replacement or a substitute for a dabase in my opinion.  When I use a database I shouldn't need XML and when I use XML (for the storage of data smaller unless I create xml dynamic text files) I wouldn't need MySQL.

The solution is below for those who may fall on a specific need to dynamically call the names that represent the values passed from php in as3.

function rtrieve(event:Event):void

{

trace (Event.Target.Data.its);

trace (Event.Target.Data.ces);

var itarr:Array = event.target.data.its.split(",");

var cearr:Array = event.target.data.ces.split(",");

for (var i: int = 0; i<>

var st:String = itarr [i];

trace (St);

trace (Event.Target.Data [ST]); / / / event.target.data ["String_representing_name_for_name_value_pair"];

}

}

Tags: Adobe Animate

Similar Questions

  • Loads dynamically using a Subvi included in the .exe of VI

    Dear community,

    I'm trying to figure out how I could make my exe would dynamically load custom libraries, and the external libraries could use as the screws that are "included" in Main.exe subVIs

    I made this simple diagram to show how I see, maybe someone has already faced this issue and found a few technical workaround to make it possible.

    The idea is to keep Main.exe as standard as possible, without having to make a new version whenever we do light news in custom.vi

    See you soon!

    You need not worry about this.  As already said, the version of the Subvi that is currently in memory will be used.  If you don't believe me, that give a try.

    I have a VI that calls Sub - VI and VI another called dynamically which also called the Subvi.  The Subvi just keep track of how many times it was called.

  • Call a sequence with a variable

    Hello!

    I was wondering if it is possible to use a variable to call a sequence. So instead of typing a specific sequence in step of calling sequence, is it possible to use something like CurrentValue.String to choose which sequence should run?

    Thank you

    You can check the checkbox 'Specify expression' to determine the sequence that should be called. You can use variables in the expression.

    Norbert

  • How to read a variable main.swf (this content.swf of load) and use within the loaded movie?

    Hello

    How to read a variable main.swf (this content.swf of load) and use it within the content.swf?

    I have a variable called TextColor = 'Green' handmade film and I want to read this variable from inside the content movie?

    anyone can help!

    Thank you very much.

    MyGiantBrain thanks for your reply but kglad method worked very well.

    Thanks kglad but there is some changes to your code so that it works, and it is:

    trace (MovieClip (parent.parent) ["TextColor"]);

    Thank you

  • What are the parameters? How are Variables differenet? Why we can not use variables to pass data to one sequnece to another? What is the advantage to use parameters instead of Variables?

    Hi all

    I am new to TestStand. Still in the learning process.

    What are the parameters? How are Variables differenet? Why we can not use variables to pass data to one sequnece to another? What is the advantage to use parameters instead of Variables?

    Thanks in advance,

    LaVIEWan

    I'm sorry... I discovered that... its not at all possible to pass data to another sequence using variables... it must be through settings... once again I apologize for the display of such a stupid question

  • Access to the content of the data of publication in the forms using variables

    I have a problem when I tried to access publish data on a form by using a variable...

    Login form


    < cfquery name = "ConsultaPrecios" datasource = "#Application.DB #" >
    SELECT * FROM
    VwConsultaPrecios
    ORDER BY NOMBRE_PRE
    < / cfquery >

    "< preservedata cfform = 'Yes' name ="formaVentaGastos"action =" "onsubmit =" verificaCampos () "enctype =" multipart/form-data">

    < cfloop query = "consultaPrecios" >
    < cfoutput >
    < tr align = "center" class = "forma" >
    < class td = "forma" align = "right" > #consultaPrecios.NOMBRE_PRE #-#NumberFormat(consultaPrecios.PRECIO_PRE, "$___.__") # < table > < / cfoutput >
    < class td = "forma" > < cfinput validate = 'integer' value = '0' onChange = "if(this.value=='') {this.value = 0 ;}. validateInt (this, #consultaPrecios.PRECIO_PRE #, ' #consultaPrecios.Nombre_Pre #'); "maxlength ="3"message = 'El campo debe ser entero amount!' type ="text"size ="8"name =" #consultaPrecios.Nombre_Pre #_venta "> < table >
    < class td = "forma" > < cfinput style = "" background-color: # 999999; "validate ="integer"readonly ="Yes"value ="0"type ="text"size ="8"name =" #consultaPrecios.Nombre_Pre # "> < table >"
    < /tr >
    < / cfloop >

    < / cfform >

    Treatment of the form

    < cfloop list = "" #Form.FieldNames # ' index 'i' = > "

    < cfif findNocase('Venta',#i#) AND NOT findNoCase ("TOTAL", #i #) AND NOT findNoCase ('FARM', #i #) AND NOT findNoCase ("RUTA", #i #) >
    < cfset = ' form. Interno ">"
    < cfoutput #Ii # > < / cfoutput >

    < br >
    < / cfif >

    I don't think I understand what you try to do or what you really have a problem.

    Looking at your logic, I'd wait loop on your list 'i' variable to hold the value of 'fields' to one of the iterations of the loop.  This logic will loop over each of the values in the list "form.fieldnames" and the output of each itteration.

    If you want to access the value of the structure of the form for each itteration, table notation is the common approach.

    
      #i#: #form[i]#

    You can do the same thing with a loop of the collection.

    
      #field#: #form[field]#

    HTH

    Ian

  • Questions: call vi dynamically using vi Server

    I have a few questions about the next vi.

    1. is there a better way to determine at run time whether a vi is part of a generation or not?

    2. is there a better way to pass values to a dynamic called vi.  Or, better yet, a better way to call a vi dynamically?

    3. when I run the code as shown above in a generation vi does not actually open. It opens fine when it isn't a building.  However, when I call the vi dynamically and activate the vi down right, 2 windows will pop up, the dynamics and the other.  Clues as to what is happening here?

    You did it ensure that your disabled VI is listed as VI to be included in the build specification?  If you do not, when the VI is built in a .exe, the block diagram to disable and the VI it contains are probably be stripped of the .exe

  • Use variables in the names of MovieClip to call ASP 3.

    This line of code works very well for me:

    this.helpB1Btns.helpB1B3.alpha = 0.3;

    But I wonder how can I use variables instead of numbers (1 and 3) above?

    I mean for example:

    var i: int = 1;
    var j: int = 3;

    This ["helpB" + i + "BTNS.helpB" + i + "B" + j + '.alpha'] is 0.3;. Error
    ["helpB"+ i + "Btns.helpB" + i + "B" + j +".alpha '] = 0.3; Error
    This ["helpB" + i + "Inclinometer"]. ['helpB' + i + 'B' + j ".alpha"] plus 0.3; Error

    For example, this code works fine:

    This ["helpB" + i "Inclinometer"] .alpha plus 0.3;

    (this.helpB1Btns.alpha = 0.3 ;)

    But I have no idea of this code:

    this.helpB1Btns.helpB1B3.alpha = 0.3;

    I appreciate your help or no matter what reference I could learn this basically?

    yours,

    Ali

    use:

    This ["helpB" + i + "Inclinometer"] ['helpB' + i + 'B' + j] .alpha = 0.3

  • When dynamically created variables are emptied in the sequential process template?

    I have a sequence TestStand 2014 in which I dynamically create and fill many FileGlobal variables in the installation section of my main sequence.  I have it using the TestStand API to read the data in an Excel file (the data consists mainly of thresholds, limits, etc.).  The methodology itself works flawlessy.

    However, there are differences in behavior when using entry points both execution of the sequential process model.  When you use the entry point of execution 'Single Pass', he has no problem in test a DUT after another.  However, when you use the entry point for execution "Test DUT", I encounter the following error after completing of DUT1 and DUT2 testing:

    An error occurred the call 'InsertSubProperty' in 'PropertyObject' of 'NI TestStand 2014 API.

    The name of the element "VariableName" is not valid because it is already in use.

    I interpret this error message means that the variable I am trying to dynamically create the DUT2 track is already present race of DUT1.  I have a few questions about this:

    1. at what point in the sequential process template are dynamically created variables flushed, such as run a further by using 'Single Pass' starts with a clean slate?

    2. is there a reminder that I can substitute such as variables to rinse after each HAD run, allowing me to dynamically create variables on each HAD, during execution using "Test UUT?

    3. better yet, is there a counter of TestStand I can query to determine if I already ran DUT1 when using "Test DUT", such as DUT2 uses the variables that were created dynamically on trail of DUT1?

    Or you can simply use the PropertyExists function as a precondition.

    PropertyExists ("Locals.Foo")

  • Is there a way to store the State of the vi loaded dynamically without resorting to tricks Subvi?

    I have a VI to open a UDP connection, data recovery, and then close the connection:

    Set the State to 1 opens a UDP connection.

    Definition of State 2 retrieves a UDP packet. Most of the boxes above is for the manipulation of data.

    Placed at 3 farm the UDP connection.

    Now, calling this vi as a sub - VI works fine:

    But calling the vi dynamically only:

    The second call inside the while loop will raise an error. Apparently, bibliographic are not valid from one call to the other when you call a vi loaded dynamically. What I need to know is, is there a convenient way to get around this?

    Hello

    The call dynamically a VI within a while loop can be pretty bad in terms of performance and I'm not sure it's a good idea.

    But if you really want to do this, using the function "Call by reference node" would be more appropriate in your case (you can find some examples easily).

    Best,

    J.

  • called before loading info

    Hey there all you Flash AS3 masters, got a question I am hopeing you can all help me solve.

    In my document class, I have the following.

    var mainBoards:LoadXMLData = new LoadXMLData ("Main_boards.xml");

    var test: XML = mainBoards.getXMLData;

    In the LoadXMLData class, I have an event listener and a Get accessor that returns XML data.

    _urlLoader.addEventListener (Event.COMPLETE, onDataLoaded);

    _urlLoader.load (new URLRequest (file));

    and

    public function get getXMLData (): XML

              {

    return _xmlData;

              }

    It seems that the get accessor (var test: XML = mainBoards.getXMLData ;) in the document class are called before the COMPLETE event in the LoadXMLData class is finished and method of onDataLoaded, thus showing the test property in the document as a null class when I draw...)

    I tried a while loop, but it seems to just crash flash.

    var mainBoards:LoadXMLData = new LoadXMLData ("Main_boards.xml");

    while(mainBoards.getXMLData == null)

                   {

    trace ("data xml not loaded");

                   }

    var test: XML = mainBoards.getXMLData;

    trace ("test proparty" + test);

    is there a better way to wait until data from the XML file are loaded into the LoadXMLData object before the mainBoards.getXMLData is assigned to the test variable in my document class?

    Thank you.

    use:

    in your onDataLoaded() function, add:

    dispatchEvent (new Event ("xmldataLoaded"));

    var mainBoards:LoadXMLData = new LoadXMLData ("Main_boards.xml");

    mainBoards.addEventListener ("xmldataLoaded", getF);

    function getF(e:Event):void {}
    ensure that mothers are not local to a function

    var test: XML = mainBoards.getXMLData;

    trace ("test proparty" + test);

    }

  • How to dynamically create variables of StationGlobals who are LabVIEWIOControl

    I'm looking for a way to dynamically create variables StationGlobals LabVIEWIOControl.  I know not how to create variables through "PropertyObject/SetValXXX", however I have some difficualty create variables that are custom data types.

    Thank you

    Bryon

    Bryon,

    You can use an expression as follows:

    StationGlobals.NewSubProperty("MyVariable",PropValType_NamedType,False,"LabVIEWIOControl",0)

    I hope this helps!

  • Impossible to use variables shared when deploying an exe file

    I tried to use variables shared for some time. I have been all over the forums and still have had no luck. I can get these VI to work until I have install on another PC while they do any work. I don't know what I'm doing wrong. I forced libraries to deploy, but they still do not work on the machine, that I install the exe file. I don't think that libraries are being installed. I can't see in the Distributed System Manager. I can see libraries on other machines, but not on the one that I have.

    Have you included libraries in section always included the source files.  You did, and then change the destination of the library of media files on the Source code file settings tab?

    In the code are you using the correct path when calling the libraries deployment method.   Current path of the VI should be stripped twice and have "data\name.lvlib" built in the end.

  • call setup, load or unload the vi in memory

    Hi everyone, I need your help!

    I tried to call sub-vis in different ways:

    Sub1.VI call for installation - load with callers (normally)

    Sub2.VI call setup - refill for each call

    SUB3.VI call setup - load and keep on first convocation

    SUB4.VI call dynamically with "open reference vi.

    in main.vi, a structure of the event and a while loop are used to call sub-vis

    one another while loop (a node inside application property) is used for checking, that vi is in memory

    After having main.vi runs, sub1 and sub2, sub3 are in memory. Is not only sub4. but I think it's a mistake.

    in my mind, sub2 and sub3 must not in memory, because they are not yet called.

    can explain you it? Thank you.

    my English is terrible, I hope, you will understand what I mean.


  • How to talk to the caller in a dynamic way called vi?

    Hello

    following situation:

    A vi is loaded dynamically into a secondary on the Panel of vi calling using the property node "running vi. The called vi needs to know by what vi It was called. That we can learn from some of the contributions to the discussion forum or to own experiences, appellant vi only name in the table given by the property node '"appellants names' if the vi is called"by reference. " If it is called by the property node 'execution vi', there seems to be no way of knowing the identity of the caller from inside the vi that is called. Is there at least a solution which makes use as a callee vi runs in a school on the Panel of the appellant? Is there a property to read the identity of the secondary, in that the called vi runs inside the called vi?

    Because my explanation has become probably already quite confused, I enclose a simple example.

    Peter

    I don't think that there is a way to do it because the VI in the Panel is concerned, it runs as a first level VI. A workardound is to use a control. During the call to the use of VI VI server to set the value of the control (with the value of the control-> the Set method) on behalf of the VI who calls the VI. True, it requires you to use a control, but it's not so bad of a workaround.

Maybe you are looking for