Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts

    Question need help with flash param

    I been building a flash irc client but I'm unable to set the host irc param
    here is the code

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    	<head>
    		<title>IRCChat</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	</head>
    	<body>
    		<div id="flashContent">
    			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1190" height="730" id="FlashIRCChat" align="middle">
    				<param name="movie" value="FlashIRCChat.swf" />
    				<param name="quality" value="high" />
    				<param name="bgcolor" value="#ffffff" />
    				<param name="play" value="true" />
    				<param name="loop" value="true" />
    				<param name="wmode" value="window" />
    				<param name="scale" value="showall" />
    				<param name="menu" value="true" />
    				<param name="devicefont" value="false" />
    				<param name="salign" value="" />
    				<param name="allowScriptAccess" value="sameDomain" />
    				<param name="Host" value="irc.zunkies.com" />
    				<param name="Port" value="6667" />
    				<!--[if !IE]>-->
    				<object type="application/x-shockwave-flash" data="FlashIRCChat.swf" width="1190" height="730">
    					<param name="movie" value="FlashIRCChat.swf" />
    					<param name="quality" value="high" />
    					<param name="bgcolor" value="#ffffff" />
    					<param name="play" value="true" />
    					<param name="loop" value="true" />
    					<param name="wmode" value="window" />
    					<param name="scale" value="showall" />
    					<param name="menu" value="true" />
    					<param name="devicefont" value="false" />
    					<param name="salign" value="" />
    					<param name="allowScriptAccess" value="sameDomain" />
    					<param name="Host" value="irc.zunkies.com" />
    					<param name="Port" value="6667" />
    				<!--<![endif]-->
    					<a href="http://www.adobe.com/go/getflash">
    						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
    					</a>
    				<!--[if !IE]>-->
    				</object>
    				<!--<![endif]-->
    			</object>
    		</div>
    	</body>
    </html>
    and here the socket code

    Code:
    
     
    class NBClasses.chatsocket extends XMLSocket {
    	var _sStartChannel, _sHost, _nPort, _sUsername, _sUserPass, _sAuthPass, sStartChannel;
    	var _sServer, iIdleCount;
    	
    	var onWrite:Function, onJoin:Function, onQuit:Function, onPart:Function,
    		onPrivmsg:Function, onPrivmsgPr:Function, onChanPrivmsg:Function, onNameslist:Function, onUserMode:Function,
    		onChanMode:Function, onChanModeWParams:Function, on324:Function, onNick:Function, onWhisper:Function,
    		on821Chan:Function, on822Chan:Function, on821Pr:Function, on822Pr:Function, on332:Function;
    	var onNoticeChanBroadcast:Function, onNoticePrivate:Function, onNotice:Function,
    		onNoticeServerMessage:Function, onNoticeServerBroadcast:Function, onKick:Function, on341:Function,
    		onInvite:Function, onKnock:Function, onDataIRC:Function, on301:Function, onSetNick:Function,
    		onProp:Function, onErrorReplies:Function;
    	
    	//
    	var ClearReconnectTimer:Function, SetReconnectTimer:Function;
    	
    	//Privates
    	private var _bIsConnected:Boolean, _bConnectionRegistered:Boolean = false;
    	private var m_serverName:String;
    	
    	function chatsocket()
    	{
    		iIdleCount = 0
    	}
    	
    	//** Properties Begin
    	function set IsConnected(bStatus:Boolean)
    	{
    		_bIsConnected = bStatus;
    	}
    	function get IsConnected()
    	{
    		return _bIsConnected;
    	}
    	
    	function set Channel(sChannel:String) 
    	{
    		this._sStartChannel = sChannel;
    	}
    	function get Channel():String
    	{
    		return this._sStartChannel;
    	}
    	// End property
    	
    	function set Host(sHost:String)
    	{
    		this._sHost = sHost;
    	}
    	function get Host():String
    	{
    		return this._sHost;
    	}
    	// End property
    	
    	function set Port(nPort:Number) 
    	{
    		this._nPort = nPort;
    	}
    	function get Port():Number 
    	{
    		return this._nPort;
    	}
    	// End property
    	
    	function set UserName(sUsername:String)
    	{
    		this._sUsername = sUsername;
    	}
    	function get UserName():String 
    	{
    		return this._sUsername;
    	}
    	// End property
    	
    	function set UserPass(sUserPass:String) 
    	{
    		this._sUserPass = sUserPass;
    	}
    	function get UserPass():String
    	{
    		return this._sUserPass;
    	}
    	// End property
    	
    	function set AuthPass(sAuthPass:String) 
    	{
    		this._sAuthPass = sAuthPass;
    	}
    	function get AuthPass():String
    	{
    		return this._sAuthPass;
    	}
    	// End property
    	
    	function set ServerName(sSrvName:String)
    	{
    		m_serverName = sSrvName;
    	}
    	function get ServerName():String
    	{
    		return m_serverName;
    	}
    	
    	//** Properties End
    	
    	//** Socket Events Begin
    	function onConnect(success)
    	{
    		if (success) 
    		{
    			Write("<font color='#006600'>Connected!</font>");
    			this.IsConnected = true;
    			
    			//NICK >Guest
    			//USER anon \"anon.com\" \"0.0.0.0\" :anon
    			if (_global.gsLoginType == "auto") this.UserName + random(20000);
    			else 
    			{
    				if (this.UserName.substr(0, 1) != ">") this.UserName = ">" + this.UserName;
    			}
    			onSetNick(this.UserName);
    			IRCSend("NICK " + this.UserName);
    			IRCSend("USER anon \"anon.com\" \"0.0.0.0\" :anon");
    		}
    		else 
    		{
    			Write("<font color='#FF0000'>Couldn't connect.</font>");
    			SetReconnectTimer();
    		}
    		// end if
    	}
    	
    	function onData(raw) 
    	{
    		if (raw.length>0) 
    		{
    			iIdleCount = 0;
    			
    			var sIrcArray = raw.split("\r\n");
    			for (var i=0; i<sIrcArray.length; i++)
    			{
    				this.parseString(sIrcArray[i]);
    			}
    		}
    		// End if
    	}
    	
    	function onClose()
    	{
    		Write("<font color='#FF0000'>Connection closed by the server.</font>");
    		_bConnectionRegistered = false;
    		this.IsConnected = false;
    		SetReconnectTimer();
    	}
    	//** End of Socket Event
    	
    	function CSocketConnectCallback()
    	{
    		CSocketConnect(undefined, undefined);
    	}
    	
    	function CSocketConnect(sHost, nPort) 
    	{
    		ClearReconnectTimer();
    		
    		if (sHost != undefined && nPort != undefined) 
    		{
    			this.connect(sHost, nPort);
    			this.Host = sHost;
    			this.Port = nPort;
    		}
    		else 
    		{
    			this.connect(this.Host, this.Port);
    		}
    		// end if
    		
    		_bConnectionRegistered = false;
    		Write("<font color='#0000CC'>Connecting to " + this.Host + ":" + this.Port + "</font>");
    	}
    	
    	function CSocketReconnect()
    	{
    		if (this.IsConnected == true) 
    		{
    			close();
    			_bConnectionRegistered = false;
    			this.IsConnected = false;
    		}
    		CSocketConnect();
    	}
    	// End of the function
    	
    	function parseString(raw) 
    	{
    		if (raw.length > 0)
    		{
    			var toks = [];
    			var ircmsg = (raw.charAt(0) == ":")?raw.substr(1):raw;
    			
    			//trace incoming
    			//Write("received: " + ircmsg);
    			
    			toks = ircmsg.split(" ");
    			
    			switch (toks[0].toLowerCase()) 
    			{
    			case "error" :
    				handleError(toks.join(" "));
    				return;
    				
    			case "ping" :
    				PingReply(toks.slice(1));
    				return;
    			}
    			// End of switch
    			
    
    // End of Class

  • #2
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    ok

    fvServer =
    fvPort =
    fvRoom =

    what the best way to add this ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •