BLITZ is excited to announce a new open-source project called LocalConnectionService which effectively eliminates common issues encountered when using LocalConnection for Flash Player runtime collaboration.
- Dramatically reduces code and time required for runtime collaboration.
- Enables unlimited two-way communication between any two Flash files running on the same computer.
- Enables new functionality for the Flash platform; from Flash pop-up panels in a browser to website companion desktop applications.
Give it a try!
- Click the link below to launch a browser pop-up window
- Mouse around the image loaded by the .swf in the pop-up.
- See a 400×400px bitmap screen shot of the loaded image appear below, transferred through LocalConnectionService!
Tip: Firefox is the fastest browser to use. You can see as much as 15-20 MB/s!
Click to launch pop-up, and then move your mouse around it to see a ~300KB, 400×400px bitmap screen shot below sent through LocalConnectionService.
About LocalConnection The LocalConnection class was introduced in 2002 as a feature of Flash Player 6 which allows two .SWF files running on the same computer to send instructions to eachother. (See the LocalConnection for more info).
Intrinsic limitations of LocalConnection
- The 40KB limit. Instructions sent through LocalConnection are data capped at a 40KB limit. Any instruction containing more data than this (like an image) results in a runtime error.
- One-way communication. All communication through LocalConnection is one-way; there is no direct way to return the result of a method call.
LocalConnectionService resolves those limitations:
- The 40KB limit: LocalConnectionService allows for unlimited data to be sent in each request at up to 20MB/s!
- One-way communication: LocalConnectionService enables any method call to return a result (of any size) dramatically simplifying code.
The project has been carefully constructed to operate just like any native Flex WebService or RemoteObject. Use it in an Actionscript-only project or drop it into any MVC architected Flash Platform application.
Neat use case ideas:
- Use LocalConnectionService to create palette window! Just open a browser pop-up with navigateToURL(), connect to the .swf inside with LocalConnectionService and use it as if it were part of the main application.
- Create a runtime API to your AIR application.
- Connect to a .SWF running in a browser from a companion AIR application!
To get started, visit our Google Code page at http://code.google.com/p/flashlcs/.
{ 18 comments… read them below or add one }
working just fine!, cool! thx guys
That’s really great! I am interested in using it to to create multi-threaded Flash applications but unfortunately there are no example applications to show how to use the library at the project page. It would be really helpful if there were some real examples not only API documentation.
That’s really cool – already lots of interesting ideas for AIR / Browser integration & multi-threading. Now I just have to come up with a killer feature…
Oh you glorious bastards. I’d just yesterday started on a similar project of my own only for you guys to just now beat me at my own game!
I’m working on a localconnection project that’ll allow an AIR application to edit the copy on a flash site and then save the copy out as an XML file. It worked perfectly until FP10, but then the LocalConnection started crapping out. I was now refactoring the connectivity part as a standalone LC framework, but I guess I’ll give your project a go then
Exciting! Would you post some examples with source?
Great, just popped up last week a need for this in our project.
Thank you.
Very interesting and promising library. I’m going to play with it tomorrow or so. Have to say that intrinsic limitations of LC is often the thing that scares off in favor to ExternalInterface or smth.
One note on the fourth point among use case ideas. Such multi-threading would probably slow down UI in most of the browsers, since they execute all player instances in a single process and are not providing adequate time-sharing mechanism. Chrome would be an exception, of course.
This is freaking rad in so many ways. Great job guys! I might have to port this to one of my projects…
My main concern is that Adobe will do something to circumvent this. It really is genius though, and that’s why I’m worried Adobe will try and shut it down. I mean, I assume they have their reasons for capping the message transfer to 40kb… right?
In any case, great job guys!
This opens up fantastic possibilities, congratulations!
Please comment on the feasibility of backporting it to AS2. I see for example that that request buffers in ClientProxy are ByteArrays…
Addressing security concerns, here is a quote from Adobe on LocalConnection 40KB limit from http://livedocs.adobe.com/flex/2/langref/flash/net/LocalConnection.html:
“There is a 40 kilobyte limit to the amount of data you can pass …….. try dividing the send() requests into multiple commands, each with less than 40K of data.”
That’s exactly what LocalConnectionService does :^)
Backporting to AS2, well …. you’d need to replace ByteArray with a string-based alternative like XML. You might look at our other open-source project; xray, for some tips on how to do this. This project passes XML through LocalConnection in <40KB messages.
http://code.google.com/p/osflash-xray/
http://code.google.com/p/flashlcs/source/browse/trunk/actionscript_only/src/com/blitzagency/rpc/LocalConnectionService.as
Line 160: keepAliveInterval = 1333;
c’mon… you could have made this number 1337 ^_~
Noted! I’ll see if I can fit this into the next release
can you please give some examples of how to use this class – i’m not sure where to start.
thanks,
Josh
We cannot download anymore the source ?
I was curious to see it
Dear Mamzelle,
The flashlcs source is here:
http://code.google.com/p/flashlcs/source/browse/#svn/trunk/src/com/blitzagency/rpc%3Fstate%3Dclosed
The flashlcs SWC is here:
http://code.google.com/p/flashlcs/source/browse/trunk/build/LocalConnectionService.swc
Я думаю, что Вы допускаете ошибку. Могу это доказать. Пишите мне в PM, пообщаемся.
I’ve created a localServiceConnection between two flex applications. All seems fine as I’m able to call function between the two. HOWEVER, I’m not able to call a function from the other and receive a return value. For example, if I call a function that provides a return value (type number) I don’t receive anything.
villmer@lucid.it
{ 11 trackbacks }