Category Archives: Flash

C/C++ running in Flash Player

Probably one of the biggest things to happen to Flash….maybe ever. Last year at MAX Adobe gave us a sneak peak at a research project that took C++ code and compiled it into ActionScript. The demo they showed at the sneak peak at MAX 2007 of Quake running inside Flash Player. This got a lot of buzz. Well now they have released the toolkit (Alchemy) to the community. So you can go and start converting your favorite C/C++ libraries to ActionScript.

I’d personally like to see some XSLT and XML Schema libraries ported. And I’m sure there will be a lot of ports of physics and 3D libraries too.

Peer-to-peer Communication With Flash Player 10

You probably didn’t notice that Flash Player 10 (and AIR 1.5) shipped with a new protocol for p2p (peer-to-peer) communication. The RTMFP (Real-Time Media Flow Protocol) is a new protocol that supports direct connections between two endpoints.

What is the benefit of p2p communication? This will lower the barrier to entry for people to create real-time applications in Flash Player and AIR. No more bandwidth and server management expenses. The RTMFP protocol will also be a higher quality connection since it is over UDP and not TCP like the RTMP (Real-Time Messaging Protocol) used by Flash Media Server. RTMFP will re-establish a connection if there is a brief outage and maintain a session even if the client’s IP address changes.

This new protocol could be used for a number of applications like: text chat, VoIP conversations, video chat or multi-player games/applications.

Adobe announced Stratus the week. The is a hosted rendezvous service that allows two endpoints to establish a p2p connection. Once the connection is established the service is no longer used to send the data between endpoints. Stratus is currently in beta, but is not yet available for developers to start playing with it.

You can see a few of the RTFMP details in the ActionScript 3 Language Reference (see NetConnection).

AIR Distribution Kit

Tomorrow at FlashBelt I’ll be giving a presentation on Installation and Distribution Strategies in AIR. Since AIR applications are built using web technologies like JavaScript and ActionScript, many of the AIR users aren’t used to thinking about the installation and distribution strategies that desktop applications require. My presentation will cover a couple of these issues and show some sample solutions to these problems.

I’ll also be announcing the AIR Distribution Kit open-source project. This is a ActionScript 3 library for creating update functionality within AIR applications and for creating custom browser-based install applications (otherwise known as install badges). You can see more information about this project on my labs page. I just started this project, so there might be some bugs. Check it out and let me know what you think. Please let me know if you see anything you wish working differently or what features you’d like to see added in the future. If you’re interested in assisting with the development, please contact me.

Compiling XML Data into your SWF

Have you ever wanted to actually compile XML data into your SWF before? I wanted to do this to embed the build version into my Flex appliction. The version was stored in an XML file and updated during the build process. But I wanted the version to actually exist inside the SWF in order to decouple the depandancy on the external XML file at runtime. This way I don’t need to worry about the XML file not loading or getting seperated from the SWF. The version will always be there. Here is a simple example doing this in Flex.

Continue reading

MN.swf Camp Sold Out

MN.swf Camp sold out in less than three days. We had to limit the attendees to 100 because of space limitations, however, we are currently exploring other venue options. If we can secure a larger venue then we will reopen registration. I suggest you sign up for the mailing list on the conference home page so you can be alerted if registration opens again.

MN.swf Camp is a one day conference in Minneapolis focusing on the Flash Platform for programmers. Its being organized by the MN.swf User Group and FlashBelt.

GZIP-Encoded HTTP Response in Adobe AIR

A common way to reduce the size of data returned over HTTP is to allow the web server to use a GZIP compression on the data. When making requests in a Flash/Flex application hosted in a web browser, the browser actually uncompresses the GZIP-encoded data before its delivered to Flash Player. Therefore, Flash/Flex developers don’t need to worry about GZIP-encoded data since its handled seemlessly behind the scenes. However, when writing an application in AIR, there is no browser to handle the GZIP compression and AIR 1.0 doesn’t have this built-in. (I assume they will add this in a dot release at some point.)

But there is a way to do it manually. The ByteArray in AS3 supports DEFLATE compression. However, you must first remove the header in the GZIP data for this to work properly. In my case, I was making a web service call using the WebService class in Flex. Since I actually needed to get at the raw binary GZIP data returned by the server, I had to change my code to use the low-level URLLoader class that is built-in to Flash Player.

Continue reading

Adobe to Open-Source Remoting Code

Adobe just anounced its plans to open-source the remoting and messaging code found in Live-cycle Data Services.  The new project is called BlazeDS and is deployed as a J2EE application.  This is really huge.  There are many non-adobe or open-source projects to handle AMF remoting including classics like OpenAMF, but most don’t support AMF3 yet or are still in beta stages.

Along with this open-source project, Adobe also released its AMF3 specification.  This should allow the community to develop AMF3 solutions for other languages and platforms.  This is really great news for everyone and helps to move the AMF3 specification closer to mainstream.

Flash Player 9 Update 3 Beta supports H.264 Video!

Flash Player now supports H.264 (mpeg4)!  Flash video just got a major kick in the pants. You can actually load .mp4, .m4v, .m4a, .mov and .3gp files using the same ActionScript API that you currently use to load FLV files.  All existing code should now work with these new files formats.  If your video player is run off dunamic data you should be able to just start dropping in quicktime and mpeg-4 files.  Crazy!

A new version of FMS is coming out soon with streaming support for these file formats.

Check out this post by Tinic for a very detailed explination of what the update includes.  I guess it was planned for Flash Player 10, but they got it in this newer version because customers really wanted it.

Speaking at FlashBelt

I’m once again speaking at FlashBelt this year.  I’ll be speaking on the topic of E4X, the new technology for working with XML in ActionScript 3.  I gave a talk on XML at FlashBelt a few years ago and talked a bit about the future of XML in ActionScript including E4X.  Well, that future is finally here.

Patterson Consulting is also a development sponsor of FlashBelt this year.  Its a great conference and I’m glad to be able to participate.  See ya there!

Apollo Released on Labs

Apollo is the new cross-platform runtime from Adobe that allows developers to create desktop applications using Flash Player, HTML/JavaScript, and PDF technologies.

This release on Adobe Labs marks the first public pre-release for the Apollo product. Its an alpha release that means it is not full-featured. But the core Flash capabilities and some native OS integration is available.

Developers used to working with Flex in FlexBuilder can install the Apollo extensions for Flex Builder. This allows you to quickly create a Apollo project. This makes it very easy to build and compile an Apollo application.