I think we(Adobe) have made a mistake in not promoting the core features within Flash Player and the capability within. With so many new developers in the Flash/Flex ecosystem, the secrets within the APIS are largely uncharted water. Having been in the Flash community for over 10 years, I take the APIS for granted while many have yet to see or understand this goodness.
Here are a few examples:
flash.net.Socket
TPC/IP Binary Sockets to allow a browser based applications to connect to any server on any port within the domain based security model. This class allows you to connect Flash Player directory to any TCP/IP based protocol (protocol implementation in ActionScript) like FTP, NNTP, SVN, CVS, XMPP, DNS, TELNET, HTTP, AIM, ICQ, YIM, Etc. With a custom TCP/IP server you can write your own optimized protocol for data exchange (AMF support is included –> See readObject() and writeObject() methods) and support for ZLIB binary compression (see compress() and uncompress()). In many ways this opens the door to connecting the Flash Player and Apollo Runtime to any existing server or port on the Internet and allowing 2-Way push of any data. As the data arriving is binary it opens up many senarios:
XML messages with ZLIB compression.
SWF loading over Socket and using Loader.loadBytes to write binary data to the displaylist.
Writing a browser based instant messaging client that can connect to all existing IM services.
Mass multi-user gaming using custom servers.
flash.printing.PrintJob
Print directly from Flash Player to the Operating System print driver. The user will see a print dialog instantly and you can customize all pages of content easily.
Banner Ad that prints a brochure or coupon directly.
Print custom barcodes and tickets client side.
Take aspects of your application offline using Paper! (See Scrybe for details)
flash.external.ExternalInterface
Talk roundtrip to JavaScript. Flash can subscribe to JavaScript events, JavaScript can subscribe to Flash Player events, Call methods in Flash Player from JavaScript, Call JavaScript methods from Flash Player, and data is handled round-trip. If you want to integrate Flash Player into an AJAX based application, this is the way to do it.
Leverage any Flash Player feature with an AJAX Application (XML/E4X, Binary Sockets, SOAP, PrintJob, Etc.)
Embed Flash Player into a custom EXE and talk to the host application round trip, works with any programming language, C#, C, Python, Etc..
flash.system.Capabilities
Detect lots of system level capabilites of the machine that Flash Player is running on. Detect Accessibility, Language, OS, ColorDepth, Screen Resolution and much more.
flash.display.BitmapData
Capture image data from the DisplayList within Flash Player and manipulate the data using color and imaging APIs. BitmapData allows you to capture areas within an application and manipulate the binary memory image information directly. This is how all the online Flash based image editors work at their core. You can transform a BitmapData object with filters, colorTransforms, and image matricies or directly manipulate the image data on a pixel by pixel basis.
Create an online image editor.
Print high resolution images to PrintJob.
Distort an image using drag and drop.
mx.utils.getDefinitionByName
Obtain a reference to a Class dynamically at runtime and create instances of that class just by name. Like so:
var ClassReference:Class = getDefinitionByName(“flash.display.Sprite”) as Class;
var instance:Object = new ClassReference();
addChild(DisplayObject(instance));
flash.display.Stage
Detect when the mouse leaves the Flash Player instance boundary using the mouseLeave event. Tons of useful stuff there along with detecting resizing of the player or any of the settings on the player itself. Dynamically change the player frameRate, detect focus, height/width, set quality modes, add context menus and more.
There is a mountain of great Classes in Flash Player independent of the Flash Authoring Classes or Flex Framework classes. It is a shame we do not talk about it more and surface all these features that are usable on a majority of computers, 83.5% of them!
The thing is that alone knowing about these classes is not enough but rather the real value is know about how they can be combined to accomplish real work. This is a major gap in the Flash ecosystem and one that I think we need to close. There is no reason why everyone shouldn’t know about all the goodness that exists in the Flash Player today, NONE, ZIP, ZILCH, NADA. This is a problem that can only be fixed by the community who know about all the APIS and their combinatorial value.
More to come.
Cheers,
Ted