Can I 'sort' XML in Flash

Hello,
Is it possible to sort XML in any way in Flash?
For example in MYSQL I can SELECT a column and ORDER BY...
In Flash I need to SELECT an XML child object and sort all
parent items
accordingly.
Thanks,
David

It would be great if there was a way in Flash 8 to sort XML
based on a
certain element without duplicating work making an array?
See a simple XML example below:
<?xml version='1.0' encoding='utf-8'?>
<data>
<item>
<title>Apple</title>
<price>7</ price>
</item>
<item>
<title>Carrot</title>
<price>2</ price>
</item>
<item>
<title>Banana</title>
<price>6</ price>
</item>
</data>
If I could sort this by cheapest price, this would give
results -
1. Carrot
2. Banana
3. Apple
Or by Alphabetical order:
1. Apple
2. Banana
3. Carrot
Any suggestions - is this possible with the Flash XML object?
On 15/2/07 16:41, in article
er22gb$rpp$[email protected], "albee"
<[email protected]> wrote:
> Why not organize the XML data into an Array, and then
use Array.sort() or
> Array.sortOn()?
>
> Albee

Similar Messages

  • Sorting xml

    hi,
    How can I sorting xml file before parsing it.
    for example:
    parser.parse("test.xml");
    Document doc = parser.getDocument();
    Thanks.

    you can sort the data using xsl. Here's what i'm doing
    empdata.xml file
    ========
    <?xml version="1.0"?>
    <?xml-stylesheet href="empdata.xsl" type="text/xsl"?>
    <employees>
    <employee>
    <name>
         <got>4</got>
    <given>James</given>
    <family>Cook</family>
    </name>
    </employee>
    <employee>
         <name>
         <got>5</got>
    <given>Aames</given>
    <family>Dlark</family>
    </name>
    </employee>
    <employee>
         <name>
         <got>1</got>
         <given>Bames</given>
    <family>Dlark</family>
    </name>
    </employee>
    <employee>
    <name>
         <got>3</got>
         <given>marshesi</given>
    <family>park</family>
    </name>
    </employee>
    <employee>
    <name>
         <got>7</got>
    <given>Lames</given>
    <family>lamb</family>
    </name>
    </employee>
    </employees>
    empdata.xsl
    ===========
    <?xml version="1.0"?>
    <xsl:stylesheet version='1.0'     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:output method="xml" indent='yes'/>
    <xsl:template match="employees">
    <ul>
    <xsl:apply-templates select="employee">
    <xsl:sort select="name/got"/>
    <xsl:sort select="name/family"/>
    <xsl:sort select="name/given"/>
    </xsl:apply-templates>
    </ul>
    </xsl:template>
    <xsl:template match="employee">
    <li>
    <xsl:value-of select="name/got"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="name/given"/>
    <xsl:text> </xsl:text>
    <xsl:value-of select="name/family"/>
    </li>
    </xsl:template>
    </xsl:stylesheet>
    I hope this will help you.
    sachin

  • Where can I find xml - Flash examples?

    I know enough about xml to be dangerous. Does anyone know of
    a source of for adding deleting / editing xml files using Flash
    where I can see examples that actually work?
    Free is better but I'm willing to pay.
    thanks,
    Mike Rice

    Here are a couple video tutorials using XML with Flash:
    http://www.gotoandlearn.com/play?id=64
    http://www.gotoandlearn.com/play?id=65
    Don't know if they're what you're looking for but worth a
    look.

  • Can we sort one field based on other field in messsage mapping !!

    Hi Folks,
    I have got source xml with couple of Vendors, Vendors has got promotions on different products with different dates. If I sort date field, product quantity is not sorting. How Can I sort both fields at the same time, if I sort Promotion date field in ascending order, the product quanitity has to sort respectively?
    Any one can help in this please , any links are examples etc..
    Kind Regards
    Thanks in advance.
    San

    Hi Folks,
    I have tried with this function SortbyKey, it always throuing exception. That's the reason I came to you guys. Please have a look following mapping
    ZY2K_DATE    ----> Remove Context -->
                                           Sortbykey  -----> Condition etc.,
    ZA02_QTY   -----> Remove Context -->
    if I try to see display queue on Sortbykey  I am getting ' Exception'
    Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Queues have different lengths in function sortByKey] in class com.sap.aii.mappingtool.flib7.NodeFunctions method sortByKey[[Ljava.lang.String;@5be18f1d, [Ljava.lang.String;@357ae80b, SortComparator.CASE_SENSITIVE, SortOrder.ASCENDING, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@1818459b,
    Source
    <ROOT>
    ...<OUTPUT>          - - - -       0..unbound
    .......<Group_LIN>    - - -        0..unbound
    ..........<Group_ZA>  - - -       0..unbound      
    ..............<D02_ZA>  - - -        0..unbound
    ..................<ZA01>QD</ZA01>
    ..................<ZA02>35.0</ZA02>
    ..................<ZA03>CT</ZA03>
    ..................<Z_Y2K_DATE>20100723</Z_Y2K_DATE>
    ..............</D02_ZA>
    ...........</Group_ZA>
    ........</Group_Lin>
    ....</OUTPUT>
    Target
    ProductDemandInfluencingEventNotification  0..unbound
    ...ProductDemandInfluencingEvent                 1..1
    .......Item                                                           1..unbound
    ..........OrderForecastTimeSeries                     0..1
    ..............Item                                                    1..unbound
    .................ValidityPeriod                                  1..1
    ......................StartDateTime                             0..1
    ......................EndDateTime                               0..1
    .................Quantity                                           1..1
    the above D02_ZA tag sometimes comes more than one QD with different dates. Same dates has to go under one tag with respective quantities!! This is the situation, can any solve this please?
    The target tag "ProductDemandInfluencingEventNotification" will generate based on number of promotions on particular date. Ex: if one vendor has 'n' number products promotions on 3 different dates, 3 "ProductDemandinfluenceevennotifications" has to generate, that three promotion dates and quantities has to respectively.
    That ZA02 (Qty) value has to go Quantity target field.
    Kind Regards
    San

  • How to edit bitmap which is imported in flash using xml and save the edited bitmap back to xml in flash.

    hi all
    It would be appreciated if any one let me know how to edit
    bitmap which is imported in flash using xml and save the edited
    bitmap back to xml in flash.
    Is it posible to save the bitmap data in flash?
    thanks in advance

    Yes you can... but like I said before you need to upload the
    data from the changes you make to a server.
    In terms of the solution... its unlikely that you'll find one
    specifically for your needs. You will have to learn whatever you
    don't know how already and maybe adapt some existing examples to
    your needs.
    To change the visual state of a movie clip... you just do all
    the regular things that you want to do to it using flash... scale,
    rotation, drawing API , textfields etc in actionscript. If you
    don't know how to how to do that stuff, then you need to learn that
    first. That's basic actionscript.
    You can capture the visual state of a movieclip using the
    BitmapData class. That includes a loaded jpeg. You can also
    manipulate bimatp data using the same class. You should read up on
    that if you don't know how to use it or check out the examples
    below for uploading info.
    For uploading to the server:
    Here's an as2 solution that took 15 secs to find using
    google:
    http://www.quasimondo.com/archives/000645.php
    If you're using as3, google search for "jpeg encoder as3" and
    look through that info. There are also historical answers in the
    forums here related to this type of thing that might help as
    well.

  • Where can I get docs for Flash Builder?

    Hi-
    I've tried numerous places but can't seem to find Flash Builder 4 specific documentation.
    I'm working with the examples provided on the adobe labs site (http://labs.adobe.com/technologies/flashcatalyst/tutorials/) and I was looking for a way to get the value from a service call to word wrap inside of a DataGrid (for example, if the returned value is longer than the row length of my DataGrid, my expectation was that by checking the Word Wrap checkbox inside of the Configure Columns context box would do the trick, but it does not).
    It would be great to know where the reference materials are for all of those available properties and values that are listed for each component inside of Flash Builder 4. Otherwise it makes working with this application next to impossible for us noobies to Flex.
    Anyone know?
    Thanks in advance,
    Rich

    Rich,
    The wordWrap property is listed at http://livedocs.adobe.com/flex/gumbo/langref/mx/controls/DataGrid.html under the Properties heading. It can be a bit tricky as the wordWrap property is actually inherited from the ListBase class, so it may be necessary to toggle the "Show Inherited Public Properties" so the inherited properties are also listed. You can read more about the wordWrap property at http://livedocs.adobe.com/flex/gumbo/langref/mx/controls/listClasses/ListBase.html#wordWra p, and here is a simple example:
    <?xml version="1.0" encoding="utf-8"?>
    <!--  -->
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/halo">
    <mx:DataGrid id="dataGrid"
       variableRowHeight="true"
       wordWrap="true"
       verticalScrollPolicy="on"
       left="20"
       top="20">
      <mx:dataProvider>
       <fx:Array>
        <fx:Object c1="Lorem ipsum dolor sit amet, consectetur adipiscing elit." c2="1" />
        <fx:Object c1="Aenean pellentesque, nulla eget aliquam cursus, nibh nunc condimentum mi, vitae interdum dui libero a purus." c2="2" />
        <fx:Object c1="Cras scelerisque eros id turpis cursus pretium." c2="3" />
        <fx:Object c1="Nulla non condimentum sem." c2="4" />
        <fx:Object c1="Proin dignissim placerat elit sed laoreet." c2="5" />
        <fx:Object c1="Pellentesque nec quam erat, eget molestie urna." c2="6" />
        <fx:Object c1="Maecenas elementum sapien tempor mauris eleifend lobortis." c2="7" />
        <fx:Object c1="Donec nec ipsum nulla." c2="8" />
        <fx:Object c1="In fermentum nunc et erat elementum consequat." c2="9" />
        <fx:Object c1="Donec turpis purus, elementum ut adipiscing ut, malesuada eu mauris. Aliquam erat volutpat." c2="10" />
        <fx:Object c1="Fusce mollis, ante a iaculis tempor, odio libero suscipit tellus, quis dictum leo ante sit amet leo." c2="11" />
        <fx:Object c1="Curabitur quis enim quis dui commodo vestibulum." c2="12" />
        <fx:Object c1="Vestibulum sit amet egestas velit." c2="13" />
        <fx:Object c1="Fusce dapibus pellentesque eleifend." c2="14" />
        <fx:Object c1="Fusce eget ligula ut elit adipiscing consectetur." c2="15" />
        <fx:Object c1="Integer et erat urna. Pellentesque cursus pulvinar nisi in tincidunt." c2="16" />
        <fx:Object c1="Nam tincidunt orci eget justo tristique ultrices commodo vitae nulla." c2="17" />
        <fx:Object c1="Vestibulum molestie, eros at imperdiet tempor, tortor purus gravida massa, id molestie ipsum lectus at est." c2="18" />
        <fx:Object c1="Ut interdum condimentum velit, id sodales lectus mattis nec." c2="19" />
       </fx:Array>
      </mx:dataProvider>
      <mx:columns>
       <mx:DataGridColumn dataField="c1" width="250" />
       <mx:DataGridColumn dataField="c2" />
      </mx:columns>
    </mx:DataGrid>
    </s:Application>
    Peter

  • Sorting xml document with xsl

    How can I sort below xml on empNo using xsl, I want an output to be in xml format.
    <employeeList>
    <employee empNo=1000>
    <Info >
    <fname></fname>
    <lname></lname>
    </Info>
    </employee>
    <employee empNo=1001>
    <Info >
    <fname></fname>
    <lname></lname>
    </Info>
    </employee>
    </employeeList>
    Can any one tell me the xsl for above.......
    Thanks in advance

    Hi,
    Your xml is not well-formed. Attributes have to be enclosed in double quotes.
    You can use the following stylesheet.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
    <xsl:output method="xml"></xsl:output>
              <xsl:template match="/employeeList">
              <employeeList>
              <xsl:apply-templates select="employee">
              <xsl:sort select="@empNo"/>
              </xsl:apply-templates>
              </employeeList>
              </xsl:template>
         <xsl:template match="employee">
         <xsl:copy-of select="."/>
         </xsl:template>
    </xsl:stylesheet>

  • XML to Flash Text

    I am trying to load text from XML to Flash, My XML document
    looks like this.
    <tutorial>
    <introduction>Welcome</introduction>
    <scenario>This is the scenario</scenario>
    </tutorial>
    Here is my ActionScript code. How do I get it to load so I
    can have a text box display welcome instead of all the XML.

    stop();
    var loader:URLLoader = new URLLoader();
    loader.dataFormat = URLLoaderDataFormat.TEXT;
    loader.load( new URLRequest("example.xml"));
    loader.addEventListener(Event.COMPLETE, textReady);
    var tutorial:XML = new XML();
    var tutList:XMLList;
    var myText_txt:TextField = new TextField();
    addChild(myText_txt);
    myText_txt.autoSize = TextFieldAutoSize.LEFT;
    function textReady(event:Event):void{
    tutList = XML(event.target.data).children();
    myText_txt.text = tutList[0];
    }

  • Dynamic Sorting - XML Publsiher

    I have read Klaus Fabian blog on this topic.
    http://blogs.oracle.com/xmlpublisher/2006/05/26
    As per the manual on page 2-81 Oracle applications does not support passing parameters into the templates. Is there any alternative to achieve this same task without using <xsl: parameters ?
    eg. I have one column "SORT_COLUMN" it has value as SAL.
    I have employee data where I have to sort the data based on the value which is stored in "SORT_COLUMN" field.
    so I can populate "ENAME" to "SORT_COLUMN" field and data will be sorted in ename field. ( I can populate SORT_COLUMN value in the query)
    Thanks,

    Hi,
    Can you sort the data at XML generation time? Not sure if you're using Reports or Data Definition or PL/SQL ... doesn't matter anyway.
    What manual are you referring to? You can pass in a parameter to data definition and template...
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • Saving XML from Flash XML.sendAndLoad

    I'm new to XML and haven't a clue how to integrate Flash xml
    and Coldfusion 7. There is a Flash app ( I didn't develop it) that
    is sending xml.sendAndLoad formatted data like this to a cf page
    setSummaryQuiz.cfm
    <?xml version="1.0" encoding="UTF-8"?>
    <result lessonID="19" userID="56">
    <word id="281" value="1" />
    <word id="282" value="1" />
    <word id="283" value="5" />
    <word id="284" value="5" />
    <word id="285" value="3" />
    <word id="286" value="7" />
    <word id="287" value="3" />
    <word id="288" value="8" />
    <word id="289" value="7" />
    <word id="290" value="4" />
    <word id="291" value="8" />
    <word id="292" value="2" />
    <word id="293" value="5" />
    <word id="294" value="4" />
    <word id="295" value="1" />
    <word id="296" value="4" />
    <word id="297" value="8" />
    <word id="298" value="1" />
    <word id="299" value="7" />
    <word id="300" value="1" />
    </result>
    My page is supposed to return saved = true or false like
    this:
    <? xml version = " 1.0" encoding = "UTF-8"?>
    <result saved = "true"/>
    Can someone help me or point me to a tutorial or code snippet
    where I can see how CF reads and parses the XML data from
    Flash?

    In ASP setting the response type to "text/xml" you can do a
    response.write command to send back XML to Flash if you were
    performing an XMLSendAndLoad command ie. send XML from Flash,
    processed by ASP and receive an XML response from the ASP - good
    for Flash to know if something worked or an error resulted in
    processing the info.

  • XML from Flash ASP

    I'm running a test to see if I can pass XML from flash to an
    ASP file. The following code is used in Flash. But how would I
    access the xml variable in an ASP file?

    In ASP setting the response type to "text/xml" you can do a
    response.write command to send back XML to Flash if you were
    performing an XMLSendAndLoad command ie. send XML from Flash,
    processed by ASP and receive an XML response from the ASP - good
    for Flash to know if something worked or an error resulted in
    processing the info.

  • Where can I find XML component examples ?

    where can I find XML components examples ?

    Here are a couple video tutorials using XML with Flash:
    http://www.gotoandlearn.com/play?id=64
    http://www.gotoandlearn.com/play?id=65
    Don't know if they're what you're looking for but worth a
    look.

  • Calling a style from an XML through Flash

    Ok, so here's the situation.  I want my Flash button to call a URL from an XML that then opens up a AJAX window (like lightbox or multibox) over the page.  So the user clicks on Flash and a AJAX pop up appears.  I've set up the popups, I'm using facebox (which is really nice).  They way the do this is by creating an ID DIV like below:
    <div id="world1div" style="display:none;">
        <p><span id="title">TITLE</span></p><p>
        CONTENT</p>
          </div>
    This will make the pop up say "TITLE" and then "CONTENT".
    Now to call this pop up, the <a> looks like:
    <a href="#world1div" rel="facebox">OPEN POP UP</a>
    So... now I have a Flash that can call to XML and get a URL.  The problem is when I put "#world1div" in the url portion of the XML, it doesn't work.  How do I call this ID from XML?

    Try wrapping it in a CDATA tag.
    <Link><![CDATA[#world1div]]></Link>

  • Looking for a non XML driven Flash banner rotator

    I am looking for a non XML driven Flash banner rotator, something where I can load my images into the FLA and publish. The only rotators I can seem to find have external XML/image files, etc.
    All I want to do is create simple SWF's that I can use to display rotating images preferably is a smooth and stylish manner. Does anyone know of any, or could point me in the right direction?
    Many thanks for any help you may be able to offer and I am willing to follow any tutorials.

    Hi
    I wonder why not show you how to use Quicktime.
    Because I would use the html5 audio, that way the browser chooses the 'player' to use, and I wanted to give the OP the choice -
    <audio controls preload="auto" autobuffer>
      <source src="elvis.mp3" />
      <source src="elvis.ogg" />
      <!-- now include flash fall back -->
    </audio>
    PZ

  • Can this be done with flash

    I need to generate a chart using flash or flex (im not sure
    which) on the
    server side and output it as a jpg?
    can this be done? can somebody point me to the right
    direction
    Thanks,
    Tem

    You mean using data from the server? Flash, and Flex, run
    client side, but
    can pull data from a server - and make a graph. I don't know
    Flex, but it
    wouldn't be too hard in Flash. AS3 is better for outputting
    as a JPEG, but
    it can be done in AS2 as well.
    There are many tutorials for loading data into Flash, just
    Google things
    like 'Flash XML' or 'Flash Database'. I'd also recommend
    looking at AMFPHP
    http://www.amfphp.org/) an
    alternative to Flash remoting that makes calling
    server-side functions, and passing data, a snap.
    For image export, search on 'Flash image output' - here's one
    to get you
    going:
    http://www.quasimondo.com/archives/000645.php
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

Maybe you are looking for

  • Valuated issued value Stock

    Valuated issued value Stock I want to check the values of BW & r/3 are matching for KF  Valuated issued value Stock in which t-c0de can i check it I am checking valuated stock value in mc.5 & valuated stock received value in  table s031 these values

  • User Exit for me54n on purchase Requisition Release i.e EXIT_SAPLMEREQ_05

    HI   All Experts ,                       I have one Requirement that  , i want to insert  data in Ztable  using all details from header data in me54n  on purchase release i.e When i will Click on Purchase release Requisition i want to insert records

  • XREF in WebHelp TOC Output

    I am using the Technical Communication Suite and I imported FrameMaker books in to RoboHelp HTML. After I autocreated the TOC, and then generated the primary layout, there are many cross reference items appearing as topics in the Contents pane, for e

  • Using selections in Word or Print Shop

    How can I use selections in Elements in word and Print Shop or anything else so they still have a transparent background.  Even if I save them with a transparent background, when I insert or copy the image into another program it has a white backgrou

  • Browser problem.(All browsers across users)

    Hi, I have a really annoying problem through all browsers I have installed(Chrome, Firefox 5 and Safari), and I really have tried so much to fix it. Basically the problems are with examples... http://www.avforums.com/forums/index.php - on this site n