Let me introduce myself really quick since I am a long time lurker and
a first time poster. I am a graphic designer for a transportation
company, that is slowly becoming a software developer (as it seems).

this is what I am trying to do:

1. populate a datagrid with xml (got this)
2. populate a datgrid along with it (got this also)
2. repopulate it every second(¿refresh?) with the same xml file, I am
using HTTPService to bring it in but can't get a timer/setInterval to
work at all; if that is the best thing.?¿

Heres my code; its pretty basic considering I am a beginner.....

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" initialize="titleService.send()">
                
        <mx:Script>
                <![CDATA[
                        import mx.collections.ArrayCollection;
                        import mx.rpc.events.ResultEvent;
                        
                        [Bindable]
                        private var myData:ArrayCollection;
                        
                        private function resultHandler(event:ResultEvent):void {
                                myData = event.result.items.item;
                        }
                ]]>
        </mx:Script>
        
        <mx:HTTPService id="titleService"
                url="data/datachart.xml"
                result="resultHandler(event)"/>
                
        <mx:Panel title="Demo Chart" 
        height="325" width="340" layout="absolute"
roundedBottomCorners="true" x="10" y="203">
        
        <mx:LineChart id="linechart" height="100%" width="100%"
paddingLeft="5" paddingRight="5" 
            showDataTips="true" dataProvider="{myData}" x="0" y="0">
                
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="time"
ticksBetweenLabels="true" displayName="Time"/>
            </mx:horizontalAxis>
            
            <mx:series>
                <mx:LineSeries yField="lane_a" form="segment"
displayName="Lane A"/>
            <mx:LineSeries yField="lane_b" form="segment" displayName="Lane 
B"/> 
            </mx:series>
            
        </mx:LineChart>
        
        <mx:Legend dataProvider="{linechart}" width="99" x="221" y="0"/>
        
        </mx:Panel>

        <mx:DataGrid dataProvider="{myData}" height="127" width="222" x="402"
y="355"/>
        <mx:Button label="reload" click="{titleService.send()}"  x="402"
y="490"/>
</mx:Application>


Any help would be great, I have read through the livedocs and the help
files but I am still stuck and can not get that code to work. Thanks
again.



Reply via email to