Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Follow Me

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


Using Remoting Connector and DataHolder components

5. The formatter class

As we saw earlier we had defined a "myformatter" class inside the custom formatter databinding option panel. Thie file has the following structure ( myformatter.as ):


class myformatter

{
    function myformatter (){}
    function format ():Array{
        trace('format');
        var __d:Array = new Array();
        var _arg = arguments[0];
        for(var a = 0; a < _arg.length; a++){
            __d.push({label: "name of code: " + _arg[a].code + " is " + _arg[a].description, data:_arg[a].code})
        }
        return __d
    }

}


We've finished. The very last thing is to declare import for the custom formatter class and then to trigger the remoting connector component.
In the frame actions just place this:

#include "NetDebug.as"
// import the custom formatter class
import myformatter
// set loading data
// as default value
this.myListBox.addItem('loading...')
// trigger the NetService Connector
NS.trigger()

 

6. Download

Download file used for this tutorial