Amazing New Feature for Flash 10 – FileReference Runtime Access

I have been consuming all the great additions to Flash 10 this weekend and one that really jumps out after you get past the visual, text and sound features (which are spectacular btw and most of what the community was asking for). But one feature snuck by, this is the one that ByteArray (Thibault Imbert) mentions/pointed out for managing files directly within Flash.

File Reference runtime access — Bring users into the experience by letting them load files into your RIA. You can work with the content at runtime and even save it back when you are done through the browse dialog box. Files can be accessed as a byteArray or text using a convenient API in ActionScript without round-tripping to the server. You no longer have to know a server language or have access to a server to load or save files at runtime.

This greatly lowers the bar to using Flash as a photo editor, document manager, customized application experiences, marking up content and saving locally, all without the need for server side script. I am a big fan of server side technologies and develop with them but even for bettering performance this could be huge.

Scenarios where this might be useful is editing applications, note taking (download a book with your notes), editors for docs/games/3d/textures,,, the possibilities are endless really.

Flash 9 just got mainstream and production ready (flash 9 penetration) at the tail end of last year but there are so many great things in the new version that I hope it comes out very soon. Flash it turning into quite a platform.

Alternativa Platform also has updated their engine for Flash 10 already (they must have had some inside early accessibility to it) and there are great possibilities here.

It is only beta (Flash 10) but there are great market opportunities to prepare for when this launches. Keep your eye on where the puck will be, not where it is currently at. I was concerned when Adobe bought Macromedia and the future of Flash but it appears they are taking this bull by the horns.

If you are ready to play with Flash 10 here is Flex and FlashDevelop updates to help you get started.

Also here is some code posted at ByteArray from Pleh for testing the new FileReference runtime access, usage is extremely simple and rests on this

var data:ByteArray = fileRef['data'];

  FileReference Load Example By Pleh 17/05/08

