Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to communicate with SL with Flash?

Lyrehc Lavendel
Registered User
Join date: 20 Feb 2009
Posts: 4
04-21-2009 08:00
Is it possible to commuicate with SL with Flash (action script)? Is it by XML-RPC or else?

Many thanks!
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
04-21-2009 11:26
Yes....

http://wiki.secondlife.com/wiki/Category:LSL_XML-RPC
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Lyrehc Lavendel
Registered User
Join date: 20 Feb 2009
Posts: 4
04-22-2009 01:27
Thanks a lot for your reply, but I would like to have an "action script" example for the client side instead.

Is there any example showing how to write an action script for client side which can both send and receive message from SL?
Andy Grant
Registered User
Join date: 20 May 2005
Posts: 140
04-22-2009 02:35
From: Lyrehc Lavendel
Thanks a lot for your reply, but I would like to have an "action script" example for the client side instead.

Is there any example showing how to write an action script for client side which can both send and receive message from SL?


What you should propably look into is Adobe Flex, if you are looking for a "simple" solution to do all this.
Lyrehc Lavendel
Registered User
Join date: 20 Feb 2009
Posts: 4
04-22-2009 04:04
Is Flex similar to Flash? Coz I would like to start up the client program by Flash (action script 2.0)

Would it be better to do the program with action script 3.0 instead?
Andy Grant
Registered User
Join date: 20 May 2005
Posts: 140
04-22-2009 05:19
From: Lyrehc Lavendel
Is Flex similar to Flash? Coz I would like to start up the client program by Flash (action script 2.0)

Would it be better to do the program with action script 3.0 instead?


Flex is flash&AS :)

Do google for flex tutorials, i found it very simple to work with.
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
04-23-2009 22:08
I haven't done anything in flash yet using XML-RPC, so can't really help you out there, but, perhaps if you described in detail what you want to do, you could get some help for the SL side, which would then let you know exactly what you're going to need to do in flash. Kind of hard to script (in AS3 or LSL) when no one has any idea what exactly you're trying to do. I have been teaching myself flash lately so I'm not lost there, but there's no way to help you at all unless I know what you're up to.

As far as flex or flash, it doesn't really matter, if you're used to working in flash, then go that route. The major difference between the two is that flex is all action script while flash is the action script plus all the authoring tools that you find in flash (movie clips, sprites, time lines, etc). You're probably fine using flash because much of the interface 'coding' on the flash side can be done via movie clips and time line related stuff.

You also might want to consider using HTTP polling instead of XML-RPC because XML-RPC on the LL side is a single server with bottleneck issues and is pretty unreliable.

However, if you are adamant about going the XML-RPC route, look here for some useful information as well as some examples using PHP, Perl, Java and VB 6 as well as the LSL code for the Second Life side.

http://wiki.secondlife.com/wiki/Category:LSL_XML-RPC
_____________________
My tutes
http://www.youtube.com/johanlaurasia
Lyrehc Lavendel
Registered User
Join date: 20 Feb 2009
Posts: 4
05-05-2009 11:11
Thanks so much for the reply.

What I would like to do is: People could send message to SL from the outside program, i.e. flash. And, the LSL program will response to the message and did something in SL. Also, LSL will send reply+message to the outside program. That's mean it is a two-way communication.

For example, Flash send a message to control the item in SL to move in X-direction. Then, the LSL program, which is embedded in the item, will send a response message back to flash. So far and so on.


So, is that XML-RPC could do this? I mean between Flash and LSL these two programs.

Will "HTTP polling" be better? Where could I find the reference about "HTTP polling" between SL and outside program?
ElQ Homewood
Sleeps Professionally
Join date: 25 Apr 2007
Posts: 280
05-05-2009 14:02
I've honestly never had a problem with XMLRPC, although I admit I tightly control the information being sent due to the size limitations in SL. XMLRPC won't, however, do two-way communication. To do that, you need to use HTTP on the SL side and RPC on the Flash side.

Unless, of course, your two-way communication is within the limits of the response to the RPC specifically..I haven't done that, but there is a response when an RPC communication is received by your LSL script. I'll have to try it inworld to see.