0 Replies Latest reply on Apr 18, 2011 3:19 PM by troy.j.loberger@uwsp.edu

    Mixing 2 applications


      I am looking for some help with making 2 smaller applications work together. I have one that updates twitter feeds and another that uses google translation services. I want to take my ArrayCollection and send it through google services prior to populating a datagrid. How would i go about doing this. Here is my code, any help is much appreciated:

                                                      import com.adobe.serialization.json.JSON;                import mx.collections.ArrayCollection;                import mx.managers.CursorManager;                                import twitter.api.data.TwitterUser;                import twitter.api.Twitter;                import twitter.api.events.TwitterEvent;                import twitter.api.TwitterSearch;                import twitter.api.data.TwitterStatus;                                import mx.rpc.events.ResultEvent;                                [Bindable]public var googleText:String = "http://ajax.googleapis.com/ajax/services/language/" ;                [Bindable]public var tsrc:String ="translate?v=1.0&q=";                [Bindable]public var lanpair:String = "&langpair=";                [Bindable]public var pairCode:String = "%7C";                [Bindable]public var trans:String;                                private function onJSONLoad(event:ResultEvent):void                {                     var rawData:String = String(event.result);                     if(JSON.decode(rawData).responseData.translatedText !=null){                     var decoded:String =JSON.decode(rawData).responseData.translatedText;                     }else {                          decoded = "None support";                     }                     //txtdest.text = decoded;                     trans = decoded;                }                                          [Bindable] private var twitterStatusCollection:ArrayCollection;                                private function doSearch():void                {                     CursorManager.setBusyCursor();                     var twit:Twitter = new Twitter();                     twit.addEventListener( TwitterEvent.ON_USER_TIMELINE_RESULT, userTimelineResult);                     twit.loadUserTimeline(tiTwitterUser.text);                }                                private function userTimelineResult(event:TwitterEvent):void                {                     twitterStatusCollection = new ArrayCollection();                     for each( var status:TwitterStatus in event.data )                     {                          twitterStatusCollection.addItem(status);                     }                     CursorManager.removeBusyCursor();                }