package {
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.utils.ByteArray;

	public class Flash10Test extends Sprite
		private var fileRef:FileReference;

		public function Flash10Test()
			fileRef = new FileReference();
			fileRef.addEventListener(Event.SELECT, selectFile);
			fileRef.addEventListener(Event.OPEN, openFile);

		private function selectFile(e:Event):void {

		private function openFile(e:Event):void {
			var data:ByteArray = fileRef['data'];
			var loader:Loader = new Loader();

		private function stageClick(e:Event):void{
			fileRef.browse([new FileFilter("All Formats (*.jpg,*.gif,*.png,*.swf)", "*.jpg;*.gif;*.png;*.swf", "JPEG;jp2_;GIFF;SWFL")]);


Flash/Flex Application Proofs: Adobe Launches Photoshop Express

If there ever was a proof that more intense applications like word processors and image manipulation software are capable of being built and some aspects even better than their desktop counterparts with flash and flex then Scrapblog, Buzzword, Picnik and Photoshop Express are that (in fact Photoshop Express is a direct competitor with Picnik it seems…).  

Adobe launches Photoshop Express today to add to that set that are very usable, quality applications built with Flash9/Flex and most of all actionscript 3 (as3) and the new AVM2. These apps just weren’t possible with AS2 and with Flex they can be easily managed codebases (one major problem with old skool flash actionscript is it was throwaway many times because it was so scripter specific and full of optimizations just to barely perform – now these are actual code bases made by programmers and you see the results).  The great thing about buzzword, picnik and photoshop express are that they are easy to use. Flash/Flex make sense in their case and they tend to mimic and use very good usability patterns.There is no way an AJAX app (even though I build lots of those too) can come close to this integration of style, usability and expected results on all browsers.One important point of this article on mentioning this:

The service will go live in beta test mode on Thursday. Mack said that the company intends to use the test period as a way garner feedback from customers.Adobe intends to offer more features to consumers who pay a yearly fee. Some planned features include a printing service, more storage, support for audio and other media, and the ability to read additional image file types (the service works with .JPGs now.)Adobe also plans to build an offline client using AIR (the Adobe Integrated Runtime) so that people can edit photos offline, executives said.

A couple things here.  First there is going to be an AIR version for the same experience on the web and the desktop for a major application.  Second, flash IS limited to certain file types JPG, SWF, PNG, GIF, and a few others for sound and video.  So why an online photoshop is great, it is still only web based photos, simple edits, etc.  Photographers and users above 72dpi in the 300 600 ++ ranges will still be using Photoshop.  Users with EPS,RAW, etc will still have to use Photoshop until Adobe figures a way to either proxy an image and handle the real source (be it another format) behind the scenes.  Or, improve the flash player to handle other raster and vector image types.A project a while back we had this issue where it was a approval system of media types but the types could be PDF or EPS in addition to web image formats or on occasion other formats and it became a challenge where the content was marked up with flash.  Eventually it was in a div overlay so we could load in the unsupported types behind and sync them with javascript, where flash was just a canvas or screen on top to put notes and markings.  But when it comes to editing that is different, you expect to edit. Also, working with the real source in image manipulation is extremely important so a proxy to the real image seems unlikely a good choice except for simple web uses.In any case, Photoshop Express is a great web based image tool but there are limitations that prevent it from taking any large swath of share from the normal old desktop Photoshop any time soon.

Adobe AIR 1.0 and Flex 3 Launched Today


AIR 1.0 and Flex 3.0. have launched.

AIR is finally 1.0 and live as well as Flex3, both launched today. That is quite a 1-2 punch.  These are both great technologies and AIR extends the reach to the desktop and lots of power with that being finally 1.0 and officially launched.  It has been hard to convince people to develop on it other than tech demos and prototypes, this should help.

Ajaxian has the run down: 

Adobe AIR

The AIR runtime and SDK has gone through an especially long beta cycle (since June 2007) to ensure that both security and compatibility with existing frameworks was achieved. Some key new and/or updated features include:

  • Enhanced Desktop Fucntionality: Drag and drop to the operating system, copy and paste between applications, launching of AIR applications from the desktop or the browser, and run in the background with notifications.
  • Data Access: Adobe AIR now provides both synchronous and asynchronous access to the local file system, as well as structured data within a local database. This database is implemented using the open source SQLite database.
  • JS Library Support: Most major Ajax frameworks can be used to build AIR applications. Supported frameworks include jQuery, Ext JS, Dojo, and Spry. Adobe AIR integrates JavaScript and ActionScript to allow cross-scripting between the two languages, and integrated rendering of Flash and HTML content.
  • Security: Applications built on Adobe AIR can only be installed through a trustworthy install process that verifies that the application is signed via industry standard certificates, providing users with information about the source and capabilities of the application.

Flex 3.0

Adobe’s Flash-based RIA development platform, Flex, continues to mature and has been picking up steam in both the corporate space as well as sites such as blist and Scrapblog who have embraced Flex whole-heartedly. Some of the new features in Flex 3.0 include:

  • Intelligent coding, interactive step-through debugging, and visual design of user interface layout
  • New capabilities for creating RIAs and building applications on Adobe AIR
  • Integrates with Adobe Creative Suite® 3 making it easy for designers and developers to work together more efficiently.
  • New testing tools, including memory and performance profilers and integrated support for automated functional testing, speed up development and lead to higher performing RIAs.

One of the most compelling parts of the Flex announcement is the fact that Adobe has released the Flex SDK under the open source Mozilla Public License.

AS3 Cryptography and Hashing Libraries for Encryption and Security (crypto)

AS3 libraries for crypto are pretty robust from the new RAW POWER in the AVM2 virtual machine that runs flash9/as3, cryptography, like compression, is very processor intensive and needs a fair amount of power to be worth the time (usually a balancing mechanism). I am working on a few security apps in AIR and Flash9 for a project and a product so this is the best of what I have found to share. I will be sure to post here when these projects are complete.

There are two that are pretty good as3 kits that have decent support for crypto and hashing, actually as3crypto is quite broad in their support or most common crypto algorithms, even hashing support up to SHA-256 and ciphers 3DES, AES, RC4.

This is not really a comparison just some kits that have tools you might need. as3crypto is definitely the way to go for more heavy ecryption with common ciphers, but if you are just hashing some text as3corelib might work for your project. as3corelib is a more broad toolkit that is made or sponsored by Adobe that has JSON, RSS, support and other tools. It is a great core lib, but not as deep in the encryption area. I am actually using both in the stuff I am working on, as3corelib for some other uses (JSON,RSS) and as3crypto for all encryption and hashing.

The two are:

  • as3crypto
    • Robust, broad encryption and security support
    • Open source
    • Demo
    • Browse source
    • Broad support of algorithms
        • TLS 1.0 support, exposed through TLSSocket and TLSEngine classes
        • X.509 Certificate support, including parsing, and validation
        • built-in list of common root Certificate Authorities
        • symmetric ciphers: AES, Blowfish, DES, 3DES, XTEA, RC4
        • confidentiality modes: CTR, CBC, CFB, CFB-8, OFB, ECB
        • public key crypto: RSA (encryption, decryption, signing, verifying and key generation)
        • padding: PKCS#1 (type 1 and 2), PKCS#5
        • BigInteger library
        • hashing function: SHA-256, SHA-224, SHA-1, MD5, MD2
        • HMAC support
        • prng: TLSPRF and stream-cypher-based PRNG.
        • minimal ASN-1/DER support for PEM key parsing and X-509 cert parsing
        • Crypto – Shortcut class to access many classes above.
        • Hex, Base64 – Static methods to convert binary data to and from text formats

As3 Crypto is a cryptography library written in Actionscript 3 that provides several common algorithms, as well as TLS 1.0 support. The library is offered under the BSD license, and include several derivative works from Java, C and javascript sources.

Here’s some numbers from as3Crypto home page that show the speed, note it has not been optimized just yet (since most of this is client side and only one user would be using it this is not an issue – server side is where this can have scale problems from parallel execution but flash is rarely server side if it is too slow, but it is quite fast)

The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
md2                  1.01k        3.64k       15.08k       53.89k      171.76k
md5                221.85k      447.32k      739.54k      893.72k      905.82k
sha1                82.28k      184.78k      286.76k      336.03k      345.41k
sha224              60.84k      125.67k      200.27k      234.28k      247.58k
sha256              60.52k      126.30k      199.19k      234.04k      246.01k
hmac-md5            48.37k      159.37k      282.87k      295.15k      341.21k
hmac-sha1           18.29k       64.82k      165.72k      277.60k      342.52k
hmac-sha224          5.75k       24.84k      125.71k      204.35k      256.36k
hmac-sha256         15.10k       49.33k      123.71k      206.17k      249.08k
rc4                117.24k      381.34k      878.93k     1315.01k     1539.44k
xtea-cbc             2.49k        6.48k       12.80k       33.00k       44.48k
aes128-cbc           1.61k        4.01k       22.97k       78.55k      205.01k
aes192-cbc           1.34k        5.13k       20.91k       69.45k      172.43k
aes256-cbc           1.48k        5.63k       18.87k       63.45k      150.39k
blowfish-cbc         2.77k       10.81k       42.28k      140.27k      343.05k
des-cbc              2.53k        9.73k       35.20k      124.84k      624.88k
3des-cbc             2.50k        9.72k       35.61k      115.21k      253.42k

The library has not been optimized for speed, and those numbers could probably be improved.

They both have minimal or none ASN.1 support which I will need but I can port much of this from my favorite Java/C# crypto kit from the legion of the bouncy castle of which I was happy to find was a substantial base for this kit.

Whatever you do don’t send any type of message from your crypto kits with aes 256 cipher and sha-256 hashing to Iran from the US. 🙂

Sandy3D and Red5 Server Attack! – Sandy 3.0 Final Released for AS2 and AS3

Sandy 3.0 was released today. To go along with that a RedSandy (Red5 and sandy demo) has also been released. Sandy is the original 3d flash engine that was around before Papervision3D and Away3D and all the others. Sandy3d is an excellent library and it has many features that others do not have well particularly in the easier control of objects and importing all types of files such as ASE, WRL and 3ds in addition to COLLADA which other 3d engines like PV3d and Away3d support although it has been slower in the past 3.0 may change that.

Sandy 3D engine main features are :

  • Flash player 7 to 9 compatibility.

  • Both MTASC and Macromedia compilers compliant for AS2 and Flash CS3 and FlexBuilder for AS3 versions.

  • Several 3D primitives, allowing fast and parameterized object creation without any 3D modelisation knowledge.

  • Advanced and easy object management allowing some fantastic possibilities during your creations (scaling, rotation, translation, tween, etc.)

  • Advanced camera management ( rotation, motion on linear or bezier-curve path, movements, etc.)

  • Complex object loading thanks to the .ASE and .WRL files parser , but also Collada and 3DS files for AS3, (files generated by several 3D object modeling packages such as 3D Studio Max or Blender)

  • Material system to easily change your objects appearance. Several material are available allowing to create transparent faces, bitmap texture and video texture as webcam video stream.

  • Managment of Flash filters bringing some very nice visual effects

Red5 is the best multi-user media server out there right now and it is built with Java.

The cool and probably most interesting part is Sandy combined with Red5 to create multi-user environments in 3d for flash. There have been experiments with this and many attempts at this and is being done but an open source kit that does this is very helpful and these are two great flash toolkits in Sandy and Red5.

Get your game on!

Getting started video with Sandy 3.0 with a wise robot

Good Usable RIA Applications in Flash and Silverlight

Flash and Silverlight allow developers to make amazing tools, they allow creative expression and they also are usually a bad user experience many times.

Lots of that is changing as more applications are made and frameworks like Flex and Silverlight progress. Much of the needed performance is now available for Flash/Flex in AS3 and the AVM2 virtual machine that runs it, making full applications much faster for all actions that might have been a drag in AS2 and vector based application’s of the past. Some great tools were made with this still that were usable like gModeler a flash based UML modeling tool but the performance boost will make these applications even more usable for mainstream.

Some great examples of user friendly apps where the flash or the silverlight element doesn’t blind the developer from usability. These applications might really have a market for general users of applications from advanced depending on feature set as long as they are usable.

buzzword (Flash/Flex/AS3)

Is a word processor that is really well done. This is made with Flex and everything from validation to the toolset is very usable and clean. I use Google Docs and haven’t looked back for about a year but this application is a nice change to web editors for documents at the current state. It included all the usual basic functionality and great new zoom, revision history and sharing tools that web office tools like word processors has come to expect. Be sure to try this one.

scrapblog (Flash/Flex/AS3)
scapblog is a bloggy/presentation that is a great template editor and the tools are broad and expected from users including great integration with the web for photos and video at major sites such as photobucket, flickr, etc.

Google SearchMash (Flex/Flash/AS3)

This is a Flex 2 (actionscript 3) application that is very fast and usable in vector.

Sample Textured 3d Vista demo(Silverlight 1.0)

This demo showcases the speed of Silverlight and a usable OS like interface that performs well. It showcases Silverlight but also has great usability in expected user actions and results.

tafiti (Silverlight 1.0 demo)

Tafiti is a search tool that uses SIlverlight and live search to represent search results in a rich way. They did a pretty good job with usability and especially considering the Silverlight 1.0 lack of good input controls. Little bit laggy.

The point is solution developers should use technology but most importantly make it functional and usable to what users expect. RIAs will succeed very well as long as you can select text, hit back buttons, deep linking, use menu systems, integrate services, have all the features of apps not in vector engines like Flash or Silverlight and to make it mainstream friendly they need to have a low bar of entry and just work. RIAs have an advantage right now as office apps move to the web and photo apps as well, many of these apps above would appeal to general computer users in addition to advanced users.

Adobe AIR Apps Starting to Appear

Adobe AIR apps are starting to pop up more. After the Grant Skinner AIR app for it appears Kevin Rose has launched pownce which is a twitter/email/friend/social sharing site/service. The desktop app for is built with AIR. I believe AIR will really take off with these types of apps succeeding on it. Pownce is only alpha but it is hard to see it not being successful with the amount of digg users that will spill over.

Pownce (you have to be invited to private alpha)

Other apps for AIR so far that are usable and ready:

Competitor to I wonder how long til a air app.

Digg Desktop Widget (from Adobe sponsored digg API contest)

Other AIR apps can be viewed here including kuler, a twitter app and more. And also here at Rob Christensen’s blog.