How to get the Total number of nodes XML?

Hi all

I have a Flash program that I do in Actionscript 3, using CS6.

I use the XMLSocket class to read XML data. I'll write some examples of XML that is sent to the Flash

program below...

I know with this line here (below) I can access the 4th 'element or node' of XML data.

To access the XML nodes/elements:

* I created a Variable XML, called xml, and "e.data" contains ALL the XML data
var XML = XML (e.data);

Access to the 4th item of the data:

. xml MESSAGE[3].@VAR;          -> 'loggedOutUsers '.

. xml MESSAGE[3].@TEXT;         --->     "15"

EXAMPLE OF XML DATA:


< FRAME >

0 < VAR MESSAGE = "screen2Display" TEXT = "FRAME_1" / >

1 < VAR MESSAGE = "numUsers" TEXT = "27" / >

2 < VAR MESSAGE = "loggedInUsers" TEXT = "12" / >

3 < VAR MESSAGE = "loggedOutUsers" TEXT = "15" / >

4 < VAR MESSAGE = "admins" TEXT = "2" / >

< / FRAMEWORK >

I'm new to Flash and Actionscript but I am very familiar with other languages and how paintings and other work, and I know for

example, in a Shell Script to get the total number of items in an array called 'myArray' I wanted to write something like

This-> ${#myArray [@]}. And since the data processing XML looks a lot like a table I thought that there was perhaps

a way to access the total number of "nodes or elements" in the XML data...?

Any thoughts would be much appreciated!

Thanks in advance,

Matt

even if you don't need to run to the loop to know the length

var levelList: XMLList = xml.children ();

levelList.length (); This will give you the length of all children in your case of length MESSAGE of nodes;

Pls click useful if my answer is helpful.

Thank you

Bala

Tags: Adobe Animate

Similar Questions

  • How to get the total number of frames

    Hai...

    I need this code...

    I have n number of files (swf) flash. Each file contains a number of images. I need to get the totalframes of this flash in Actionscript 3.0 files.

    Please help me through Actionscript.

    You can use a movieclip totalFrames property to get the total number of frames for a timeline.

  • How to get the total number of pages

    Is there anyone know how to get the total page after generate us the pdf file. I use the remainder method and create an external process. ?

    In the workbench, I use a SetValue

    Until you assemble the document that you need to build the DDX string and specify the xml information.

    Concat (/process_data/@ddxHeadStr, " ")

    AFTER mounting

    Use SetValue that set your xmlinfo variable (xml type)

    xmlInfo/process_data/game FOR

    / process_data/assemblerResult/Object/documents[@id]

    [ ='doc_info.xml']

    Then get your pages from the XMLinfo

    /process_data/@NUMPAGES

    =

    / process_data/xmlInfo/docinfo/NUMPAGES

    I hope this helps.  Send an e-mail if it is not explicit.  I had to fight over there recently and feel that the documentation really lacks.

  • How to get the total number of pages have been printed using the pl/sql

    Dear all,

    I want to store the total number of physical pages printed in a database table, how could retrieve the value of the total number of pages.


    I am using Oracle 6i report

    thnxxx in advance :)

    At the end of your report (i.e. After all the images from your data model), place a dummy field. You can get the page number with srw.get_page_num in the trigger of the format of this field. Since it is the last field of your report, it is also the last page number.

  • How to get the total number of occurrences based on the value of a column.

    Hi all

    It is the first time I'll ask the question here on your forum, but since then followed several threads. I guess it's now my turn to ask a question. Anyway here's the thing, I have a query that should return to count the number of rows based on the value of HOUSING. Something like this:

    -----
    WIPDATAVALUE          SLOT             N            M
    1-2                   TRALTEST43S1     1            3
    1-2                   TRALTEST43S1     2            3
    3                     TRALTEST43S1     3            3
    4-6                   TRALTEST43S2     1            4
    4-6                   TRALTEST43S2     2            4
    4-6                   TRALTEST43S2     3            4
    7                     TRALTEST43S2     4            4
    -----

    As you can see above, on the TRALTEST43S1 of the SLOT, there are three occurrences, so M (Total number of occurrences) must be three and this column N he's counting. It is the same with the TRALTEST43S2 of the SLOT. It's the query I have so far:
    SELECT DISTINCT
    WIPDATAVALUE, SLOT
    , LEVEL AS n
    , m 
    FROM
    (
      SELECT
        WIPDATAVALUE
        , SLOT
        , (dulo - una) + 1 AS m 
      FROM
      (
        SELECT 
          WIPDATAVALUE
          , SLOT
          , CASE WHEN INSTR(wipdatavalue, '-') = 0 THEN wipdatavalue ELSE SUBSTR(wipdatavalue, 1, INSTR(wipdatavalue, '-')-1) END AS una
          , CASE WHEN INSTR(wipdatavalue, '-') = 0 THEN wipdatavalue ELSE SUBSTR(wipdatavalue, INSTR(wipdatavalue, '-') + 1) END AS dulo
        FROM trprinting
        WHERE (containername = :lotID OR SLOT= :lotID) AND WIPDATAVALUE LIKE :wip
      )
    ) CONNECT BY LEVEL <= m
    ORDER BY wipdatavalue;
    And it leads to something like this:
    -----
    WIPDATAVALUE          SLOT             N            M
    1-2                   TRALTEST43S1     1            2
    1-2                   TRALTEST43S1     2            2
    3                     TRALTEST43S1     1            1
    4-6                   TRALTEST43S2     1            3
    4-6                   TRALTEST43S2     2            3
    4-6                   TRALTEST43S2     3            3
    7                     TRALTEST43S2     1            1
    -----

    I think that my current query based results M and N on WIPDATAVALUE and not HOUSING that's why I get the wrong result. I also tried to use WITH instruction and it works well, but unfortunately, our system cannot accept the subquery factoring.

    I know that you guys will be of help because you are all awesome. Thank you all

    Published by: 1001275 on April 19, 2013 20:07

    Published by: 1001275 on April 19, 2013 20:18

    Hello

    1001275 wrote:
    Hi sb92075,

    You are right that it is available with this version. But our system doesn't put queries that use subquery factoring.

    What system are you talking about? If you really have something that prevents you from using all the features of Oacle, you should seriously think about fixing it.

    Any other ideas on how we can do this without help WITH clause?

    Yes; If a WITH clause is referenced that once, it can be re-written as a point of view online:

    SELECT       wipdatavalue
    ,       slot
    ,       ROW_NUMBER () OVER ( PARTITION BY  slot
                                 ORDER BY          low_number
                        )                    AS m
    ,       COUNT (*)     OVER ( PARTITION BY  slot )     AS n
    FROM       (     -- Begin in-line view (got_numbers)
                SELECT     wipdatavalue
              ,     slot
              ,     TO_NUMBER ( SUBSTR ( wipdatavalue
                                        , 1
                                   , INSTR ( wipdatavalue || '-'
                                               , '-'
                                        ) - 1
                                   )
                            )          AS low_number
              ,     TO_NUMBER ( SUBSTR ( wipdatavalue
                                        , 1 + INSTR ( wipdatavalue
                                                       , '-'
                                                )
                                   )
                            )          AS high_number
              FROM     trprinting
           )     -- End  in-line view got_numbers
    CONNECT BY     LEVEL               <= high_number + 1 - low_number
         AND     low_number          = PRIOR low_number
         AND     PRIOR SYS_GUID ()      IS NOT NULL
    ORDER BY  low_number
    ,            m
    ;
    
  • How to get the total number of lines workbook Table Page-Details

    Hi all

    I built a workbook Page-detail Table. In addition, my section of the page is 'user of assets '. Then, when I click the users button, it shows me, credit notes different from the user that I was selected. The problem is that I want to show a percentage by user.

    For example:
    -------------------

    The query returns me assets 40 for all users.

    But for example I click the first user who has only 10 credit notes.

    I want to show at the end of the page: "this user is:" 25% (because I calculate 10 * 100/40). "."

    How can I do this? Because I found that I can show the number of lines that are in the screen, but not the total of the lines referring to my request.

    I use Oracle Desktop, but I have no problem using Oracle Discoverer Plus.

    I really appreciate your help.

    Best regards!
    Mariano. -.

    You can do it directly in the front as you wish but you can manipulate the spreadsheet to do something like.
    By creating a calculation that will contain the data you need you can then present in the page point right next to the user name.
    If you change the user in the page element, it will present the % that you wanted.

    do that create a new calculation, called "is the percentage of this user:
    To_char (COUNT (credit memos) OVER (PARTITION BY User) * 100/COUNT(credit memos) OVER (), '990D99'). « % »

    Place the calculation in the page element.

    There is a small restriction since if you just change the user it will work fine, but if you pick the design value, then you will get a mess.

    Beside that, you can use the 'text area' of the discoverer and put for example here: (exactly the name of the calc) "& is the percentage of this user.

    Well, it's not perfect, but maybe it can be used...

  • How to get the total number of cursor in a counter

    I am now using the meter control objects, I added 4 needles/cursors when the VI is offline, when I clicked on run, Labview is more allows me to add more needle, so control of the needle is not dynamic, there are several things I need to dynamically which means computer lets find and make a decision during the race :

    1 know how many cursors are on the Panel?

    2 Add/Remove one of the sliders?

    3 redistribute all cursors?

    I would use the node property to achieve this, but I don't how. Any help?

    We cannot add hand/cursor to the object during execution of VI.

    your needs from 1 and 3 can be made using the property node...

    Use the property 'Display Digital []' to get/set the value of the slider.

    Ganesan Kani

  • How to get the total number of records for this query

    SELECT SSN, FIRST, MID, LAST, UCX_UCFE, TRAPOSS, DUAPOSS, CLAIM_SEQ, CLAIM_DT, MAX (INSERT_DT) INSERT_DT.
    CLAIM_STAT, ISSUE_CDE, AGENT_ID FROM (SELECT A.SSN, A.FIRST A.MID, A.LAST, B.UCX_UCFE, B.TRAPOSS, B.DUAPOSS,
    C.CLAIM_SEQ, C.CLAIM_DT, C.INSERT_DT, C.CLAIM_STAT, C.ISSUE_CDE,
    RN C.AGENT_ID, ROWNUM
    THE APPLICANT HAS, CLMTELIG B, UICLAIMS C
    WHERE A.CLMT_SEQ = B.CLMT_SEQ AND B.CLMT_SEQ = C.CLMT_SEQ AND TRUNC (C.INSERT_DT) BETWEEN 1 JANUARY 09 ' AND 5 JANUARY 09')
    GROUP OF NSS, BEGINNING, MIDDLE, LAST, UCX_UCFE, TRAPOSS, DUAPOSS, CLAIM_SEQ, CLAIM_DT, CLAIM_STAT, ISSUE_CDE, AGENT_ID



    Thank you all in advance for watching in my post.

    Select count (*)
    Of
    (.. .your question here...) ;

  • Unable to get the total number of records processed by the processor of trade rules

    Details of the environment

    ======================

    Disqualification Version: 12.1.3.0.0


    I use a business rules processor to implement multiple business rules on one record and I am looking for a summary of the number of records increased and does not have a specific rule.


    To illustrate:
    Suppose there are 2 rules, invalid number in Column1 and valid number on Column2.
    10 records to process and 3 folders don't rule 1 (valid on column1) and 9 entered failure of rule 2 (valid number on Column2).

    In the browser of result of the processor Business, the number of past records and failed is displayed but is not part of the output of the processor itself. In the example above, there will be 1 pass and 9 fail records and given the values of said the total number of records can be derived which is 10.

    This is why the expected output will be:
    Success of failure
    Rule 1:7 (10-3) 3
    Rule 2: 1 (10-1) 9
    Note: The number of records that failed can be derived from the table of the rule ID but I don't know how to get the total number of records in order to calculate the number of records that a given rule.

    I tried to publish the County of acceptance and rejection in the browser of result of the processor Business in an intermediate table and ask the same intermediate table to get the pass and fail values but Disqualification does not allow to write and read the same intermediary object in a single process. What is the best way to get the number of records total handled by the processor business rules? This kind of attributes (that do not exist only in the browser of result) can be included in the output of the processor in the next version of the Disqualification?

    In addition, the intermediate table contains only 1 sheet with pass and failure values while the exceptions which have individual failure on each rule contains 12 Archives. What would be the best approach to merge a single record into multiple records according to the example below?

    Staging table
    Success of failure
    1 9

    Exception table
    Single ID ID rule
    Rule 1 Record1
    Rule 1 Record2
    Rule 1 record Record3
    Rule 2 Record1

    Exception table with: staging Table data merge
    Rule ID ID Unique Pass Fail Total
    Rule 1 1 9 10 Record1
    Rule 1 1 9 10 Record2
    Recording rule 1 Record3 1 9 10
    Record1 rule 2 1 9 10

    Please notify.

    Hi Jason,

    The best way to explain how to do this is with an example project (DXI). I'll send you one in offline mode.

    -Mike

  • How can I get the total number of pages printed on my LaserJet 3055?

    I have a nice 1012 LaserJet that is not supported in Windows 7, but there is a solution which is to set up a Vista driver as if the printer is a LaserJet 3055.  It works, even if sometimes I get a printed statement that it does not work, and when that happens I just turn off the printer and turn on again immediately and it is fine.  I would like to know if there is anyway I can get the total number of pages printed at some point, as I could with the LaserJet 1012.

    P.S. This thread was moved from software for Laserjet. -Hp moderator of the Forum

    Please ignore my post on the LaserJet 3055.  With the help of a good soul on another thread of discussion, I was able to install and operate my LaserJet 1012 printer on Windows 7, exactly as it did in XP.  No errors, no slow printing, no problem.  The LaserJet 3055 thing helped initially as a work around, but the message about the bad personality who stopped the printer until you turned off and turned it back was boring.

  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

  • How to get the total line count COUNT (*) SELECT and put on a page?

    Hello

    I use JDeveloper 10.1.3.4. I need get the total number of rows in a table and display it on a page and the problem in doing so. At the sqlplus prompt the row count simply would be, for example:
       select count(*) from BILL;
    I wonder if having this simple number must be so complicated and if there is more simple, better ways. Here's how I do it and the problem encountered.

    1. the name of the page to display the number is summary.jspx. It has a grain of support that "summed" as the managed bean name in faces - config.xml, and the name of the bean class is "summary." The component output on the page is:
    <h:outputText value="#{summary.totalStudentsCount}"
                  binding="#{summary.outputText5}" id="outputText5"/>
    2. in summary the bean code is:
        private Number totalStudentsCount;
        public static int NUMBER = Types.NUMERIC;
    
        public void setTotalStudentsCount(Number totalStudentsCount) {
            this.totalStudentsCount = totalStudentsCount;
        }
    
        public Number getTotalStudentsCount() {
            ZBLCModuleImpl zblcam = getZBLCModuleImpl();
            LoggedInStudentImpl studentTable = (LoggedInStudentImpl)zblcam.getLoggedInStudent();
            String sql = "select count(lsap_uid) from BILL";
            studentTable.setQuery(sql);
            return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {});
        }
    
        private ZBLCModuleImpl getZBLCModuleImpl() {
            FacesContext fc = FacesContext.getCurrentInstance();
            ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
            BindingContext bc = (BindingContext)vb.getValue(fc);
            DCDataControl dc = bc.findDataControl("ZBLCModuleDataControl");
            ApplicationModule am = (ApplicationModule)dc.getDataProvider();
            return (ZBLCModuleImpl)am;        
        }
    
        protected Object CallStoredFunction(int sqlReturnType, String stmt, Object[] bindVars) {
            CallableStatement st = null;
            ZBLCModuleImpl zblcam = getZBLCModuleImpl();
            try {
                st = zblcam.getDBTransaction().createCallableStatement("begin ? := " + stmt + "; end", 0);
                st.registerOutParameter(1, sqlReturnType);
                if (bindVars != null) {
                    for (int z = 0; z < bindVars.length; z++) {
                        st.setObject(z + 2, bindVars[z]);
                    }
                }
                st.executeUpdate();
                return st.getObject(1);
            }
            catch (SQLException e) {
                throw new JboException(e);
            }
            finally {
                if (st != null) {
                    try {
                        st.close();
                    }
                    catch (SQLException e) {
                        throw new JboException(e);
                    }
                }
            }
        }
    The idea of calling a stored function usnig as a "helper" method is 25.5.3 in the Developer's guide, which is closest to you in my need. It's for the functions with the one IN argument; but in my case, the function is not any argument IN. That's why, when you call the helper method CallStoredFunction(), I gave an empty as the last argument and amazing array that caused the problem:
    return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {});
    3. the registered function has been tested and works fine at the sqlplus prompt:
    create or replace function get_total_students
       return NUMBER
    AS
       v_student_count NUMBER;
    BEGIN
       select count(ldap_uid)
       into v_student_count
       from bill;
       return v_student_count;
    END;
    4. when the summary.jspx page is run, the browser is full of error messages, the first long line is here (I have split several online for ease of reading):
    javax.faces.el.EvaluationException: 
      javax.faces.el.EvaluationException: 
        Error getting property 'totalStudentsCount' from bean of type 
        zblc.viewcontroller.backing.staff.Summary: oracle.jbo.JboException: 
          JBO-29000: Unexpected exception caught: 
            java.sql.SQLException, msg=Missing IN or OUT parameter at index:: 2
    Thus,.
    (1) what is the problem? What is this parameter IN or OUT of {color: red} index: 2 {color} consult? It has to do with the empty array as the last argument in the call to the helper method?
    (2) this approach is an overdose, and are there more simple and better ways?

    Thank you very much for help!


    Newman

    Hello

    Is there a specific reason why you don't simply create read only object to display with some count (*) as OFCASES from MYTABLE and then just drag and drop the attribute ofcases in page?

    Kind regards

    Branislav

  • How to get the maximum number of days in a month?

    How to get the maximum number of days in a month?

    I use a dateField. where I can get the month. Now, I want to get the maximum number of days in a month.

    How can I get it?

    Please help me. and thanks in advance... []

    NET. RIM. Device.API.util
    Class DateTimeUtilities

    getNumberOfDaysInMonth (int month, int year)
    Returns the number of days in the specified month

    It took me like 10 seconds to find it in the API, I guess you spent more time writing the post...

  • How to get the frame number current timeline using jsx?

    How to get the frame number current timeline using jsx?

    Thanks for the link!

    Clarification: I was looking for the current image on the timeline of the video. OP he mentions that he had found how to get that so I searched a bit more and found this thread: Re: can I inpoint in read/write and out-point of the clips in a group of video with scripts? They have the following functions, I have not tried yet, but it seems like it should work.

    function getCurrentFrame() {}

    try {}

    Var ref = new ActionReference();

    ref.putProperty (charIDToTypeID ('Rprp'), stringIDToTypeID ('currentFrame'));

    ref.putClass (stringIDToTypeID ('timeline'));

    var / / desc = new ActionDescriptor();

    desc.putReference (charIDToTypeID ('null'), ref);

    var TC = executeAction (charIDToTypeID ('getd'), desc, DialogModes.NO);

    Return TC.getInteger (stringIDToTypeID ('currentFrame'));

    } catch (e) {return null ;}

    };

  • I can't find my serial number for Photoshop Elements version 8. It came with a HP computer I bought in 2010. I recently had to do a recovery, it has been uninstalled. I moved since then and don't know how to get the serial number.

    I can't find my serial number for Photoshop Elements version 8. It came with a HP computer I bought in 2010. I recently had to do a recovery, it has been uninstalled. I moved since then and don't know how to get the serial number.

    Please explain how I can get the serial number?

    James, if it came with the machine and you are not registered, then you can't get it from the dealer where you purchased the machine. PSE 8 is now end of life and we have limited resources for the same thing, make sure you check the system requirements | Adobe Photoshop Elements if you try to install it on a new machine.

    If you want to upgrade to the latest version, you can check: photo editor, change the images. Adobe Photoshop Elements 13

    Atul_Saini

Maybe you are looking for

  • Windows Vista business is update, download and installation; even when the update is set to manual.

    I put the manual update manually. But despite this it keeps update, download and installation. Sometimes I turn off a few updates and suddenly, after a few hours, these unwanted updates begin to update! This is a joke, very annoying and the invasion

  • OfficeJet Pro 6830: Printer OfficeJet Pro 6830 how to scan to PDF files

    I bought a HP OfficeJet Pro 6830, and I can't understand how to scan documents from the printer to my computer in PDF format. It analyzes only in JPEG format. The documentation I found online says that the PDF option should be present on the touch sc

  • Setup QOS SG300 - 28 p

    Hi all.  I tried to configure my SG300 - 28 p for my 2960S, but using the following commands: conf t int row item in gi1-28 Auto qos voip cisco-phone But there is no other command I can find on the SG300.  Did someone familiar with a similar command?

  • How can I cancel or change my memberchip?

    How can I cancel or change my memberchip?

  • Help with HDR

    Hi, I have a Canon 70 d.  There are HDR and I guess only he photos in the camera to produce a single image for the development of Lightroom 5 of the layers.  My problem is that I can't tell which ones are HDR in the library.  They are all named in jp