Optimizing short code with XML objects

Hi there!
I'm trying to take into account the Garbage Collector (GC), so I decide to optimize this code:
private function writeXMLtoModel(xmlData:XML):void{
var listOne:XMLList = xmlData.node.children();
            for each(var xmlOne:XML in listOne){
                var item: Object = new Object();  
                    item.one =  xmlOne.@one ;
                    item.two =  xmlOne.two ;
For instance, is it useful to put "xmlOne = null" in every iteration?  I'm checking with the Flashdevelop's profiler, but I don't see the difference.
maybe, I can also reuse the item object rather than creating it every time, right?
Regards!

everything you prefix with var inside a function body is local to the function during that function call.  ie, all those variables ( listOne and all the xmlOne and item) will be gc'd without you needing to do anything more.  (on the other hand, unless you have additional code, that function does nothing useful because no data can be obtained from it once it completes execution.)

Similar Messages

  • Can we write client object model code with Server object model?

    Hi everyone,
    I have to create one timer job using client object model (C#) in Sharepoint 2010 template on feature activation. Is it possible to write the code of client object in sharepoint empty project to create timer job? If yes/no? then why?
    Thanks in advance!!!

    Hi ShindeK,
    Yes you can used CSOM in Sharepoint but Timer jobs run directly on the server. The Client Side Object Model is a wrapper that brokers its calls to the server via the built in web services that SharePoint provides.
    You will not get any performance gains in this scenario using CSOM. You should use the full server object model of SharePoint
    SharePoint 2010 also has three Client Object Models (Managed, Silverlight, JavaScript) which are meant to be used by code accessing SharePoint remotely.
    --You can also used powershell script in timer job
    Chekc the link which cann help you step by step CSOM in Sharepoint timer job
    http://www.youtube.com/watch?v=Z7wHj-bSk0g
    You can also try the below link....
    https://bramdejager.wordpress.com/2013/08/02/using-csom-and-powershell-to-query-sharepoint-online-or-on-premise/
    http://stackoverflow.com/questions/3656920/run-sharepoint-timer-jobs-from-powershell
    Please mark the Answer and Vote me if you think that it will help you to resolved your issue

  • Problem filling DataGrid with XML - Object or ArrayCollection?

    Hi,
    I am trying to fill a datagrid with an XML file, rendered
    from a PHP
    script.
    The problem is that - first time there is only one entry in
    the XML
    file, so when I receive the data using
    event.result.root.child, I get
    an Object. But second time, when there are two entries in the
    XML
    file, the return type becomes an ArrayCollection of "child"
    type
    objects.
    This causes a problem when setting dataprovider of a
    DataGrid....
    So is there a way I can know what is the return type from the
    XML
    file, i.e., whether it is an Object or an ArrayCollection, so
    that I
    can set the dataprovider accordingly?

    In E4x
    If you have an xml structure like so:
    <parent prop1='someValue' >
    <child prop1='someValue' />
    </parent>
    to reference the parent use event.result
    to get the child use: event.result.child; to get the child
    attr: event.result.child.@prop1;

  • From String to Element with XML structure

    Hello.
    I have String with XML elements. Can i simple this transform in to XML format?
    I need Element which has XML structure.
    my string looks like that is:
    <payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
    <ns1:id_name>Mario</ns1:id_name>
    <ns1:id_address>Newsburgh</ns1:id_address>
    </users>
    </payload>
    Edited by: Tony_Fabrizzio on Feb 11, 2009 5:57 AM

    Tony_Fabrizzio wrote:
    Hello.
    I have String with XML objects. No you don't. Get your terminology straight
    Can i simple this transform in to XML format?
    I need Element which has XML structure.
    my string looks like that is:
    <payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
    <usersxmlns="http://www.google.com" xmlns:ns1="http://www.google.com">
    <ns1:id_name>Mario</ns1:id_name>
    <ns1:id_address>Newsburgh</ns1:id_address>
    </users>
    </payload>The short answer is "yes". The long answer is "what are you planning on doing with the result, and 'process it' or 'parse it' isn't an answer"
    But really, you need to do some research

  • Create an XML object with AS3

    I want to create a basic XML object in AS3, but don't know
    how to do this.
    I first tried creating a string that represented my XML
    elements and their values, but then I don't know how to convert
    this string into an XML object.
    Secondly, I believe there are other ways of creating XML
    objects in AS without doing anything with strings.
    Can somebody please recommend to me a way to do this?
    An XML example to create with AS3 is:

    I've figured out the solution to my problem. For anyone
    interested, see me code below (the xml element names are different,
    but the concept is the same).

  • Matching JS XML object with Indd XML elements

    Hello Scripters,
    I need help ...
    I have some XML from a file read into a Javascript XML object.
    The object has the name "myXml", and contains:
        <book id="bk101">
            <author>Gambardella, Matthew</author>
            <title>XML Developer's Guide</title>
            <genre>Computer</genre>
            <imagecontainer href="C:\33415677.JPG"></imagecontainer>
            <price>44.95</price>
            <publish_date>2000-10-01</publish_date>
            <description><test>Sublevel</test>An in-depth look at creating applications with XML.</description>
        </book>
        ... and several other books
    I also have some XML in Indesign, wich in my JS is known as "myTplXmlRoot".
    myTplXmlRoot is defined as myTplXmlRoot = mySelection.associatedXMLElement;
    What would be the best approach for matching elements of the same name in the two xml structures, and where there is a match* replace the Indesign content**, with that from the object "myXml"?
    *) Match if same name, dont worry about place in hirachy
    **) content might be an image

    I've figured out the solution to my problem. For anyone
    interested, see me code below (the xml element names are different,
    but the concept is the same).

  • Using An Array Collection Produced From XML In Conjunction With Shared Object

    I have an old app that Greg LaFrance helped me out with greatly which allows the user to drag items between two tilelists and then save the contents of both tilelists by clicking a save button using the sharedObject method. The tilelists are populated by array collections defined in the app. I want to change this so that the tilelists are instead populated by an array collection which I've retrieved from a remote xml file via http request but I can't get this to work. Basically I need to replace both the predefined array collections profile1NewsAndSportaddLinksFullAC and profile1NewsAndSportaddLinksAC with my xml/httprequest produced newsAC array collection and still make the tilelists saveable. Can anyone help me out? Here's the code:-
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="newsService.send(); initprofile1NewsAndSportSO()">
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.collections.*;
    import flash.net.SharedObject;
    Bindable]
    private var newsAC:ArrayCollection;
    private function newsResultHandler(event:ResultEvent):void{
    newsAC=newsService.lastResult.newscategory.news;
    public var profile1NewsAndSportSO:SharedObject;
    private var profile1NewsAndSportaddLinksFullAC:ArrayCollection = new ArrayCollection([{label:
    "BBC News"},{label:
    "ITV"},{label:
    "Sky News"}]);
    private var profile1NewsAndSportaddLinksAC:ArrayCollection = new ArrayCollection([{label:
    "BBC News"},{label:
    "ITV"},{label:
    "Sky News"}]);
    private function profile1NewsAndSportReset():void{resetprofile1NewsAndSportAC();
    profile1NewsAndSportAddLinksTilelist.dataProvider
    = profile1NewsAndSportaddLinksAC;
    profile1NewsAndSportLinkChoice.dataProvider =
    new ArrayCollection([]); }
    private function resetprofile1NewsAndSportAC():void{profile1NewsAndSportaddLinksAC.removeAll();
    for each(var obj:Object in profile1NewsAndSportaddLinksFullAC){profile1NewsAndSportaddLinksAC.addItem(obj);
    private function initprofile1NewsAndSportSO():void{profile1NewsAndSportSO = SharedObject.getLocal(
    "profile1NewsAndSport");
    if(profile1NewsAndSportSO.size > 0){
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList){
    if(profile1NewsAndSportSO.data.profile1NewsAndSportaddList != "empty"){
    var profile1NewsAndSportaddList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportaddList.split(",");
    var profile1NewsAndSporttempAC1:ArrayCollection = new ArrayCollection();
    for each(var str:String in profile1NewsAndSportaddList){
    for each(var obj1:Object in profile1NewsAndSportaddLinksAC){
    if(str == obj1.label){profile1NewsAndSporttempAC1.addItem(obj1);
    continue;}
    if(profile1NewsAndSporttempAC1.length > 0){profile1NewsAndSportAddLinksTilelist.dataProvider = profile1NewsAndSporttempAC1;
    if(profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList){
    var profile1NewsAndSportchoiceList:Array = profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList.split(",");
    var profile1NewsAndSporttempAC2:ArrayCollection = new ArrayCollection();
    for each(var str2:String in profile1NewsAndSportchoiceList){
    for each(var obj2:Object in profile1NewsAndSportaddLinksAC){
    if(str2 == obj2.label){profile1NewsAndSporttempAC2.addItem(obj2);
    continue;}
    if(profile1NewsAndSporttempAC2.length > 0){profile1NewsAndSportLinkChoice.dataProvider = profile1NewsAndSporttempAC2;
    else{profile1NewsAndSportReset();
    private function saveprofile1NewsAndSport(event:MouseEvent):void{
    var profile1NewsAndSportaddList:String = "";
    if(profile1NewsAndSportAddLinksTilelist.dataProvider){
    if(ArrayCollection(profile1NewsAndSportAddLinksTilelist.dataProvider).length > 0){
    for each(var obj1:Object in profile1NewsAndSportAddLinksTilelist.dataProvider){
    profile1NewsAndSportaddList += obj1.label +
    else{profile1NewsAndSportaddList =
    "empty";}
    profile1NewsAndSportSO.data.profile1NewsAndSportaddList = profile1NewsAndSportaddList;
    var profile1NewsAndSportchoiceList:String = "";
    for each(var obj2:Object in profile1NewsAndSportLinkChoice.dataProvider){
    profile1NewsAndSportchoiceList += obj2.label +
    profile1NewsAndSportSO.data.profile1NewsAndSportchoiceList = profile1NewsAndSportchoiceList;
    profile1NewsAndSportSO.flush();
    ]]>
    </mx:Script>
    <mx:HTTPService id="newsService" resultFormat="object" result="newsResultHandler(event)" url="http://www.coolvisiontest.com/getnews.php"/>
    <mx:Button click="profile1NewsAndSportReset()" id="reset" label="
    Reset" y="5" height="25" x="5"/>
    <mx:TileList id="profile1NewsAndSportLinkChoice" fontWeight="bold" dragEnabled="
    true" dragMoveEnabled="true" dropEnabled="true" height="129" width="
    650" top="5" left="521" columnCount="5" rowHeight="145" columnWidth="
    125" backgroundColor="#000000" color="#FFFFFF"/>
    <mx:TileList id="profile1NewsAndSportAddLinksTilelist" fontWeight="bold" dragEnabled="
    true" dragMoveEnabled="true" dropEnabled="true" height="129" width="
    385" top="5" left="128" columnCount="3" rowHeight="145" columnWidth="125" backgroundColor="
    #000000" color="#FFFFFF"/>
    <mx:Button click="saveprofile1NewsAndSport(event)" id="save" label="Save Changes" x="
    5" y="38" width="113" height="25.5"/>
    </mx:WindowedApplication>

    It might be easy to solve these issues if you post your form.
    Post your form if it doesn't contain any confidential information.
    Nith

  • Transport with return code 12 ,short dump with 'DBIF_RSQL_SQL_ERROR'

    Dear All,
    My trasnport contains infoprovider. DTP,transpformations, character realtionships , aggregation levels ,web templates, programs.
    I got a transport failed with Return code 12, and it is showing message :
    Program terminated (job: RDDEXECL, no.: 06031600)
       See job log
    Execution of programs after import (XPRA)
    End date and time : 20101026060421
    Ended with return code:  ===> 12 <===
    I have short dump with 'DBIF_RSQL_SQL_ERROR' exception 'CX_SY_OPEN_SQL_DB'.
    in how to correct the error :
    below is the detials.
    Database error text........: "ORA-01578: ORACLE data block corrupted (file #
    211, block # 79950)#ORA-01110: data file 211:
    '/oracle/RBW/sapdata15/xbw_188/xbw.data188'#ORA-26040: Data block was loaded
    using the NOLOGGING option"
    did someone has the same problem .
    Help is really appreciated.
    Regards
    Veera

    I am afraid you will need to esclate this to BASIS team.. seems some issue with database

  • Resultant user authorization of t-codes with a common Auth. Object

    Hi,
    I'm re-posting this question because the first time it was rejected and according to the Rules of Engagement, it seems it's because I did not post my photo, however, dear Moderator, if for any other reason, I mean not to be indecent, kindly let me know if there's anything violating the content rules.
    I'm trying to control access to t-code AS02 using Asset Views (Auth. Object A_A_VIEW), so while looking around I noticed that this Object A_A_VIEW is present in other t-codes/roles assigned to some users.
    My question is (pardon my basic terminology), if a I create a role that has a t-code with certain authorization values defined in its Authorization Objects, and assigned it to a user that has those Authorization Objects in his profile but from totally different t-codes in different roles, will the most explicit/resultant authorization take precedence in all the t-codes? or will the t-codes be accessed as per the authorization provided in their respective roles?

    Hi  Saleh
    Lack of photo would not have been the reason.
    Is SAP security your background? What do you know of generated profiles, user buffer and the concept of cross-inheritance (or cross-talk)?
    If you are asking if a user has Transaction AS02 from one role and A_A_VIEW from another would they be authorised or not then that is a basic question (fundamental of SAP authorisation concept). Basic questions are not allowed in SCN as you can obtain the answer via searching, sap help and basic training.
    If you are trying to understand some specifics of the A_A_VIEW authorisation that the SAP Help (and also IMG configuration for Asset Views) did not provide then you might need to clarify your question.
    Regards
    Colleen
    Ps - I did alert the moderator to your question as I thought it was basic question relating to the SAP authorisation concept that is covered in SAP help, Google and the ADM940 training course.

  • User Details with Related T-codes-Activity and Objects

    Dear Sir,
    My requirement is list of All users, Authorization object, user's assign t-codes and related activity(Create, Change and Display) with Organization level.
    Is there any Standard report for this. If standard report is not available please guide how to do this in Custom Reports.
    I have searched in SDN and web but not find any satisfactory answer. Actually
    Thanks in Advance.
    Ram Shanker

    Dear Fred,
    Actually I want to see all the user (Exist in System) and related Authorization object and Transaction Code with Transaction Activity. So Can you give some details about that. I have seen those tables like AGR% but It have not details description about Transaction Code and related activity.
    Please guide.
    Thanks.
    Ram Shanker

  • Issues with binding an XML object

    Hi all.
    I'm doing a quick data editor for a game I'm working on using
    AIR and flexbuilder. Anyway, I've stored all the data in an XML
    object and I'm binding various controls to the XML object. But I've
    come across a weird issue when I update the data.
    Basically I create a datagrid thats bound to the XML
    (basically it reads a list of companies from the XML object). I
    also have a MXML form thats bound to the same data (only from a
    single company at the selected index of the datagrid).
    So its all working neatly, apart from one thing. When I
    select different rows from my datagrid, I'm getting strange
    behavior from my update function (which simply sets the XML objects
    values to the values in my form fields). Its as though there is
    some caching going on within the data binding thats essentially
    overriding my text edit fields .text properties.
    Strangely enough, the update works, but not the first time
    you select a new row from the datagrid.
    So I'm wondering if there is some method to use to invalidate
    any caching of data (its almost like the text is being retrieved
    from a cache and stored back into the edit fields text property).
    I'd added the MXML code for the app. Although the app reads
    an XML file in the storage directory so its unlikely you'll be able
    to run it. But if you need the xml, here it is:
    <companies>
    <company>
    <companyname>Ericson</companyname>
    <companydesc>Some kind of description
    here</companydesc>
    </company>
    <company>
    <companyname>Vodaphone</companyname>
    <companydesc>This is another
    description</companydesc>
    </company>
    <company>
    <companyname>Smother</companyname>
    <companydesc>Wingles another
    description</companydesc>
    </company>
    </companies>
    Hope someone can shed some light here.

    You could try the Apache XMLBeans 2.1.0.
    I have the same need to use xs:any datatype and, at least, XMLBeans do not fail in the bean generation process.
    Cheers.

  • Is there any way to upload Tariff Code (with multiple XML files) from application server?

    Hi All,
    Is there any way to upload Tariff Code (with multiple XML files) from application server?. Its urgent.
    Regards,
    Jatin

    Hi Jatin,
    Yes, of course you can upload multiple files for tariff codes.
    This can be done by the below path:-
    SAP GTS Cockpit(tcode-/sapsll/menu_legal)-->Customs Management-->Classification-->Classification Master Data-->Upload Tariff Code Numbers from XML file(tocde- /SAPSLL/LLNS_UPL101).
    In the above area after browsing and choosing the first file, please select multiple check box to choose more files as well. Then you can further select your application server and upload all those files in one go.
    PS:- Although, we have an option to upload multiple such files but actually we should avoid multiple file uploads due to various reasons. Hence, please take utmost care during such procedure.
    Regards,
    Aman

  • Short Code SMS with Skype Number

    Can I use Skype Number to receive Short Code SMS?

    Hi, Amirhameed, and welcome to the Community,
    Unfortunately, no; return SMS messages would be recieved by your mobile phone number.  More information here:  https://support.skype.com/en/category/SKYPE_SMS/ and in particular, here: https://support.skype.com/en/faq/FA3591/sending-sms-text-messages-windows-desktop
    The person you sent the SMS text message to won’t be able to reply you on Skype. However, you can change your settings to receive the SMS text message replies on your mobile. To do so, select Tools > Options… > IM & SMS > SMS Settings and enter and verify your mobile number.
    Kind regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • Performance issue with Business Objects Java JRC API in CRXI R2 version

    A report is developed using java JRC API in CR XI release 2. When I generate the report in the designer, it took less than 5 seconds to display the results in crystal report viewer inside the designer. But in the QA environment, when I generate the same report from the application, it takes almost 1 to 1.5 minutes to display the same results in PDF. I also noticed that if the dataset contains bigger volume of data, then the reports are taking even longer almost 15 to 20 minutes.
    While generating the report from the application, I noticed that most of time is taken during the execution of the com.crystaldecisions.report.web.viewer.ReportExportControl Object method as shown in following line of code
    exportControl.processHttpRequest(request, response, context, null)
    We thought the delay in exporting the report to PDF might be the layout of the report and data conversion to PDF for such a bigger volume of data.
    Then we investigated the issue and experimented quickly to generate the same report with same result set data from the application using XML, XSL and converted the output XSL-FO to PDF using Apache FOP (Formatting Objects Processor) implementation. The time taken to export the report to PDF is less than 6 seconds. By doing this experiment, it is proved that the issue is not with conversion of data to PDF but it is the performance problem with Business Objects Java JRC API in CR XI R2.
    In this regard, I searched for the above issue in the SAP community Network Forums -> Crystal Reports and Xcelsius -> Java Development -> Crystal Reports. But I did not find any answers or solutions for this kind of issue in the forums.
    Any suggestion, hint in this matter is very much appreciated.

    Ted, The setReportAppServer problem is resolved. Now I could able to generate the report with hardcoded values in the SQLs in just 6 seconds where as the same report was generated in CRXI R2 in 1 minute 15 seconds as mentioned in the earlier message.
    But, our exisiting application passes the parameter values to the SQLs embedded in the report. For some reason the parameters are not being passed to the report and the report displays only the labels without data.
    As per the crj 12 samples codes, the code is written as shown below.
    1. Created ReportClient Document
    2. SetReportAppServer
    3. Open the report
    4. Getting DatabaseController and switching the database connection at runtime
    5. Then setting the parameters as detailed below
    ParameteFields parameterFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
    parameterFieldController.setCurrentValue("", "paramname",paramvalue);
    parameterFieldController.setCurrentValue("", "paramname",paramavalue);
    byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF); 
    6. Streaming the report to the browser
    Why the parematers are not being passed to the report?  Do I need to follow the order of setting these parameters?  Did I miss any line of code for setting Params using  crj 12?
    Any help in this regard would be greatly appreciated.

  • Passing data from an XML object to an itemRenderer

    I'm trying to color the background of a column in a datagrid and have found a sample file that illustrate the concept. However, the sample has data stored in an arrayCollection whereas mine is in an XML object. The problem is that the data in the sample file is apparently automatically passed to the itemRenderer (shown below: note the trace statement). My XML object does not appear to automatically pass data to the itemRenderer. So my questions are:
    1. Is there a simple way to pass data stored in an XML object to an itemRenderer
    or
    2. Should I convert my XML to an arrayCollection? If so, what's the best way to do this-- I've tried the following, but without success:
    <mx:Model id="xmldata" source="example3.xml"/>
      <mx:ArrayCollection id="myAC" source="{ArrayUtil.toArray(xmldata.Example1)}" />
    Here's what the xml looks like:
    <TABLE>
       <EXAMPLE1>
          <difficulty> 0.5 </difficulty>
          <discrimination> 0.7 </discrimination>
          <item> 3 </item>
       </EXAMPLE1>
    </TABLE>  
    Here's the itemRenderer:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml">
        <!--
            This item renderer simply extends Label and overrides the updateDisplayList function to
            draw a gradient-filled rectangle. The colors in the gradient are determined from the
            data.
        -->
        <mx:Script>
        <![CDATA[
            import flash.geom.Matrix;
            import flash.display.GradientType;
            import flash.display.Graphics;
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                super.updateDisplayList(unscaledWidth,unscaledHeight);
                var m:Matrix = new Matrix();
                m.createGradientBox(unscaledWidth,unscaledHeight);
                var g:Graphics = graphics;
                            trace("data.col3="+data.col3)
                var colors:Array = (data.col3 < 2000 ? [0x0000CC,0x0000FF] : [0x00CC00,0x00FF00]);
                g.clear();
                g.beginGradientFill(GradientType.LINEAR, colors, [0.2,0.6], [0,255], m);
                // the rectangle is drawn a little high and a little tall to compensate for the gap
                // the DataGrid introduces between rows.
                g.drawRect(0, -2, unscaledWidth, unscaledHeight+4 );
                g.endFill();
        ]]>
        </mx:Script>
    </mx:Label>

    This sample code should answer your question of how to bring data into the renderer automatically. It comes in via the DataGrid dataProvider and then you refer to it in the renderer as data.XYZ, where XYZ is the field in the XML with the data. See FB 3 help sys on e4x syntax.
    ------------------ mainapp.mxml --------------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="srvc.send();">
      <mx:Script>
        <![CDATA[
          import mx.rpc.events.ResultEvent;
          import mx.collections.XMLListCollection;
          [Bindable] private var xlc:XMLListCollection;
          private function dataHandler(evt:ResultEvent):void{
            xlc = new XMLListCollection(evt.result..EXAMPLE1 as XMLList);
        ]]>
      </mx:Script>
      <mx:HTTPService id="srvc" url="data2.xml" result="dataHandler(event)"
        resultFormat="e4x"/>
      <mx:DataGrid dataProvider="{xlc}">
        <mx:columns>
          <mx:DataGridColumn headerText="Difficulty" dataField="difficulty"/>
          <mx:DataGridColumn headerText="Discrimination" dataField="discrimination"/>
          <mx:DataGridColumn headerText="Item" itemRenderer="MyLabel"/>
        </mx:columns>
      </mx:DataGrid>
    </mx:Application>
    ----------- MyLabel.mxml --------------
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import flash.geom.Matrix;
          import flash.display.GradientType;
          import flash.display.Graphics;
          override protected function updateDisplayList(unscaledWidth:Number,
            unscaledHeight:Number):void{
            super.updateDisplayList(unscaledWidth,unscaledHeight);
            this.text = data.col3;
            var m:Matrix = new Matrix();
            m.createGradientBox(unscaledWidth,unscaledHeight);
            var g:Graphics = graphics;
            var colors:Array = (data.col3 < 2000 ? [0x0000CC,0x0000FF] : [0x00CC00,0x00FF00]);
            g.clear();
            g.beginGradientFill(GradientType.LINEAR, colors, [0.2,0.6], [0,255], m);
            g.drawRect(0, -2, unscaledWidth, unscaledHeight+4 );
            g.endFill();
        ]]>
      </mx:Script>
    </mx:Label>
    ------------ data2.xml ----------------
    <?xml version="1.0" encoding="utf8"?>
    <TABLE>
       <EXAMPLE1>
          <difficulty> 0.5 </difficulty>
          <discrimination> 0.7 </discrimination>
          <col3> 3 </col3>
       </EXAMPLE1>
    </TABLE>

Maybe you are looking for

  • Help! My MacBook Pro has turned on me!

    Hi! I was hoping you guys could help me out. I bought my beautiful Mac Book Pro the summer of 2012. It has been perfect and wonderful for quite sometime. I am a teacher and mainly use it for creating documents for school and my business. Yesterday mo

  • Multiple Users need (maintenance) access to a customized table.

    Hi Gurus We created a z table and maintained couple of values in it The _attributes _ are as follows: Delivery Class : A (Application table (master and transaction data) Table Maintenance : Display and Maintenance allowed ISSUE : This table does not

  • SOAP Receiver Adapter Error in XI RWB - java.lang.NULLPointerException

    Hi, We have a asynchronous scenario in SAP-XI, where we are sending the PO data from SRM to third party (Hubspan / TNT). Proxy is being used at Sender side and SOAP Adapter is used for Receiver Communication Channel. u2022SRM is sending around 1000 m

  • Attach document in mail

    Hi, it appears I can't attach a document in outlook mail. Is there a solution?

  • Downloaded and installed Firefox Sync, restarted and now can't find it.

    Downloaded and installed Firefox Sync on XP SP-3 computer. Restarted Firefox as instructed. Can't find Firefox Sync. Nothing popped up on restart as instructions stated. == This happened == Every time Firefox opened == After Firefox Sync downloaded