- 1、本文档被系统程序自动判定探测到侵权嫌疑,本站暂时做下架处理。
- 2、如果您确认为侵权,可联系本站左侧在线QQ客服请求删除。我们会保证在24小时内做出处理,应急电话:400-050-0827。
- 3、此文档由网友上传,因疑似侵权的原因,本站不提供该文档下载,只提供部分内容试读。如果您是出版社/作者,看到后可认领文档,您也可以联系本站进行批量认领。
查看更多
SFS官方教程AS30版第四篇
package {
import flash.display.Sprite;
import it.gotoandplay.smartfoxserver.SmartFoxClient;
import it.gotoandplay.smartfoxserver.SFSEvent;
import it.gotoandplay.smartfoxserver.data.*;
import flash.display.MovieClip;
import fl.controls.*;
import flash.events.MouseEvent;
import fl.events.ListEvent ;
import flash.events.Event;
import fl.transitions.*;
import fl.transitions.easing.*;
/**
* @author Administrator
*/
public class main extends Sprite {
private var __sfsClient : SmartFoxClient;
private var __ip : String;
private var __port : uint;
private var __usrNmae:String;
private var __zone:String;
private var __areaW:uint;
private var __areaH:uint;
private var __avatarW:uint;
private var __avatarH:uint;
private var __selectedUsr:int;
private var __newRoom:int;//这里要用 int型 因为__sfsClient.joinRoom(__newRoom,_pwd)如果用roomId进入的话 第一个参数是int
//private var __playerList:Array
private var __avatarMC:MovieClip;
private var __myPlayer:MovieClip;
private var __inited=false;
public function main() {
__init();
}
private function __init():void {
__ip=127.0.0.1;
__port=9339;
__zone=simpleChat;
//__selectedUsr=;
__areaW = 370
__areaH = 320
__avatarW = 56
__avatarH = 56
//__playerList=new Array();
__avatarMC=new MovieClip();
addChild(__avatarMC);
tips_mc.visible=false;
login_mc.visible = false;
chat_mc.visible = false;
passW_mc.visible=false;
newRoom_mc.visible=false;
priMsg_mc.visible=false;
__connectSfs(__ip,__port);
}
private function __initEvt() : void {
__sfsClient.addEventListener(SFSEvent.onConnection, __onConnect);
__sfsClient.addEventListener(SFSEvent.onConnectionLost, __onConnectionLost);
__sfsClient.addEventListener(SFSEvent.onRoomListUpdate, __onRoomUpdate);
__sfsClient.addEventListener(SFSEvent.onJoinRoom, __onLoginRoom);
__sfsClient.addEventListener(SFSEvent.onUserLeaveRoom, __onUserLeaveRoom
文档评论(0)