Simple question: How?

Hey!

I’ve now successfully installed my copy of Openfire. And now I want to do 2 things.

  1. I want to make “openfire start” everytime I start my (Ubuntu 8.10) server.

  2. Start developing a flash/as3-based chat.

How?

Documentation?

I’ve been searching around a while, and have not found anything great yet. I found a “simple” code though.

import org.jivesoftware.xiff.conference.Room;
import org.jivesoftware.xiff.core.JID;
import org.jivesoftware.xiff.core.XMPPSocketConnection;
import org.jivesoftware.xiff.events.LoginEvent;
import org.jivesoftware.xiff.events.RoomEvent;
import org.jivesoftware.xiff.events.XIFFErrorEvent;

var connection:XMPPSocketConnection;

function onCreationComplete():void
{
connection = new XMPPSocketConnection();
connection.username = “username”;
connection.password = “password”;
connection.server = “server.mydomain.com”;
connection.port = 5222;

connection.addEventListener(LoginEvent.LOGIN, onLogin);
connection.addEventListener(XIFFErrorEvent.XIFF_ERROR, onError);

connection.connect(“standard”);
}

function onLogin(e:LoginEvent):void
{
var room:Room = new Room(connection);
room.roomJID = new JID(“test@conference.mesh.local”);
room.addEventListener(RoomEvent.ROOM_JOIN, onRoomJoin);
room.join();
}

function onRoomJoin(e:RoomEvent):void
{
Room(e.target).sendMessage(“im here”);
}

function onError(e:XIFFErrorEvent):void
{
trace(e.errorCode);
}

Which someone said should work great. But doesn’t seem to work at all. I get the output

Room.as, Line 214 1017: The definition of base class ArrayCollection was not found. public Room extends ArrayCollection

Room.as, Line 1251 1020: Method marked override another method. override public function toString():String

Somebody help me, please?

Cheers,

Artheus

I am not sure what version of XIFF you are using, but the JID class no longer exists in XIFF 3.0 beta. You need to replace that with UnescapedJID class. Also, I haven’t used the Room class much yet, however I used (perhaps had too) the roomName method to actually get in a room.

If you got this snippet from mikechambers.com, there is a comment that I left explaining this briefly.

Well from what I see the JID class still exists in the 3.0.0 Beta?

Cause the version I have got is 3.0.0 Beta.

What does the Error message I get mean?

1017: The definition base class ArrayCollection was not found. public class Room extends ArrayCollection

1020: Method marked override must override another method. override public funtion toString():String

Really don’t get this…?

Should I use another code? Where could I find this new code?

I can’t find the UnescapedJID class.

Don’t really understand the roomName method.

Well… As a matter of fact I don’t really get this at all I think :confused:

Thank you for helping!

Cheers,

Artheus

I assume the files you are using came in a ZIP file from the downloads/Releases page of www.igniterealtime.org? At any rate, I am using the svn repository’s trunk files. You can find the svn URL on the downloads/Sources page.

1017: The definition base class ArrayCollection was not found. public class Room extends ArrayCollection

This is caused because you haven’t import ArrayCollection. Just add the following to your class:

import mx.collections.ArrayCollection;

The Room class in my XIFF src code imports and extends ArrayCollection, and it doesn’t thru any errors. The second error is related directly with the first error. In your Room class, there is a function marked for override named toString(). But, since your Room class doesn’t know what ArrayCollection is, which inherits from ListCollectionView, it simply doesn’t see any toString() to override. Hence the error:

“…Method marked override must override another method.”

The toString() resides in ListCollectionView.

Hi,

I wonder where I can get the most recent XIFF version.

Many thanks to you

To access the latest source files, you would need to pull from their SVN repository. On this page has a list with their SVN repositories along with its URL.

If you are unfamilar with SVN (Subversion), visit its site here. On the homepage, has a list of third-party software that will pull a copy a repository to your computer. I use TortoiseSVN.

Does that help?

Do I need to download something to get the mx.collections.ArrayCollection?

Cause it won’t work even if I import ArrayCollection.

Would be really nice if someone could show me a code snippet of how to connect to a server with XIFF.

Or is there any way of getting the source code of the flashfiles in the Spark web?

Some examples would be really nice!

Cheers,

Artheus

Here’s a few links for starters

http://www.dgrigg.com/post.cfm/09/05/2006/XIFF-Actionscript-3-for-Flex-2

http://velloff.com/XIFF_AS3/XIFF_AS3_GUI.html

http://velloff.com/XIFF_AS3/srcview/index.html

There’s plenty more if you Google around.

Cheers,

Karthik

Thank you!

But the problem with those are that they are all for the Flex Builder. And none of them are for flash.

Cheers

Hi,

For something as complex as XIFF, you’re best off using Flex Builder to build your RIA - what’s preventing you from doing so?

Karthik

Well… I have got flash. But not Flex builder.

And I don’t have the money to buy Flex.

You might want to use Flex SDK 3. It is free.

http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3

If you are unemployed and would like a copy of FB 3.0 Pro, visit the following link:

Adobe® Flex™ Builder 3 Professional for unemployed developers