Copy out event.result a XML var XML data do not work

So I'm pretty new to Flex, but learning with the help of a few books. I'm totally confused here though, as I'm copied an example right out of The Flex 3 Bible and its does not work the way I thin it should. My code is below. Here's my problem. I read in an XML from a php script. Works very well. In debugging, I can say that the event.result gets the XML as it should. In the resultHandler I am trying to copy it into a variable that I assigned called myCollection. That's all just not happens for a reason any. If I look at the variable in debugging, set to null. After that I'm trying to take innertags and get out (myCollection.trumpet.settings). Of course this does not work because myCollection is filled with nothing. It was just released an example page 654... I've been bangging my head against the wall for hours. any help on how to copy the data off event.result would be great.

-----

<? XML version = "1.0" encoding = "utf-8"? >
"< mx:Application xmlns:mx ="http://www.adobe.com/2006/mxml"layout ="absolute">"

< mx:Script >
<! [CDATA]
Import mx.rpc.events.ResultEvent;
Import mx.collections.ArrayCollection;
[Bindable]
private var myCollection:XML;
private var xReturn:Object;

private void resultHandler(event:ResultEvent):void
{
myCollection = event.result as XML;
xReturn = myCollection.trumpet.setting;
TextBox.Text = myCollection;
}
[]] >
< / mx:Script >

"" < mx:HTTPService id = "myService" url = "http://10.101.50.60/get_config.php"
method = "POST" showBusyCursor = "true" result = "resultHandler (event)" / >

< left mx:VBox = "25" top = "25" >
< mx:Button label = "Get data" click = "myService.send ()" / >

< mx:Label id = "textbox" >

< / mx:Label >
<!-< mx:DataGrid id = "myGrid" dataProvider = "{myCollection}" / >-->
< / mx:VBox >

< / mx:Application >

Try setting the resultFormat = "e4x" in the HTTPService.

Tags: Flex

