Gaia 3.2.0 Available Now

January 11th, 2010 by Steven Sacks

Gaia 3.2.0 is now available for download.

Gaia 3.2.0 updates to the latest 3rd party packages, including TweenLite, SWFAddress, and DeMonsterDebugger. In addition, I fixed a bug that was preventing page swfs from potentially not unloading correctly, and a bug with SoundGroup when using fadeTo() without a callback.

Posted in Gaia having 1 comment »

Flash Socket Class Does Not Wait For Flush

December 8th, 2009 by Steven Sacks

Update
Flash Player Team has confirmed the documentation is wrong. Data is sent as soon as you write to the Socket. In other words, flush() has no purpose.


Flash's Socket class documentation says the following:

flush() method
Flushes any accumulated data in the socket's output buffer. Data written by the write methods is not immediately transmitted; it is queued until the flush() method is called.

However, this is simply not true. A basic test proves the true behavior of the Socket class.

The moment you write to a connected socket, it sends the data and the server receives it. You do not need to call flush(), and, in fact, calling flush() has no effect as far as the server or Flash is concerned. The documentation is not just misleading, it's exactly the opposite of the real behavior.

The socket automatically sends as little as 1 byte. socket.writeByte(0) is immediately sent across the socket.

In direct opposition to the documentation for Socket, data is not queued, it is immediately transmitted across the socket. Calling flush() does nothing. The data is already sent. There is absolutely no difference from the server's perspective whether I call flush() or not, and I can write millions of bytes on a Socket and never call flush() and there is no negative effect as far as all testing I have conducted has been able to show.

Flash sends data across the Socket in 536 byte packets. Anything larger than 536 bytes gets split into separate packets. So, if you send 537 bytes, Flash sends two packets, one that's 536 bytes and one that's 1 byte.

The internal limit that Flash can send via Socket appears to be 524,744 bytes. If you set up your server to not read off the socket, 524,744 bytes is the point that Flash's socket becomes blocked. However, Flash does not let you know that the Socket is blocked or that there are any bytes sitting on the Socket unsent.

This behavior is exacerbated by the fact that there is no way to track progress on Socket sending, only receiving. There is no event that fires if you're blocked, and you have no way of knowing that the server did not receive your entire transmission unless you have some kind of expected response that you did not receive within a certain time limit, which is not something you can reliably measure considering latency and/or varying bandwidths, and the fact that you have no idea how much data the server has received.

If you send 1,000,000 bytes and set up your server to wait until you send 524,744 bytes to read it, Flash does not even need you to call flush() to send the remaining 475,256 bytes, it happens automatically. No flush() required, and you don't even know that the Socket was blocked.

It's worth pointing out that if the server has a receive buffer (we set it to 8040 bytes), Flash does not honor it when running in the IDE, running as a SWF in the debug player on the desktop, or in AIR. It only honors it when it's running in a browser (tested in Chrome, Firefox and IE on Windows). Regardless, Flash does not report that only 8040 bytes were sent, and, again, flush() was not called but the bytes were sent anyway.

The behavior is identical whether you use socket.writeByte() and write 1 byte to the socket at a time, or use writeBytes() and write all the bytes to the socket at once.

FileReference lets you track progress on a HTTP Socket POST of bytes. I don't know why they still have not given us progress on the Socket sending, and I also don't know why the Socket doesn't wait for you to tell it to upload, like the documentation says it does.

As far as any Actionscript code you can write is concerned, every single byte you write to a socket is sent instantaneously. I can watch my network and see bytes as they're being sent, but according to my code's behavior, I can transmit gigs of data across a socket instantly. I tell the Socket to send it, and the Socket basically behaves as if it's a synchronous event and every byte has been sent. Obviously, there is a good reason for this behavior (not locking up Flash for Socket transmissions), but there's no good reason to not inform me of the progress.

It's bad to assume that all the data on the Socket was sent instantly. It's also complicated by the fact that Flash doesn't wait for me to call flush() before sending data.

I would appreciate anyone from Adobe or anyone else who has more information on Flash's Socket behavior, and I'm also curious why the documentation for Socket has been incorrect for years now and nobody has pointed it out.

More importantly, how long until we can see progress of bytes sent on a Socket?

Posted in AS3, Actionscript, Flash, Rants having 10 comments »

FITC Toronto: Gaia Framework for Adobe Flash video

September 26th, 2009 by Steven Sacks

The video from my Gaia Framework For Adobe Flash presentation at FITC Toronto this past April is now available on Adobe TV.

Enjoy!

Posted in FITC, Gaia, Presentations having 4 comments »

Gaia 3.1.7 Released

September 3rd, 2009 by Steven Sacks

Gaia 3.1.7 has a bunch of improvements.

You can now set a version for your site to force reloading of swfs. You can set domain in the site node for the entire site so you don't have to do it on a per page basis. The Pages class now has every page in the site.xml. setPreloaderDelay now works with the asset preloader. afterComplete no longer takes a hijack argument. The DeMonster Debugger class is now distributed with Gaia. SWFObject has been updated to 2.2. Thunderbolt has been updated to 2.2. The event metadata had incorrect class paths. Gaia header comments have been removed from scaffolded page classes. Finally, on Windows a FlashDevelop project file is automatically generated when you create a new project.

Posted in Gaia having no comments »

Adobe MAX 2009: Two Gaia Sessions!

September 2nd, 2009 by Steven Sacks

