Groups | Blog | Home
all groups > macromedia flash flashcom > december 2005 >

macromedia flash flashcom : anyone knows how to do this?


Tokenizer
12/19/2005 4:19:37 PM
everytime i run myApp.swf, it runs the same instance of the program... this
"myApp.swf" is a chat program, which has to allow only two way convesation
between user 1 and 2 .... i can successfully send this swf file, the usernames
so that i know which two users are talking to eachother at any given time....
the problem is this

user 1 and 2 try to connect and start talking to eachother.... this part works

now imagine two new users 3 and 4 are connecting.... instead of these new
users being attached to a new instance of the program, they join the existing
converstation between users 1 and 2


obviously this is because i don't know how to create instances of the
application ... and really i'm connecting to the same application....

how do i overcome this issue...

any links to tutorials or functions or example code however small is
appreciated...

i must say that i have already read this article
and found it to be of no help:
http://www.macromedia.com/devnet/central/articles/vchat.html


regards
Tokenizer
CAXOnline
12/19/2005 4:59:04 PM
Instances of applications are just a folder under the application folder on the
server.
ie.
1) On the server:
fcs\applications\myApp
Inside the folder you should have main.asc to include all required components.
I think you have this already, but just to in case.

2) On your fla file (myApp.fla) you can create an instance as follows:
myCon = new NetConnection();
myInstance = "Instance1";
myCon.connect("rtpm://server.com/myApp/" + myInstance, "User");
MyChat.connect(myCon);

Now for this to work, you will need to create a new instance (change the value
of the myInstance variable) for each pair of users.

You will see a new folder is created on the server under the application
folder with the name of the instance. Under it, a sharedObject will be created
to hold the chat history of each instance.

Hope this helps.

Carlos Lozano
www.caxonline.net
Tokenizer
12/19/2005 6:06:25 PM
thanks alot CAXOnline

this line "myCon.connect("rtpm://server.com/myApp/" + myInstance, "User");" is
what i needed

worked like a charm

didn't know how to create instances

thanks for the help

regards
Tokenizer


AddThis Social Bookmark Button