Similar Questions

  • batch file to copy the file with the extension of the date - does not work in Windows 7

    Under XP, I got a batch file to copy files daily and rename them with the date, as:

    Project_Tracker_Copy.mdb

    TO

    Project_Tracker_Copy_2012_01_17.mdb - it would make the current format YYYY_MM_DD day

    next day, through Planner, he would run the batch and I'd end up with

    Project_Tracker_Copy_2012_01_18

    Here is the key part of the DOS command:

    Ren S:\archive_2012\Project_Tracker_Copy.mdb Project_Tracker_Copy_%date:~6,4%_%date:~0,2%_%date:~3,2%.mdb

    A batch file that runs hidden in Task Scheduler. [Task Scheduler starts the vbs & the vbs starts the batch file.

    This example shows how run the batch BackupCoreFiles.bat - the only point the vbs to packaging is so he can run hidden like Task Scheduler it would be otherwise in the default command window & that can be a distraction, if you work on something else at the time.

    Set WshShell = CreateObject ("WScript.Shell")
    Chr (34) WshShell.Run & "C:\Program Files (x 86) \Backup" & Chr (34), 0
    Set WshShell = Nothing

    The well-informed person who first posted this code was Ramesh Srinivasan how to run . BAT files invisible

  • Help! Search XML expression does not work!

    var xml: XML =
    nodes <>
    < node data = "1" >
    < data node = 'a' / >
    < node data = 'b' / >
    < / node >
    < / node >;

    I want to get the node to < data node = "a" / >.
    the expression:
    ... XML node. (@data is 'a');
    does not work.

    How can I do then?
    Any help will be appreciated.

    Thank you.
    Netsesame.

    It's my fault.

    the expression:
    ... XML node. (@data == 'a') does not.

    However, the debugger trace do nothing:
    trace (xml, node.) (@data is "a")) ;

  • A STANDARD XML TAG DOES NOT WORK PROPERLY WHEN USED IN RTF FILE FOR XML RE

    Hello

    I am using the following tag:
    <? If: TASK_STATUS = "Open"? > < xdofo:ctx xsl: attribute = 'block' name 'color' = > red < / xsl: attribute >
    <? end if? >
    to change the color of foreground text which, according to some conditiosi, need to print in
    PDF format using xml and rtf files reports.
    But I was able to get only 3 colors (red, blue, green) to use, other colors such as orange, cyan etc are not
    work.
    Please let me know what all the colors are supported by oracle in printing to PDF using xml reports.
    Indicate if we do a few things related to parameters or so.

    I'm usning 5.6.3 XML version.

    Kind regards
    Amar

    Colors can be expressed by a known name and a hexadecimal value. The hexadecimal format is widely used in HTML programming and has a format of #abcdef, and "abcdef" may be as aaddcc values and so on. For some primary colors, you can get away with #abc, but this is not very common.

    You should always design with colors Web safe in mind. That limited to 16, but should be much thinner (more all 16 have known names like red, cyan, yellow, etc.).

    http://www.w3schools.com/HTML/html_colors.ASP has a good explanation of the standards.

  • Xml import does not work

    Hello I am trying to import an xml file into a document but its not allowing importation.

    Let me clarify a bit, I've imported the same XML in all 50 to 60 different documents without any problems, but now I have a document that does not allow me to import the xml file.

    After looking a little deeper, I found the following:

    Schermafbeelding 2013-02-06 om 09.44.02.png

    You can see that the "Only items import that corresponds to the existing structure" parameter is checked. When I uncheck this setting, the xml is imported correctly.

    Now, I tried to simulate is via script but without success.

    Here is what I tried:

    InDesign.app.xmlImportPreferences.importToSelected = true;
    InDesign.app.xmlImportPreferences.importStyle = XMLImportStyles.MERGE_IMPORT;
    InDesign.app.xmlImportPreferences.ignoreUnmatchedIncoming = false;
    
    

    extract the same work:

    {with (App.Documents.Item (0) .xmlImportPreferences)}

    ignoreWhitespace = true;

    createLinkToXML = false;

    ignoreUnmatchedIncoming = false;

    importToSelected = false;

    importStyle = XMLImportStyles.MERGE_IMPORT;

    importTextIntoTables = false;

    }

    App.Documents.Item (0) .xmlElements [0] .importXML (file("D:/Untitled1.xml"));)

  • How can I make a copy of the "Windows Calendar" - my 'save Windows' installation does not work!

    I would like to 'save' the Windows Calendar and save it to a Kingston USB device, or something similar. I seem to be unable to locate the file via the 'computer' tab - the only file I could find/copy was the "quick start up.

    Perhaps Windows does not allow me to do so, but if there is a way I would like to hear that I am very dependent on the use of every day of the calendar.

    Hi Wayne N.,.

    1. What is the exact error you get when you try to make the backup of windows?
    2. don't you make changes to the computer before the show?

    The first thing you want to do is to ensure you have all of your known appointments, meetings and functions is entered in the calendar.
    a. click on file in the windows calendar.
    b. click on export. (This will take you to the export dialog box.)
    c. choose a location to store the file *. ICS. (The ICS standard is a standard text developed by Apple to facilitate importation of text data for the calendar).
    Note: Save the file to removable media such as a CD or a Flash drive and bring it to another computer to import other utilities of calendar. Or you can also save it on the same computer for upload to the calendar application.

    Now we can import this file into several types of calendar applications such as Yahoo or Google Calendar online. For example, I'll show import you backups window "in MSN Calendar.

    Go to your MSN Calendar, and click the Add drop-down list and import calendar. Enter the location of the backup schedule, and then click Import.


    NOTE:
    another thing to remember is the file ICS is a calendar snapshot. This means that all changes will not automatically be saved in the file. If you rely on your calendar strongly make sure to save regularly.

  • out of the box - right panels 2 USB does not work!

    edge 14 news - 0578-65u (hd7200 4gig ram i3 blutetooth and fingerprint reader)

    I have tried reinstalling drivers-, but it basically says that the equipment cannot be installed. can they be disconnected from the factory? (not good)

    Hi oronm!

    Have you tried the latest version of the BIOS? There is a fix for these two ports does not work after sleep.

    I hope this helps.

    Edit: Typo fixed.

  • How to access xml data

    Good day all

    That I retrieved from the data of a server, for example, is an XML document. The document looks like this:

    <? XML version = "1.0" encoding = "UTF-8"? >

    -results >

    -Status code 'invalid' = >

    < no access = user name account "7300" id = "7" / >

    < / status >

    < / results >

    What the code would look like?

    Is this correct? accountId = event.result.common.account. @ [' account-id ']; In my code I can access id account, but if I use the same code cannot access user id i.e. accountId = event.result.common.account. @ [' user id']; does not work


    Or how do you access code?


    Obviously, I'm doing something wrong. Can you help me or send me the documentation which can explain this for me?


    Thank you


    Dimitri

    I found the answer to my question at the http://lyle.smu.edu/~coyle/cse7346/handouts/S09.XML%20and%20Flex.pdf

    Document brilliant

  • Using EXTRACT XML data extraction

    Hi, I have a XML file where I want to analyze the fields in a table in DB:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < FIXML > < batch > < MktDataFull BizDt = '2012-07-13' > < Instrmt Sym = "JCPRXU" ID = "JCPRXU" Desc = "JCP.SR. XR. «USD"SecTyp ="CD"Src ="H"subtype = MMY" S "="201209"MatDt = ' 2012-09-20" Mult = Exch "0.01" = "CMD" UOM = "CTL" UOMCcy = "USD" UOMQty = "1" PxUOM = "IPNT" ValMeth = "CD" CpnRt = "1.0" IntAcrl = ' 2012-06-20 ' CpnPmt = ' 2012-09-20 ' NotnlPctOut = "100.0" Snrty = 'SR' RstrctTyp = 'XR' DayCntMeth = "ACT/360" tenor = "0 M" > < DITTA HELP = "US708130AC31" AltIDSrc = "105" / > < HELP AltID = "JCP.SR." "" ""» XR. USD.12U.100"AltIDSrc ="101"/ > < HELP DITTA = '1 201209 JCPRXU' AltIDSrc = 'H' / > < DITTA HELP ="1 201209 JCPRXU"AltIDSrc ="100"/ > < Evnt EventTyp ="5"Dt ="2008-09-19"/ > < Evnt EventTyp = '7' Dt = '2012-09-19' / > < Evnt EventTyp ="19"Dt ="2012-10-05"/ > < Evnt EventTyp ="100"Dt ="2012-07-16"/ > < Evnt EventTyp = '8' Dt ="2012-07-14"/ > < Evnt EventTyp = '9' Dt = '2012-09-20' / > < Evnt EventTyp ="101"Dt = '2012-03-20' / > < Evnt EventTyp ="102"Dt ="2008-09-20"/ > < Evnt EventTyp = « 103 » Dt = « 2008-09-22 » / >< Evnt EventTyp = « 104 » Dt = « 2012-09-19 » / >< Evnt EventTyp = « 111 » Dt = « 2012-09-20 » / >< Evnt EventTyp = « 112 » Dt = « 2012-06-20 » / >< Evnt EventTyp = « 113 » Dt = « 2012-03-20 » / >< Evnt EventTyp = « 114 » Dt = « 2012-07-12 » / >< Evnt EventTyp = « 115 » Dt = « 2012-07-16 » / >< / Instrmt >< complet Typ = « 6 » Px = Mkt « 99.7433368 » = « CMD » QCond = « 6 » PxTyp = « 1 » OpenClsSettlFlag = « 1 » >< / Full >< complet Typ = « 6 » Px = « 234.5254 » Mkt = QCond « CMD » = « 6 » PxTyp = « 6 » ' OpenClsSettlFlag = '1' > < / Full > < full Typ = "Y" Px = Mkt "40.0" = 'CMD' PxTyp = '1' OpenClsSettlFlag = '1' > < / Full > < full Typ = '6' Px = "234.5212" Mkt = QCond 'CMD' = '7' PxTyp = '6' OpenClsSettlFlag = '1' > < / Full > < full Typ = Mkt "B" = 'CMD' OpenClsSettlFlag = '4' Sz = '0' > < / Full > < full type = 'C' Mkt = 'CMD' OpenClsSettlFlag = '4' Sz = '0' > < / Full > < full Typ = 'z' Px = Mkt '0.18' = 'CMD' PxTyp = '1' OpenClsSettlFlag = '1 '. > < / full > < full Typ = 'y' Px = "0.1899965" Mkt = QCond 'CMD' = '6' PxTyp = '5' OpenClsSettlFlag = '1' > < / Full > < InstrmtExt > < Attrb Typ = '100' Val = '24' / > < Attrb Typ = '101' Val = '0' / > < Attrb Typ = '109' Val = '0' / > < Attrb Typ = '103' Val = '24' / > < Attrb Typ = '102' Val = '24' / > < Attrb Typ = '110' Val = '3' / > < Attrb Typ = '29' Val = 'Y' / > < Attrb Typ = '112' Val = 'Y ' /. > < / InstrmtExt > < / MktDataFull > < / batch > < / FIXML >


    Right now, I'm just trying to extract the first 3 fields, BizDt, Bal and id I use to analyze the following:


    SELECT
    Extract (value (p), '/BizDt') .getStringVal () AS DATE_,.
    Extract (value (p), ' /Instrmt/Sym').getStringVal (AS SYMBOL),)
    Extract (value (p), ' /Instrmt/ID').getStringVal () AS ID_)

    OF s TABLE_NAME.
    TABLE (XMLSEQUENCE (Extract (xmlType.createXml (s.CDS_CLOB), ' FIXML/batch/MktDataFull / *'))) p
    WHERE s.ID_ = 1

    But I get nothing back. My guess is the because the XML data does not have opening tags and formal closing, because if I change my XML like this:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < FIXML > < batch > < MktDataFull > < BizDt > 2012 - 07 - 13 < / BizDt > < Instrmt > < Sym > JCPRXU < / Sym > < ID > JCPRXU < /ID > < Desc > JCP.SR. XR. USD < / Desc > < SecTyp > CD < / SecTyp > < / Instrmt > < / MktDataFull > < / batch > < / FIXML >

    I was able to get the data. Therefore, in order so solve this problem, what should I do with my original XML? Can I format the tags?

    Thank you

    When you nest xsl: for each of the elements, the select expression is evaluated in the context of the enclosing instance.

    Consider this:

    
      
    

    This means you are trying to match items complete as children Instrmt, that is not correct, because they are actually siblings.
    In the same goes for HELP, Evnt etc.

    I don't know what kind of structure you want.
    Caps all does not much sense given that groups of brothers of repeat items that have no apparent correlation between them. Essentially, you end up with a big Cartesian product.

    I would approach this by storing repeated elements in different tables with a parent/child relationship to preserve the hierarchical nature of the data (if necessary).

  • Windows crashes, Windows search does not work, EVENT ID 7042, 1006, 3024, 7040

    When I ran the pc fix - it sollution for windows crashing the results were as follows: Windows search does not work.  The reason;  An event id is logged on to windows search.  Event id numbers are... 7042, 1? 006, 1000, 3024, 7040.

    I'm sorry to say that I do not understand what it means, so I have no idea how to solve this problem.  Your help would be greatly appreciated... ty B.Gregory

    Hi beckilu,

    1. what operating system do you use?

    I suggest you run the fixit from the following link and see if that helps.

    Fix Windows Search when it crashes or shows no results
    http://support.Microsoft.com/mats/windows_search/en-us

  • My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009:

    My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009: cannot access a property or method of a null object reference.

    I have a very simple question. I want to take the value of

    Event.Result.Item.nodeindex1.nodeindex2.Row.MyValue;

    and assign it to a text field

    mytextTi.text = event.result.item.nodeindex1.nodeindex2.row.myvalue;

    But if a part of the tree is missing, which is also valid, so I get TypeError: Error #1009: cannot access a property or method of a null object reference.

    I tried various solutions such as the following. Is there any simple way to do this?

    If (event.result.item.nodeindex1.nodeindex2.row.myvalue! = undefined)-does not work

    Unfortunately, one must test all levels to ensure that it is not null before the reference to it. You can take advantage of the short-circuit evaluation in tying together, for example

    if (event.result.item
        && event.result.item.nodeindex1
        && event.result.item.nodeindex1.nodeindex2
        && event.result.item.nodeindex1.nodeindex2.row
        && event.result.item.nodeindex1.nodeindex2.row.myvalue)
    {
        // access the variable
    }
    else
    {
        // one of the XML nodes in the path is null
    }
    

    Or you could stay away from her a little hacky and wrap the reference in a try/catch block.

    -Tom

    Flex SDK engineer

  • Result of the handful of XML data with httpservice

    Hello

    Please find my xml data http://121.242.211.152/janaagraha/get_complaints

    I need to load these xml data through httpservice and depending on the result of the handle, I need access to individual data as complaints.complaint.title using the service loop. I tried this I could not get the result I need

    " < s:HTTPService id = 'Complaints' url = ' http://121.242.211.152/Janaagraha/get_complaints "result ="Complaints_resultHandler (event)"fault =" Complaints_faultHandler (event) "> "

    < / s:HTTPService >

    < fx:Script >

    <! [CDATA]

    protected function Complaints_resultHandler(event:ResultEvent):void

    {

    var complaintarray:ArrayCollection = event.result.complaints.complaint;

    var carray:Array = complaintarray.toArray ();

    for (var i: Number = 0; i < carray.length; i ++)

    {

    var cmparray:Array is ObjectUtil.toString(carray[i]).split('~~~');.

    Title: string var = ObjectUtil.toString(cmparray[0]);

    Alert.Show ("HI" + title);

    }

    }

    Please suggest I need to get data like title, complainturl, latitude longtitude etc.

    Concerning

    Jeremi

    Your node of categories is not necessary contain two category nodes, check if there is in fact two categories:

    var complaint_cat:XMLList = complaint.categories.category;
    if(complaint_cat.length() > 0){
         var mainCategory:String = complaint_cat[0].toString();
         if(complaint_cat.length() > 1){
              var subCategory:String = complaint_cat[1].toString();
         }
    }
    trace("main category: " + mainCategory + ", sub category: " + subCategory);
    

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • How to exclude the each row of the result set XML declaration?

    Hello

    I have a table with an XMLTYPE column and would like to SELECT a set of rows. How can I exclude the each row of the result set XML declaration? My query currently looks like this, I am running through Spring JDBC:
    SELECT XMLSerialize FROM t1 WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e") ORDER BY t1.time DESC myschema.event (HAPPY t1.xmltext)

    After selecting, in my application I convert each line in a string and concatenate all the rows in a large chain to analyze in a DOM model. I get a parser exception (org.xml.sax.SAXParseException: the target of the processing instruction corresponding to "[xX] [mM] [he's]" is not allowed) because there are several XML statements in my large chain. Of course, I could manually check the string on each line if it starts with the XML declaration, but it would be nicer if I could load the DB does not add it in the first place. Is there a way?

    Thank you!
    -Daniela

    Hello

    Some options that I can think of:

    SELECT XMLSerialize(CONTENT
     XMLtransform(t1.xmltext,
      xmltype('
     
     
    ')
     )
    )
    FROM myschema.event t1
    WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e")
    ORDER BY t1.time DESC
    ;
    

    or quite simply,.

    SELECT XMLSerialize(CONTENT
      extract(t1.xmltext,'/')
    )
    FROM myschema.event t1
    WHERE XMLEXISTS('$e/Event' PASSING XMLTEXT AS "e")
    ORDER BY t1.time DESC
    ;
    
  • How the filter E4x Xml data in a tile list?

    Hello!

    I am trying to use a search box for some xml data that I have in a tile list. Can someone point me in the right direction?

    Here is the list of tile:

    < mx:HTTPService id = "GetXmlService".

    resultFormat = "e4x".

    Fault = "getXMLFault (Event); »

    result = "getXMLResult (Event); »

    showBusyCursor = "true" / >

    < mx:TileList id = 'tileList '.

    dataProvider = "{GetXmlService.lastResult.image}" "

    itemRenderer = "CustomItemRenderer."

    columnCount = "4".

    columnWidth = "125".

    number of lines = '2 '.

    rowHeight = '150 '.

    themeColor = "haloSilver".

    verticalScrollPolicy = "on".

    itemClick = "tileList_itemClick (event); "backgroundAlpha ="0"height ="487"borderStyle ="none"="30"right ="10"left ="10"/ >

    And here is the XML data:

    <? XML version = "1.0"? >

    < Gallery >

    < user name image = "People1' rating ="5"="yes"/ >

    < / Gallery >

    Hello

    protected function searchFunc(item:Object):Boolean

    {

    var username:String = .@username (XML topic);

    var insession: String = .@insession (XML topic);

    username = (username.substr(0,ti.text.length)) .toUpperCase ();

    var chkUser:String = (ti.text) .toUpperCase ();

    If (username == chkUser & insession.toUpperCase () == "YES")

    Returns true

    on the other

    Returns false;

    }

    I changed the variable names to make it a little clearer. Now whenever you perform a search it will only show according to Yes (Yes). You can have nested If more more complex application but remember there is always need to be a return to true or false for each record (item).
    David.
  • Filtering XML data in the grid

    I can't sem to figure out how to filter my XML data before entering my data grid. I want to load only the XML data with the ID 'BALUSTER' attribute and have tried to enter:

    data_grid. DataProvider dp =. (@ID IS 'BALUSTER');

    in my function xmlLoaded without success.  I'm fairly new to as3 and could certainly use the help.  Thank you.

    var dpataProvider;
    var products_xml:XML;
    var xmlReq:URLRequest = new URLRequest("data/products.xml");
    var xml_loader:URLLoader = new URLLoader();

    function xmlLoaded(event:Event):void {}
    var ldr:URLLoader = event.currentTarget as URLLoader;
    var xmlDP:XML = new XML (ldr.data);
    DP = new DataProvider (xmlDP);
    data_grid. DataProvider = dp;
    }

    xml_loader. Load (xmlReq);
    xml_loader.addEventListener (Event.COMPLETE, xmlLoaded);

    Assign the filtered data (not the original) to the data provider:

    function xmlLoaded(event:Event):void {}
    var ldr:URLLoader = event.currentTarget as URLLoader;
    var xmlDP:XML = new XML (ldr.data);
       
    var data: XML = ;
        data.setChildren (xmlDP.PRODUCTS. (@ID) IS 'BALUSTER'));
       
    DP = new DataProvider (data);
    data_grid. DataProvider = dp;
    }

Maybe you are looking for

  • Equium A60: How to get the display on TV?

    Can someone give me details on how I can get my Equium A60 (with ATI7000 graphics card) display appears on my TV? I tried to use the S-video out to TV s-video but the ATI displays tab said that the TV is not connected. I tried to boot up the laptop w

  • scanner slide

    Mijn dia scanner 100 F (ovt X 86) kan driver niet vinden

  • identify and remove redundant programs and files

    redundant programs and files

  • bypassing the locked home screen

    I'm locked out, no password, no disc, cannot open the IRB to type in the race, but I thought I remember someone showing me theres a trick secret to bypass this screen, has something to do with the arrow next to the password box. is this true? What is

  • Change a column value in the reports

    Hi allI have a column that contains values such as 12345678, 78945612, etc... Now, I wanted to change the values like 123-45678, 789-45612 etc...Baiscally this field is an 8-digit integer, and I would like to insert the dashboard after three digits.