Adobe MAX 2009 is right around the corner and I'm extremely excited for it. Aside from the fantastic opportunity Adobe MAX provides to see the newest advances with the software we use to make a living, learn new skills at the labs and presentations, network, and hang out with old friends, this year I am happy to announce that I will be presenting two Gaia sessions at Adobe MAX 2009 in Los Angeles.

One is an Adobe MAX Lab and the other is a presentation for the FITC Unconference at MAX.

Here are the details:

Gaia Framework for Adobe Flash: Revolutionizing Your Workflow
Wednesday, October 7th – 11:00am – Room: 518 – BYOL Lab
I am teaching a hands-on lab that will introduce Gaia's pragmatic approach to developing with Flash and get your feet wet with real-world examples. In this 90 minute lab, we'll be covering the fundamentals of Gaia development and best practices. Sign up while there are still seats available. This is a BYOL (Bring Your Own Laptop) lab.

Advanced Tips and Tricks with the Gaia Framework
Monday, October 5th – 11:30am – FITC Unconference Room
I am also giving an advanced Gaia presentation at the FITC Unconference at MAX 2009. In this presentation, I will be digging in and demonstrating how to leverage some of Gaia's more advanced features, such as Event Hijacking, Sound Groups and Custom Assets. You'll learn how Gaia makes it easy to develop specialized transition control, mp3 players, render strict XHTML in Flash using Gaia's runtime font loading, SEO and StyleSheet assets, as well as how to create your own custom assets using Gaia's extensible architecture.

If you haven't purchased tickets, now is the time to do it because the early bird tickets are only available until September 18th. MAX is taking place in sunny Los Angeles, CA this year, and the attendance is expected to be bigger than ever!

If you've never gone to MAX and you're on the fence, you definitely should consider going. In addition to the conference during the day, it's an extremely fun time at night. The parties are a blast and you meet a ton of great people. If you've already been, well, you already know!

Can't wait to see you there!

Posted in Adobe, Flash, Gaia, MAX, Presentations having 4 comments »

De MonsterDebugger 2.0.4 now works with Gaia

August 27th, 2009 by Steven Sacks

The popular De MonsterDebugger now works with the Gaia Flash Framework (AS3).

Detailed instructions on how to integrate it with Gaia can be found in the De MonsterDebugger help panel.

The upcoming Gaia release will include full integration for this popular debugging tool!

Posted in AS3, Adobe, Flash, Gaia, Tips/Tricks having 1 comment »

Gaia Framework 3.1.6

July 19th, 2009 by Steven Sacks

Gaia 3.1.6 adds SEOAsset innerHTML support to AS2, a gettable index property for SoundGroup, and fixes a bug with the panel's update file bytes in xml feature.

Posted in Uncategorized having 1 comment »

Flash CS4 10.0.2 OSX Bug with Expose

May 22nd, 2009 by Steven Sacks

10.0.2 is an awesome update. It adds stability, improves performance, and added a JSFL command to publish an .fla without opening it.

Unfortunately, I just found a bug with Expose that I can replicate every single time.

Create or open an .fla file.
Create or open another .fla file.

Expose. Everything is fine.

Click on the tab for the first .fla.

Expose. Flash is broken into pieces.

Click on the tab for the second .fla.

Expose. Everything is fine.

This is reproducible 100% of the time.

If you open multiple .fla files and you have any tab other than the first one selected, Flash is broken with Expose.

Posted in Bugs, CS4, Flash having 7 comments »

Gaia 3.1.2 – Runtime Font Loading, ByteArrayAsset and more!

May 13th, 2009 by Steven Sacks

Gaia 3.1.2 has some awesome new features, including Runtime Font Loading (AS3), the new ByteArrayAsset (AS3), the ability to set the preloader delay, adds a missing function in IStyleSheet, panel performance optimization, and the ability to deauthorize the panel.

Runtime Font Loading allows you to easily access dynamically loaded fonts in any page or swf asset in your site.

The new ByteArrayAsset enables you to load raw bytes into Gaia. One use is to load in Bitmap or swf assets and create multiple instances of them from the same bytes.

The Gaia panel performance has been optimized to drop the framerate down to 0.1 when inactive, and only run at 10fps when active. You can also deauthorize the panel in case you buy a new computer or reinstall your operating system.

You can read more in the official release notes: http://www.gaiaflashframework.com/index.php/topic,1808.0.html

Posted in Gaia having no comments »

AIR Tight – Adobe AIR Mailing List

April 24th, 2009 by Steven Sacks

Apollocoders is a dead mailing list. Nobody posts there anymore. It's moderated and I've waited days for posts to show up. Stick a fork in it, it's done.

Introducing AIR Tight, the new Adobe AIR mailing list, a la Flashcoders/Flash Tiger.

Sign up now!

http://groups.google.com/group/air-tight

Posted in AIR having 1 comment »

About Steven Sacks

I am a professional Flash developer with over 13 years of programming experience. I have consulted for high-profile agencies and companies in San Francisco, Los Angeles, Atlanta and New York, and developed numerous award-winning websites and rich internet applications for clients including Adobe, Fox Sports, FX Networks, Anheuser-Busch, GE, DirecTV, ESPN, The Weather Channel, Home Depot, and Coca-Cola.

I am the author of the open-source Gaia Framework for Adobe Flash, which dramatically reduces development time and makes developing Flash sites much easier.