How get/treat XMLSocket data?

Hi all

I use Adobe CS6 professional and Actionscript 3.0.

First, I have a c# program that basically just rss out data from a server in the form of XML data. I then a Flash program that is to receive the data, and then I do stuff with it. We had this work in Actionscript 1.0, but we need to upgrade the Actionscript 3.0 code, but instead of just try to convert stuff over to the new version of Actionscript, I'm going to re - write the program.

So far I've basically just set some EventListeners over who I found examples of online for the use of XMLSockets. Now the Flash program will connect an XMLSocket server that feeds the data to the server the data feed returns new data every 5-10 seconds or more.

Thus, when a group of XML data arrives to the port, I've defined, the following function is executed to handle the incoming data. Of my EventListener function for "socket.addEventListener (DataEvent.DATA, dataHandler);" ("socket" is defined as-> var socket = new XMLSocket(); ). So when comes the new data, it runs the function above. 

The sentence I feel is to declare a new variable of type "XML" and then using this variable to get out of ' knots/children ' from the incoming XML data. I found an online example was very close to what I want to do, except instead of using an XMLSocket to get constantly streaming data in use the "'URLLoader ' function to get the data XML." I know I get the XML data on the server, because if I put (e: DataEvent) variable defined in the 'head' in a string function and before you run a trace on that I can see ALL the XML data in the 'Output Window'.

But I can't seem to be able to assign a variable XML (e: DataEvent) so I can access data XML, the individual elements. The example that I found (which uses the URLLoader instead) uses this line (myXML = XML (e.target.data);) new to set the Variable XML, which does not work for me, and if I try to do the same thing in my code it simply prints for as many lines there are XML data-> '[XMLSocket object]'

MY CODE:

* I left the other functions that are in my code for the EventListeners you will see defined below, with the exception of the one in question:

-> "function dataHandler(e:_DataEvent):void".

import flash.events.IOErrorEvent;

to import flash.events.ProgressEvent;

import flash.events.SecurityErrorEvent;

import flash.events.DataEvent;

Socket var = new XMLSocket();

socket.addEventListener (Event.CONNECT, connectHandler);

socket.addEventListener (Event.CLOSE, closeHandler);

socket.addEventListener (DataEvent.DATA, dataHandler);

socket.addEventListener (IOErrorEvent.IO_ERROR, ioErrorHandler);

socket.addEventListener (ProgressEvent.PROGRESS, progressHandler);

socket.addEventListener (SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

success of the var = socket.connect ('server.domain.name.local', 3004);

/*

The code for this function was used in an example online as described above in the post, I found:

          LINK --> http://www.republicofcode.com/Tutorials/Flash/as3xml/

*/

The code comment (* blue) will display ALL the XML inside the window "output":

function dataHandler(e:_DataEvent):void {}

var myStr:String = e.data;

var xml;

XML = new XML (e.target.data);  / / <-CE n "T WORK (I DON'T think THAT 'target' IS CORRECT HERE)? "

if (socket.connected)

{

trace (myStr)

trace (XML);

}

}

The line output of the "trace (xml)" will show these data below in the "output" window (* FYI there should be 6 rows of XML data on each 'update'):

[XMLSocket object]

[XMLSocket object]

[XMLSocket object]

[XMLSocket object]

[XMLSocket object]

[XMLSocket object]

Could someone show or point me in the right direction on this. I want to be able to access specific parts of the incoming XML data.

Some examples of XML data:

< VAR MESSAGE = "screen2Display" TEXT = "CSQ_1" / >

< VAR MESSAGE = "F1_agentsReady" TEXT = "111" / >

< VAR MESSAGE = "F1_unavailableAgents" TEXT = "222" / >

< VAR MESSAGE = "F1_talkingAgents" TEXT = "333" / >

< VAR MESSAGE = "F1_callsHandled" TEXT = "444" / >

< VAR MESSAGE = "F1_ABDRate" TEXT = "555" / >

Any ideas or suggestions would be greatly appreciated... !

FOR INFO:

I am VERY new to Actionscript/Flash development (* about a week now), so go easy on me haha...

Thanks in advance,

Matt

In view of the DataEvent documents

http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/events/DataEvent. HTML

Looks like you need to read the property of the event data:

var XML is new XML (e.data) - not e. .data target

Tags: Adobe Animate

