Specifications

CHAPTER 11
238
includeCategory="true"
includeLevel="true"
>
<mx:filters>
<mx:Array>
<mx:String>mx.rpc.*</mx:String>
<mx:String>mx.messaging.*</mx:String>
</mx:Array>
</mx:filters>
<!-- 0 is represents the LogEventLevel.ALL constant. -->
<mx:level>0</mx:level>
</mx:TraceTarget>
<!-- HTTPService is in the mx.rpc.http.* package -->
<mx:HTTPService
id="srv"
url="../assets/trace_example_data.xml"
useProxy="false"
result="myData=ArrayCollection(srv.lastResult.data.result)"
/>
<mx:LineChart id="chart" dataProvider="{myData}" showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="month"/>
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries yField="apple" name="Apple"/>
<mx:LineSeries yField="orange" name="Orange"/>
<mx:LineSeries yField="banana" name="Banana"/>
</mx:series>
</mx:LineChart>
<mx:Button id="b1" click="srv.send();" label="Load Data"/>
</mx:Application>
Implementing a custom logger with the logging API
If you write custom components or an ActionScript API, you can use the logging API to access the trace system
in the debugger version of Flash Player. You do this by defining your log target as a TraceTarget, and then calling
methods on your logger when you log messages.
The following example extends a Button control. It writes log messages for the startup life cycle events, such as
initialize and creationComplete, and the common UI events, such as click and mouseOver.