Код: Выделить всё
package{import flash.display.Sprite;import fl.controls.TextInput;import flash.text.*;import flash.events.*; import fl.containers.UILoader;import fl.data.*;import flash.events.Event;import flash.net.URLRequest;import flash.net.navigateToURL;import flash.display.MovieClip;import fl.data.DataProvider;import fl.controls.List;import flash.net.*;import flash.display.*;import flash.display.MovieClip;import flash.filters.*;import com.adobe.serialization.json.JSON;import flash.ui.Mouse;import flash.system.Security;import flash.external.ExternalInterface; import com.api.forticom.ApiCallbackEvent;import com.api.forticom.ForticomAPI;import api.com.odnoklassniki.Odnoklassniki;import api.com.odnoklassniki.events.ApiServerEvent;import api.com.odnoklassniki.core.OdnoklassnikiSession; public class Doc extends Sprite{public var apiKey:String; public function Doc() { Odnoklassniki.initialize( this.stage, apiKey );Odnoklassniki.addEventListener(ApiServerEvent.CONNECTED, onConnect);Odnoklassniki.addEventListener(ApiServerEvent.CONNECTION_ERROR, onErrorConnection);Odnoklassniki.addEventListener(ApiServerEvent.PROXY_NOT_RESPONDING, onErrorConnection);Odnoklassniki.addEventListener(ApiServerEvent.NOT_YET_CONNECTED, onErrorConnection);}private function onErrorConnection( e: ApiServerEvent ): void{test.text = "Ошибка";} private function onConnect( e: ApiServerEvent ): void{uids = Odnoklassniki.session.uid;var fields: String = "uid, first_name, last_name, pic_1";Odnoklassniki.callRestApi( "users.getInfo" , _getUsersInfo, { uids:uids , fields:fields }, "JSON", "POST" );}private function _getUsersInfo( data: Object ): void{ avatar.source = data[0].pic_1; last_n.text = data[0].last_name; first_n.text = data[0].first_name; }}}