Similar Questions

  • How to get back my data for the health and the watch Apps once I've restored my phone?

    How to get back my data for the health and the watch Apps once I've restored my phone?

    From the backup, you're going to be restoration.

    If you back up to iTunes, make sure that it is an encrypted backup.

  • My watch clock: 2012,03,2012 at 20:10. How to get back the Date please.

    My watch clock: 2012,03,2012 at 20:10.  How to get back the Date please.

    http://www.ehow.com/how_2052285_change-time-date-Windows-XP.html

    http://support.Microsoft.com/kb/307938

    UTC/GMT is 20:12 on Friday, February 24, 2012

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • How to add two lines when the second row is not visible, but also gets the first data line too?

    Mr President

    Jdev worm is 12.2.1

    How to add two lines when the second row is not visible, but also gets the first data line too?

    I want to add two lines like below picture, but want the second to remain invisible.

    tworows.png

    I asked this question but my way of asking was wrong, that's why for me once again.

    Concerning

    Try to follow these steps:

    1. in the database table to add the new column "JOIN_COLUMN" and add the new sequence "JOIN_SEQ".

    2. Add this new column in the entity object. (You can add this in entity object by right clicking on the entity object and then select "Synchronize with database" then the new column and press on sync)

    3. in your bookmark create button to create only one line NOT 2 rows.

    4 - Open the object entity--> java--> java class--> on the entity object class generate and Tick tick on the accessors and methods of data manipulation

    5 - Open the generated class to EntityImpl and go to the doDML method and write this code

      protected void doDML(int operation, TransactionEvent e)
      {
        if(operation == DML_INSERT)
        {
          SequenceImpl seq = new SequenceImpl("JOIN_SEQ", getDBTransaction());
          oracle.jbo.domain.Number seqValue = seq.getSequenceNumber();
          setJoinColumn(seqValue);
          insertSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        if(operation == DML_UPDATE)
        {
          updateSecondRowInDatabase(getAttribute1(), getAttribute2(), getAttribute3(), getJoinColumn());
        }
    
        super.doDML(operation, e);
      }
    
      private void insertSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "Insert into table_name (COLUMN_1,COLUMN_2,COLUMN_3,JOIN_COLUMN, HIDDEN_COLUMN) values ('" + value1 + "','" + value2 + "','" + value3 + "','" + joinColumn + "', 1)";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
      private void updateSecondRowInDatabase(Object value1, Object value2, Object value3, Object joinColumn)
      {
        PreparedStatement stat = null;
        try
        {
          String sql = "update table_name set column_1='" + value1 + "', column_2='" + value2 + "', column_3='" + value3 + "' where JOIN_COLUMN='" + joinColumn + "'";
          stat = getDBTransaction().createPreparedStatement(sql, 1);
          stat.executeUpdate();
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
        finally
        {
          try
          {
            stat.close();
          }
          catch (Exception e)
          {
            e.printStackTrace();
          }
        }
      }
    
  • I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows?

    I tried to download a pdf and convert them into excel, but the data in excellent is always to the image format.  How can I get the pdf data into the columns and rows so that I can do the calculations?

    If you start the https://forums.adobe.com/welcome Forums Index

    You will be able to select a forum for the specific Adobe products you use

    Click on the symbol "arrow down" on the right (where it is said to see all our products and Services) to open the drop-down list and scroll

  • How to get the current date to display in the Spanish format.

    The coding is in format Adobe Acrobat, DC. The coding I have for the English today's date is:

    var d = new Date();

    sDate = util.printd var ("dd mmmm yyyy", d);

    this.getField("Text1").value = sDate;

    How can I get the current date displayed in this Spanish format: 07 December 2015

    Thank you

    It's a little complicated... But this code should do the trick:

    util.printd("dd", d) + " de " + util.printd("date(es){MMMM}", d, true) + " de " + util.printd("yyyy", d);
    

    Edit: Fixed the code... Did not notice the 'of' second before.

  • How to get the path data graphics (M, L, Q, etc...)?

    I have a shape on the stage and I want to get its graphics data (M, L, Q, etc), I tried the readGraphicsData method, but I could not find the data path & orders!

    var stage_shape: Shape = this.getChildAt (0) as a form;

    var v: vector. < IGraphicsData > = stage_shape.graphics.readGraphicsData (false);

    trace (v);

    output: [object GraphicsSolidFill], [GraphicsPath object], [object GraphicsEndFill]

    trace (v [1]);

    output: [object GraphicsPath]

    Then. How to get path data (178,5 M157.55 Q273.7 188.45 392,5 178,5 L392.5...)?

    Thank you.

    var stage_shape: Shape = this.getChildAt (0) as a form;

    var v: Vector. = stage_shape.graphics.readGraphicsData (false);

    trace (v);

    output: [object GraphicsSolidFill], [GraphicsPath object], [object GraphicsEndFill]

    trace (GraphicsPath(v[1]). Data);

  • How to get the numeric date on reviews, no positions.

    Hello

    Can someone tell me how can I get a digital date on my blog comments? date is currently like 'may 25, 2015', and I wish it were "25/05/2015".» I went into the code and saw that the use of this tag "{tag_usagedate}", I managed to fix this for the blog because there is this tag: "{tag_blogpostmonthnumeric}", how can I do the same thing for comments date? " I need to do this because my site is in Portuguese, and it's the only way I found the date of the translation. Unless someone can teach me what are these tags and how can it change directly in their table of months for something like {'February', 'Marco', 'Janeiro', 'April',..., 'December'}. Any help is appreciated.

    Thank you

    Alex.

    To do this I use liquid, make sure it is enable on your site, something as it does the job, maybe someone should check the syntax.

    {{date | date: ' %d-%m - yyyy "}} for all numeric values, but {{date | date:"%d - MMM-yyyy"}} should return the date with the month names in your culture.

    Look here the Developer Reference for all filters.

  • How to stop the data date of getting indexed in the document type?

    Hi all

    I have a document where the date is used frequently, how to stop these dates back to get indexed?

    is it not possible to add dates in the stop class?

    Please let me know your suggestions

    Thanks in advance.

    The only available stopclass is currently numbers. However, in a text document, the dates are just numbers and characters. So, if you are using the numbers stopclass, which eliminates the part numbers of all dates. You can also add all the months, each abbreviation of the month, every day of the week and every abbreviation for all days of the week. I have demonstrated with just below. Of course, this will prevent also other numbers course tokenized so non-date.

    SCOTT@orcl_11g> CREATE TABLE test_tab (test_col VARCHAR2 (40))
      2  /
    
    Table created.
    
    SCOTT@orcl_11g> INSERT ALL
      2  INTO test_tab VALUES ('Today is Friday, May 15, 2009.')
      3  INTO test_tab VALUES ('Today is Friday, 15/May/2009.')
      4  INTO test_tab VALUES ('Today is Friday, 15-May-2009.')
      5  INTO test_tab VALUES ('Today is Fri, 15-May-2009.')
      6  SELECT * FROM DUAL
      7  /
    
    4 rows created.
    
    SCOTT@orcl_11g> BEGIN
      2    CTX_DDL.CREATE_STOPLIST ('your_stoplist', 'BASIC_STOPLIST');
      3    CTX_DDL.ADD_STOPCLASS ('your_stoplist', 'NUMBERS');
      4    CTX_DDL.ADD_STOPWORD ('your_stoplist', 'MAY');
      5    CTX_DDL.ADD_STOPWORD ('your_stoplist', 'FRIDAY');
      6    CTX_DDL.ADD_STOPWORD ('your_stoplist', 'FRI');
      7  END;
      8  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11g> CREATE INDEX test_idx ON test_tab (test_col)
      2  INDEXTYPE IS CTXSYS.CONTEXT
      3  PARAMETERS ('STOPLIST your_stoplist')
      4  /
    
    Index created.
    
    SCOTT@orcl_11g> SELECT token_text FROM dr$test_idx$i
      2  /
    
    TOKEN_TEXT
    ----------------------------------------------------------------
    IS
    TODAY
    
    SCOTT@orcl_11g> 
    
  • How can I get the filtered data from the first form

    How can I get the filtered data from the first form in a second form to make an update of the multi.
    Thank you very much

    William,

    I would use for this collections. A link is good if you need to pass a single value.

    1. create a collection
    2 fill the collection with your result set
    3. go in the page target and uses a method of a query in your link to this page
    4. your target page receives a request and allows you to edit documents.

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    -------------------------------------------------------------------

  • How to get the old data 6 months from the current date?

    Hi friends,

    I have a table which includes historical data, which are having more than 1 years old data. The historical table gets updated once a week. My requirement is that I should get the latest data from the week of each month for 6 months according to the current data. I use oracle 10g.

    Can you please someone help in this.

    Thanks in advance

    SELECT last_day (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL))-7 start_dt.
    LAST_DAY (ADD_MONTHS (TRUNC (SYSDATE, 'mm'),-LEVEL)) end_dt
    OF THE DOUBLE
    CONNECT BY LEVEL<=>

    change as a result, I have provided you the start and end dates for your logic...

  • during an update lots of my profile folder has been put in a folder on the desktop marked the old data. How to restore this data file

    During a bet to update, automatic update of windows has started and some how much my profile data has been removed and stored in a file on the desktop. There is a simple and easy way to restore this folder from the current firefox?

    You can use the contents of the Old Firefox Data folder to "roll back" the refresh, but this involves several steps. It's probably even faster than the recovery of individual files and load those into your new profile.

    Check in the folder 'Old data Firefox' update adds a folder with a random semi name on your desktop. If there is only one, that probably has your old settings and Add-ons. If there is more than one, you'll want to work with one who has been updated recently.

    Once you have identified the profile folder, that you want to restore, here is my "old profile resurrection suggested procedure:

    Overview

    Here are the steps described in more detail below:

    1. Create a new Firefox profile
    2. Delete all of this profile folder
    3. Copy in all of the old profile folder

    Create a new profile for Firefox (Windows)

    Exit Firefox completely and start up in the Profile Manager by pasting the following in the Windows search, or the Run dialog box by pressing ENTER:

    firefox.exe -P
    

    Note: any time want to switch profiles, exit Firefox and return to this dialog box.

    Click on the button create a profile, give it a name like OldSettings and skip the option to change the location of the folder. Select the new profile from the dialog box, and then start Firefox.

    Open the new profile folder in Windows Explorer

    Firefox in the new profile should look like a new installation of the plant. Open the troubleshooting information page by using either:

    • button "3-bar" menu > "?" button > troubleshooting information
    • Menu help > troubleshooting information
    • type or paste everything: in the address bar and press Enter

    In the first table, click on the view file"" button. Firefox will launch your new profile folder in Windows Explorer.

    This folder open, switch back to Firefox and get out by using either:

    • "3-bar" menu button > button "power".
    • (menu bar) File > Exit

    Firefox is closed, the profile folder must be front and Center, or you can activate it by using the taskbar.

    Copy old data instead of new

    In this new profile folder you just popped open - NOT the one on your desktop - select all content (you can use Ctrl + a) and delete (you can press Delete on the keyboard).

    Leave this window open, open or switch to your folder of old data of Firefox. Consult your old profile folder. At this level, you should see a folder named bookmarkbackups among other things.

    Select all (Ctrl + a) and copy (or right-click > copy or Ctrl + c).

    Switch to the empty profile folder in another window and paste (or right-click > paste or Ctrl + v). This may take a few minutes because some files are large.

    Launch Firefox

    Firefox should start in this 'new' profile with the old resurrected profile data. Success?

  • How to access the data in the row (text of children) in a pragmatic control tree?

    In LabVIEW 2010, I entered the data in row a tree with pragmatism control using the Add item and providing the child text table and the child tag for the line. When a row in the tree control is selected, I can get the line label in the Value property of the tree. But how do I access the data in the child text table when the line is selected? I can't seem to find a tree control property or method which will return data back.

    What I'm trying to do is: once a line in a tree is selected and a button is pressed, if the line tag is valid, I want to transfer all the data in row in another tree the same formatting. For this I need the data for the tree line and the line that was selected. I don't find a way to get access to these data of the line when it was composed in the tree.

    Can someone tell me how to access pragmatically the child text or row data in a tree control from a selected line in the tree? I have the label of the line, but how do I access data?

    Thank you for your help.

    Looking through numerous examples, I found how to do this using the properties ActiveItemRow and ActiveColNum, but I can't find these documented properties anywhere using LabVIEW. Even research through aid could not do anything about them.

    Where these important parameters are documented?

    Why they do not appear in the help?

    Are there other ways to access the data in the row (child text) form a selected line in a tree control?

  • How to remove the data files of cRIO

    Please forgive my ignorance, but I don't see how to remove the old a cRIO data files.  I tried to get a functional data logger, and I have some old files of data on the cRIO.  I ftp copies files through IE, but I don't know how to delete the files from the cRIO.

    If you FTP via Windows Explorer, my computer, ftp://adresse IP in the address bar, you should be able to delete the files.

Maybe you are looking for