ASTRA Badge Kit
The Badge Kit is an an XML-based framework for rapid development of small interactive Flash applications. You can learn how to use the Badge Kit very quickly, and most of the usage scenarios require no knowledge of Flash.
Creating Badge Kit Services
Creating services for the Badge Kit is simple if you have a bit of ActionScript knowledge. Since the framework is already there, it's easy for you to plug in your service URLs, tweak the parameters, and be on your way. I'll go over some of the steps you'll want to follow in order to make your service compatible with the Badge Kit.Creating a Service
First of all, in order to have a common language for the Badge Kit, all services need to have the same API for sending and receiving results. To easily accomplish this, any service must implement the Interface com.yahoo.webapis.IService. All this does is ensure that you've created the same methods for sending and returning results. The interface IService sets up two methods that you'll need to implement:- send, which sends the service: function send(parameters:Object = null):void;
- a getter to access the service results: function get lastResult():Object;
First, we declared the service, implementing IService. We placed this code into an AS file called OddNewsRSSService.as, under that example's source folder. Then we implemented the two necessary methods, send() and get lastResult().
In the send() method, we create a loader to do the downloading of the RSS feed. We set up an event listener so when it's done downloading, it will parse through the results and place them into an array. Using the get lastResult() method, we return this array of items we've parsed out. Now we can access this information from the service's lastResult property in the badge's content.xml.