Adobe Opens Flash Format Specifications for SWF, AMF and Flash Video FLV (Open Screen Project)

Adobe is taking the inside lane in the industry it seems with the Open Screen Project. What does this mean? It seems like SWF and FLV formats are now largely open and licenses removed. With the XFL format possibly on its way (probably based on mxml) to replace closed .FLA files it is pretty clear that Adobe and Flash will see a large uptick in the mindshare. As well as looking to create a broader mobile platform for the flash player.

The Open Screen Project will address potential technology fragmentation by enabling the runtime technology to be updated seamlessly over the air on mobile devices. The consistent runtime environment is intended to provide optimal performance across a variety of operating systems and devices, and ultimately provide the best experience to consumers.

To support this mission, and as part of Adobe’s ongoing commitment to enable Web innovation, Adobe will continue to open access to Adobe Flash technology, accelerating the deployment of content and rich Internet applications (RIAs). This work will include:

  • Removing restrictions on use of the SWF and FLV/F4V specifications
  • Publishing the device porting layer APIs for Adobe Flash Player
  • Publishing the Adobe Flash® Cast™ protocol and the AMF protocol for robust data services
  • Removing licensing fees – making next major releases of Adobe Flash Player and Adobe AIR for devices free

This is big. It has mutiple prongs. Adobe would like to make Flash a common mobile standard, hrm no Apple on this list (it is probably a slight move there against that).

Adobe would also like to continue their lead of web video. And they finally are recognizing the closed format of SWF is not as desirable as an open one, there is still considerable control for Adobe over the player. But they get insights and contributions from many large companies to help make it work on their platform, engraining the format further. The providers, especially mobile and internet tv, will want to provide good user experiences to compete with the iPhone and regular T.V. respectively. Flash being open helps both of those markets.

Adobe is also moving further to open source key formats and technologies like the recent Flex 3 SDK and now the AMF format which was a roadblock. This is probably good news for servers like Red5 and also many other media servers and remoting services in many more place. AMF is particularly nice because it is a binary, extremely compact and limited bloat format. Without it being open it loses much of its benefit as a standard. Being open and a further crunching from the XML bloat services, this can be very good for many reasons such as throughput and faster services, apps and games with remote data.

Another reason is the desktop market. They want Flash to work flawlessly on Linux but they don’t’ have the manpower for a 2% market share. So this is a very smart move for the desktop players (AIR, and Linux Flash).

The only thing that partially makes it scary is the line up, Sony, Verizon, etc. As long as these are contributors and not partners in DRM crime then we have something. Hopefully they are in it to make better entertainment and mobile platforms cheaper.

Being able to peer into the code and a move to allow better open integration makes it a better platform, where better stuff can be built on top of that. Let’s hope it is done right. Everyone is making Apple look really closed and locked down lately.

A Peek into the AS3 and AVM2 Virtual Machine and ‘Elastic Racetrack’

PyAMF 0.3 Released and Sample on Google App Engine

A great Action Message Format (AMF) remoting kit for server side for the pythonistas is pyAMF, they recently released PyAMF 0.3 and have a sample running up on Google App Engine. There is also a tutorial for getting PyAMF running on Google App Engine. Aral Balkan got this running as well.

Features of pyAMF currently:

More on the PyAMF library:

AS3, Convert Python Code to Flex AS3 with flex-pypy

I have officially been sucked into the Python vortex. I recently have really been digging IronPython, Jython and good old plain Python but have not ventured here yet. Google (They employ Guido), Microsoft (IronPython) and Sun (Jython) are all becoming infected pythonistas as well. But this is just too cool, Python to AS3 code with flex-pypy. This project is very young but could be fun, source at Google Code.

Haxe has a similar premise where it can compile to Flash6-9 versions of actionscript 2-3 which makes for a system with better reach. Python code for this is lots of fun and very flexible. Python is becoming a baseplane language and one great language for transcending platform lock-in.

Check out this snippet pulled from here (click to see sample game)

#/usr/bin/env python
"""
This simple example has very little to do with the pygame
chimp example, except that it will act the same (more or less)
and it uses the same resources, only they got converted to
mp3s, pngs.
"""

#Import Modules
from pypy.translator.flex.modules.flex import *

class MyRect:
    def __init__(self,x,y,w,h):
        self.x, self.y,self.w,self.h = x,y,w,h

SCREEN_W = 468
SCREEN_H = 60

class Game:
    def __init__(self):pass

    def init(self,screen):
        self.screen = screen
        screen.layout = 'absolute'
        screen.setActualSize(SCREEN_W, SCREEN_H)

        screen.addEventListener('mouseMove',mousemotion)
        screen.addEventListener('enterFrame',do_loop)
        screen.addEventListener('click',chimp_whip)

        self.bg = load_sprite("py_background_png");
        self.screen.addChild(self.bg)

        self.chimp = load_sprite("py_chimp_png");
        self.screen.addChild(self.chimp)

        self.orig_y = self.chimp.y

        img2 = self.fist = load_sprite("py_fist_png")
        self.screen.addChild(img2)
        img2.move(400,img2.height/2)
        self.move = 1
        self.spin = 0
        self.hit = 0
        self.hit_move = 1

        self.sfx = {}
        self.sfx['whip'] = load_sound_resource("py_punch_mp3")
        self.sfx['nohit'] = load_sound_resource("py_whiff_mp3")

    def loop(self):
        img = self.chimp
        if self.spin:
            self.spin -= 1
            img.rotation = self.spin*24
        else:
            img.x += self.move * 8
            if img.x > SCREEN_W-img.width:
                self.move = -1
            if img.x < 0:
                self.move = 1

        if self.hit:
            self.hit -= 1
            self.fist.y += 6 * self.hit_move

            if self.hit  SCREEN_W - img_halfw:
        newx = SCREEN_W - img.width
    if newx  img.x and e.stageX < img.x+img.width:
        game.sfx['whip'].play()
        game.spin = 20
    else:
        game.sfx['nohit'].play()

def flash_main( x=1 ):
    game.init(castToWindow(x))

Moock Mentions XFL for Open Flash IDE Source Formats

Colin Moock an actionscript brain since the great Flash 4 advances that brought all sorts of fun to flash, like games, has mentioned XFL an open format for flash from a discussion with Adobe product managers.

This would be a format that would be able to import, export and allow compile to SWF. MXML for Flex does this now but bringing the two together into one common format and allowing for all sorts of open source and third party contributions to making flash will let it literally explode in support.

I recently met with Flash authoring product-manager, Richard Galvan, to talk about Diesel, the next version of Flash (i.e., Flash CS4, or version 10 for those counting). Adobe has already demonstrated a bunch of high-impact features for Diesel, including inverse kinematics, a new tweening model, 3D “postcards in space”, and advanced text components (see MAX 07 keynote, FOTB 07 keynote, and FITC Amsterdam 08 keynote). But Richard was keen to talk about a lesser known feature quietly percolating behind the scenes: XFL.

Since its inception, the Flash authoring tool has stored documents in a binary source-file called .fla. Historically, interchanging source with the Flash authoring tool has been virtually impossible for third-party software because the specification for .fla has never been public. But things are changing in the next version of Flash. Flash CS4 will be able to export *and* import a new source format called XFL. An XFL file is a .zip file that contains the source material for a Flash document. Within the .zip file resides an XML file describing the structure of the document and a folder with the document’s assets (graphics, sounds, etc). The exact details of the XFL format are not yet available, but Richard assures me that Adobe intends to document them publicly, allowing third-party tools to import and export XFL.

If this is a market test or check of interest I think that everyone I know working with flash would be very excited about opening and unifying the flash format and allowing great IDEs and tools to help produce better flash content more quickly. Also, with the competition Silverlight using XAML (uncompressed) this also allows a competitive advantage maybe making Silverlight add better compression and loading tools beyond their downloader object.

I hope this is also in the plans for Director. If they used similar formats it could be very nice and something to watch as an emerging market to prepare for.

Read the full post at moock.org

A Take on Flash on the iPhone by Daring Fireball

Flash not being on the iPhone yet is quite telling of the type of company battles going on. I like what Apple produces many times but they love a locked down environment more than Microsoft, in fact Microsoft seems like an open company and open market that is for sure compared to Apple. I am starting to think it will not happen, Flash on the iPhone. I have to boycott the iPhone for the type of closed environment that only non-developers can love. There are certain technologies, open or not, that become base technologies that create a platform of commonality to even make a market possible, the mobile market seems to be doing everything to not let that happen.

Daring Fireball (John Gruber) has a good take on the situation.

There are currently two ways to develop software for the iPhone (and iPod Touch): using HTML/CSS/JavaScript web standards, and using Cocoa. Cocoa is proprietary, but from Apple’s perspective, it’s the good sort of proprietary: a competitive advantage completely owned and controlled by Apple. Apple doesn’t control the HTML/CSS/JavaScript web standards, but neither does anyone else. And Apple does control and own WebKit, which is by anyone’s measure the best mobile implementation of these standards today.

Flash, on the other hand, is (from Apple’s perspective) the wrong sort of proprietary — owned and controlled by another company. Apple and Adobe aren’t enemies, but they’re certainly competitors, and the history between the two companies is not entirely warm.1 In the grand scheme of things, I suspect Apple’s executives aren’t happy at all about Flash’s prominent and entrenched role in desktop computing, particularly the fact that Flash, rather than QuickTime, has become the de facto standard for video on the web.

It is all about control…

The mobile market is wide open in ways that the desktop market is not. E.g., in the mobile OS market, Microsoft isn’t even in first place, let alone a monopoly. And, in the mobile world, Flash is rare, not ubiquitous. Why would Apple help Adobe establish Flash as a de facto standard for the mobile web, too? If Flash does turn into a major force in the mobile world, Apple can always add it later. But why shouldn’t Apple push for a Flash-free mobile web future now?

As it stands today, Apple is dependent on no one other than itself for the software on the iPhone. Apple controls the source code to the whole thing, from top to bottom.2 Why cede any of that control to Adobe?

Unfortunately if Gruber is right the mobile market will continue to be a lag in areas such as gaming, vector based apps, video, competitive markets, and many other things that lead to innovation. I think some of the recent changes in mobile recently are extermely cool (iPhone, Android, new flashlite) but unfortunately they have added about 20 new directions that mobile developers have to develop for. It is anything but a consistent platform even within the company silos being created in the mobile market.

AS3 Parsing RSS Feed

Mike Chambers has a great post on parsing RSS in AS3 with as3syndicationlib. I had some info on this in development but Mike’s post is very simple and just posting the code here for reference.

import com.adobe.utils.XMLUtil;
import com.adobe.xml.syndication.rss.Item20;
import com.adobe.xml.syndication.rss.RSS20;

import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;

private var loader:URLLoader;

//url of rss 2.0 feed
private static const RSS_URL:String = "http://feeds.feedburner.com/MikeChambers/";

//called when user presses the button to load feed
private function onLoadPress():void
{
 loader = new URLLoader();

	//request pointing to feed
 var request:URLRequest = new URLRequest(RSS_URL);
 request.method = URLRequestMethod.GET;

	//listen for when the data loads
 loader.addEventListener(Event.COMPLETE, onDataLoad);

	//listen for error events
 loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
 loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

	//load the feed data
 loader.load(request);
}

//called once the data has loaded from the feed
private function onDataLoad(e:Event):void
{
 //get the raw string data from the feed
 var rawRSS:String = URLLoader(e.target).data;

	//parse it as RSS
 parseRSS(rawRSS);

}

//parses RSS 2.0 feed and prints out the feed titles into
//the text area
private function parseRSS(data:String):void
{

	//XMLSyndicationLibrary does not validate that the data contains valid
 //XML, so you need to validate that the data is valid XML.
 //We use the XMLUtil.isValidXML API from the corelib library.
 if(!XMLUtil.isValidXML(data))
 {
 	writeOutput("Feed does not contain valid XML.");
 	return;
 }	

	//create RSS20 instance
 var rss:RSS20 = new RSS20();

		//parse the raw rss data
 	rss.parse(data);

		//get all of the items within the feed
 	var items:Array = rss.items;

		//loop through each item in the feed
 	for each(var item:Item20 in items)
 	{
 		//print out the title of each item
 		writeOutput(item.title);
 	}
}

private function writeOutput(data:String):void
{
 outputField.text += data + "\n";
}

private function onIOError(e:IOErrorEvent):void
{
 writeOutput("IOError : " + e.text);
}

private function onSecurityError(e:SecurityErrorEvent):void
{
 writeOutput("SecurityError : " + e.text);
}

Check out the full post on this at Mike’s blog.

Degrafa for Flex Looking Pretty Sweet (AS3 and Commonizing Paths Graphics Pipeline for Silverlight and Flex)


Just recently through the holidays Degrafa has made some great strides as a very cool SVG pathing and designers toolkit for Flex. I have to say some recent Flex apps have really looked good like Picnik and Buzzword but this kit looks to clean up the lack of design and default style-itis that has plagued most common Flex Apps.

This so far looking like a pretty strong kit for bringing the designer pipeline into Flex to provide some really nice looking web styled apps. It has a direct crossover to Silverlight and Path objects that are largely just a series of data created in Expression or exported from Illustrator into XAML. The one benefit of Flex/Flash is it compiles to a very small SWF where with Silverlight you have to package the XAML in a zip and use the downloader object to extract it out. These XAML files and Paths can get massive as I am sure the ones for Degrafa will for Flex but the compile option is nice as it is compressed heavily.

All about Degrafa

Yes the launch includes shiny buttons…

Sphere Sample (right click for source)

Also, it appears it is a way to bridge the pathing and pipeline for flash or Silverlight. At one of the contributors blogs they mention this:

We have lot of interesting features planned for the coming releases. There is also a converter app that will be made available for converting the juicy Degrafa graphics to XAML.

Degrafa has gone live.

Developing…

MosesProposes: Standardizing Animation and Motion Kits for Flash, Flex, After Effects, Javascript and I add Director and haXe

The Proposal

Moses, the maker of FuseKit, is hoping to influence Adobe product lines to include a common base for animation and motion going forward. Currently the AS3 world is very alive and is inspiring developers like myself to build lots of toolkits and really creating reusable code and kits that can make things very easy from going to Flash to Flex. But wouldn’t it be nice if a part of these kits that have to be downloaded every time you have an application use them be part of the native Adobe applications, or a core animation kit that partially standardizes animation basics to build upon further?

Are we just asking for trouble or is this a good idea? I don’t’ think it can hurt to bring this to the surface. I know that common syntax and familiar kits can really help the developers and designers move from Flash to Flex to After Effects to Javascript, it could also help Adobe with usage and usefulness of their entire suite of products. Or further this could be a standard that allows Silverlight to also build upon (open standard) and may the best platform win.

I think it would be very wise for Adobe to:

  • Standardize animation toolkits across their products and
  • Start standardizing some of the basic tools of building motion and filter kits to native but still allowing a flourishing open source and community research and development aspect.

What MosesProposes:

Moses did speak with someone at Adobe about this and it is generally in the plans:

“It was also a pleasure to see Richard Galvan present the upcoming crop of Flash features: the sleek update to the animation timeline (better late than never?), support for columnated flowing text (double finally!) and the big one, native 3D player support for Display Objects as rotatable 2D planes. He ran out of time and didn’t get to a few others shown at Adobe MAX, such as built-in IK (inverse kinematics) and faster pixel-level drawing for texture-mapping and photoshop-like filter effects.

Talking to him after the presentation I learned that Richard has a keen awareness of exactly where each feature is at currently. We chatted about low-level animation mechanics of the Flash Player, and I found out that the holy grail of a time-based player is indeed on the distant horizon, but that each rev will need to be a small step toward this goal. The new Flash timeline features meld After Effects, Premiere and Live Motion, and from what I’ve seen I have to say that they are nailing this long-overdue upgrade with great design decisions and a level of usability we’ve never seen in Flash. Kudos, team!”

The Current Situation

Right now Tweener and TweenLite (and animation package and a few others) have a unique position in that they work the same almost for AS2 and AS3 (Flex or Flash – with minor property changes such as _x to x as that has changed in AS3). But it would be nice if these kits also had a version for After Effects (really bringing that tool into Flash/flex developer worlds) and Javascript and it would be great if Silverlight also were supported (AgTweener anyone?).

Tweener is leading the pack in this aspect of creating a similar experience from AS2 to AS3 in Flash and AS3 in Flex and even JSTweener for Javascript, and a kit for haXe which is becoming my favorite toy and the dark horse with the most upside potential, with haXe on the loose these points may all be moot as haXe can target any platform (except After Effects easily, correct me if I am wrong and Silverlight but it could easily be done so to do it for Silverlight 1.0 which is ES3 based).

I don’t use After Effects as much right now but if I could easily incorporate this into Flash/Flex and script and animate in a similar syntax and way I know After Effects would definitely have a boost in interest.

Also, the forgotten one Director, can we please get an ES4 based language in that application, or an update? Then kits and add-ons are much more possible. I really miss hardware accelerated 3d in browser as a pushed technology, Director is still around but it does not get the focus it needs. Feel the freedom and coolness just in this small test here in director, hardware accelerated 3d is the best, the Director application environment and Lingo and hacked in javascript are not the best. As a long-time Director user, hobbyist and professional I am disappointed in Director’s support at Adobe thus far, but I digress.

The Reality

The reality is right now the only problem with kits like Tweener, TweenLite, Tween, mx.transitions, mx.motion, etc is that the source has to be embedded in movieclips multiple times. Sometimes there are multiple animation kits per compiled SWF that have to be used for more advanced features. This adds bulk that if common might not need to be there (this comes into play still on mobile and large games/apps).

Let’s say you have an application that pulls in many disconnected SWFs and they all have animation in them, well if you have 20 of these let’s say, and you embedded a very small Tweener at 9k per SWF. That is about 200k of duplication of AS code. Due to the kits small sizes this is not a problem really but when animation kits like Animation Package come into play, you are talking 40k per SWF which would leave you with almost a meg of just duplicated animation code. I don’t think this is that major of a problem for kits like Tweener (9k compiled) and Tweenlite (3k compiled) but as projects get bigger and more depth of animation platforms needed this can be a problem. This can also be solved in architecture with a controller and dummy SWFs to animate but there are times when you need animation in the compiled SWFs and then also need it in many others and the controller.

The other reality is the animation kits (mx.transitions.easing, mx.transitions.tween) for Flex and Tween for fl are a little bloated, more difficult than needed to use and as has been seen, much slower than kits currently available in the community. My one fear about this is that if Adobe makes this, possibly like Microsoft’s toolkits and libraries they put out, they are always bloated and slower, then because they are embedded they are untouchable. If it was standard enough as building blocks that are faster because they are native, then this is the best option as embedded script would be hard pressed to beat native code in the players/applications.

The Future Plans

Some of this is underway….

Animation kits for future, Adobe is releasing Flash 10 called ‘Astro’ that has many new improvements in tweening with xml closer to flex or even Silverlight like transitions and storyboards. Aral Balkan, a sponsor of OSFlash, posted on this and even that Diesel Flash CS4 will include more Tween tools for IK/bones. Tweener , TweenLite, Animation Package, Animation System etc these are all helping to define the best way to do animation kits.

Physics toolkits have their own animation kits currently usually to handle the movement according to algorithms. FOAM, APE , Box2DFlashAS3 (just released very recently will be posting more on this after I check it) and Motor Physics (unreleased but heavily demoed at polygonal labs) are great physics toolkits and I like this being part of the community to get refined, maybe one of them or the best performing ones becomes part of the proposed Adobe Animation bundle. These will define the best way to do physics kits.

3d in flash toolkits have also been emerging rapidly in 2007 with Papervision3D, Away3d based on pv3d, Sandy, and even engines starting to get built on top of these platforms.

The general direction is moving towards another platform in there somewhere but I think much work is left to be done to standardized physics systems, 3d and advanced motion filter tweens and bezier, splines (Catmull-Rom), editors, etc. I think it is getting time for basic animation kits to become more standard though and in latest versions of flash this is included in the flex and flash scripts but not the native code.

Right now the standard in syntax and the broadest reach is Tweener and due to the bigger fish syndrome, haXe that can target any platform, it also has a Tweener and can create code for as2, as3 and any target written in if After Effects, Premiere or other apps get more robust and standard animation and motion kits. Tweener has kits made and contributed for AS2, AS3, haXe, Javascript and others.

There is also Hydra and the AIF Toolkit that are standardizing After Effects and Flash shaders and filters into a new shader language like Cg and reminiscent of processing.org.

As humans we trial and error and build new platforms in the market to step on to create better platforms to build cool stuff, it is evolving right now. AS3 is inspiring platforms within platforms of Flash and Adobe kits as well as on Silverlight and in the Javascript world with JSTweener, jquery etc. As these things are refined we build a level standard platform to build more stuff on. Eventually this will be there and whoever does the standard platform for animation will probably reap in users and abilitty to easily add new products and solutions where people already have training. Silverlight is an example with .NET developers. .NET was also an example with C# so similar to Java. ES4 based AS3 has proven it is inspiring all types of new platforms and kits and will continue to do so and it is an interesting time in this industry whichever direction it goes.

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.

Deep Linking in Flash – SWFObject and SWFAddress

Flash is great, but accessibility can sometimes be a problem if it is not paid attention to. Direct linking, deep linking, back button support, these are very important to wire up in your applications. I am seeing many new RIAs, apps, sites, interactives still not do this and it is quite annoying.

The great thing about the web is that is gave users the ability to control the presentation and the context, from outside the presentation. By allowing users to use the back button and change urls in the address bar this was empowering. Empower your users and ad campaigns to get to different places of your application easily with deep linking, it is required for usability.

But this is hard right? Not really with great tools. What are you waiting for, SWFObject and SWFAddress make up THE platform right now for deep linking, embedding and back button support. These kits have been exhaustively tested and are very compact scripts to help you embed and then provide deep-linking, back button support and direct linking instantaneously almost.

Download SWFObject

Download SWFAddress

Both of these kits are well tested and provide instant small simple components of which to build complex systems on top of. SWFAddress builds on SWFObject tested embedding script and provides the tools you need to get deep linking running in your application in no time.

Note of caution, design implications (architecture design)

When you drive off the URL such as with direct and deep linking in Flash it does change your order of how you handle operations when you have to take into account the URL state. The first thing you have to do is when you receive an onChange event from SWFAddress that the URL has changed, you need to parse it and take action. However if you plan to deep link and provide usability throughout your flash site or app (even in the forms or multistep processes driven by URL) then you need to plan for this event and work this into your architecture for the url handling within the flash framework for your site.

A scenario might be:

  1. User using your flash app
  2. User clicks link or new section of your flash application
  3. INSTEAD of just animating the state in the flash application, you have to just update the section or URL (location.hash in javascript that provides the # name linking allowing the browser to stay put, or in this case SWFAddress.setValue((“/sectionname/page1″)),
  4. THEN the flash app or site is REACTIVE to the URL, reads in “sectionname/page1″ parses it and then animates to sectionname/page1.
  5. Or detect if the change came from the app or the URL directly and handle that differently in the onChange event with a subsystem.

Rather than just animating the app state or changing it, or showing that next photo on the button event, your button event would change the URL, then the flash monitoring the URL would push the onChange event. After that either animate in the next section or take appropriate action per the user requested action.

It isn’t like this for all areas or states of your application but you have to decide what is directly linkable, and when you want a state directly linkable then you have to wire it this way. Obvious choices are navigation items in your site, but they might also be specific cases like a multi-page form wizard that you want to link to step 3 directly, or a movieclip that someone can pass #3m2s to advance the movie by the url. There are many cases where you might want to provide deep linking into your flash application.

I know it sounds complicated? but it really isn’t, just a reversed way of thinking which we will highlight in the future with a tutorial and a fluid flash template. The SWFAddress site has great samples and examples, SWFAddress sets up the onChange handling in these samples and examples of how to do it in AS1, AS2 and AS3 so pick it up.

Download SWFObject

Download SWFAddress

Enable Deep Linking in Flash in 8 lines of code to start with SWFAddress:

From SWFAddress Documentation

1) Insert the SWFAddress script in your page directly after the SWFObject file.

<script type="text/javascript" src="swfobject/swfobject.js"></script>
<script type="text/javascript" src="swfaddress/swfaddress.js"></script>

2) Include or import one of the provided ActionScript classes. SWFAddress comes with versions for AS1, AS2 and AS3.3) Write your own navigation logic that will be executed when the address is changed.

SWFAddress.onChange = function()
{
    // Your code goes here.
}

4) Call the SWFAddress setter method from every button or action that requires deep linking.

this.onRelease = function() {
    SWFAddress.setValue('/portfolio/');
}

Check out the Asual blog (makers of SWFAddress) for more on good practices and bad practices with deep linking and more tips.Tips like:

Bad Practice: Address values naming using camelCase or other forms of custom convention

SWFAddress samples clearly define the best naming convention for deep links. Web addresses are case insensitive and the standard is lower case. For readability and Google SEO compatibility reasons the convention ‘my-deep-link’ is more appropriate than ‘myDeepLink’ or ‘My_deep_link’. The format http://domain.com/#/my-deep-link/?param=value is the only one fully compatible with the SWFAddress SEO rewriting.

Silverlight Deep Linking

This is also very simple in Silverlight to deep-link using javacript tools kits for Silverlight 1.0 which is javascript only, on location.hash change using a timer you could call an application method that might change the state or call certain transitions or move Canvases around, hide/show them, load content in, etc. Again, something you want to think about early on.

Other notes

SWFObject 2.0 beta5 is out and after 5 betas hopefully is nearing release

Pick up the code here for SWFObject 2.0

SWFObject 2 (script based) is the name again after a small switch and merge with UFO (standards based) to SWFFix but as Geoff Sterns pointed out, this seems to assume that something is broken.

SWFObject 2.0 is the new name again and let’s hope many more great tools are built on SWFObject 2.0 like SWFAddress which handles direct linking and back button support (using location.hash as most AJAX/RIA apps do to get deep linking and back button support).

Vector Wars Update: HD Video for Flash9 and Silverlight



Flash Performance and HD (H.264) Video Progress

Fast performance is needed for good video combined with interactivity especially. Quickly comparing AS2 to AS3 shows that AS3 and the AVM2 virtual machine in Flash9 is much faster. If you are combining Flash and video especially when it is time to go HD, you will need performance.

Compare AS2 to AS3 rendering: AS2 & AS3 Note the as2 item only has 10000 pixel operations, the as3 item has 50,000 and is considerably more usable, in fact the AS2 version isn’t usable since it is slow. [source] This is a good test because it checks the movement of every pixel on the screen which leads me to video performance.

Flash HD in the FLV format is pretty nice looking today in Flash9 with AS3. But to keep up there are more formats and a move to support H.264/MPEG-4 AVC I am sure for online TV/Movie market.

The reason to bring up performance and video is because the video battle on the web is heating up even more between Adobe and Microsoft with Flash Video and Silverlight Video. The recent released info regarding HD on Flash is to combat Silverlight HD video that is looking pretty good.

Silverlight Performance and HD Video VC-1

View this Halo 3 video in Silverlight HD:

View it->

Recently Silverlight came out last week officially on Wednesday, really the 1.0 release is just a video and javascript release but when you view the videos below you will see that they have a short coup de tat on Flash video at the moment in terms of HD quality video.

Silverlight also has been pushing TV on the internet. See these samples that are actual TV on web pages already using Silverlight.

  1. Home Shopping Network Online
  2. ET Emmy’s coverage
  3. They also have WWE and MLB.com baseball already using Silverlight video.
  4. Netflix online video uses Silverlight

Flash video is cool and you can do great fun things like neave.tv (flash 8) and high definition FLV video in flash9 with AS3 and on occasion AS2 if it is just video with full screen flash but when you are talking TV and movie quality, it is still up for grabs but both are looking good especially Silverlight and that Halo 3 video.

Flash video is updating to H.264

Tinic Uro reports the beta player of flash that has HD now. Currently the FLV format is the web leader (you tube, Google video) but is not as good quality as Silverlight until they update to H.264 at least in terms of standards video. This is probably 6 months off?

Video literally changed in the internet in the last two weeks with the Flash announcements and Silverlight launching. I am surprised at Silverlight’s adoption rate and partnerships so far with the 1.0 offering which lacks many programming tools, but I see why on the video front why they did it. When 1.1 comes out it has all the programmer toys, and it will attract a lot of attention I think. It is all about performance and HD video right now.

Yes yes… Quicktime has done HD/H.264 video for a while but Quicktime is just a video format really, it will be able to be used in the new flash video as well as other formats but it doesn’t have the interactive platform behind it like Flash and Silverlight have.

The difference is the choice of format and standards. Silverlight with VC-1 and Flash going to H.264 codec. They are largely competing standards that are both “HD”.

The good news is we have competition to bring really high quality video to the web, the mashups with HD video in interactive games, demos, advertising etc will be very fun.

Flash Determined to Continue to Lead In Video On the Web

Tinic Uro who works on the Flash player made some amazing announcements about the new beta flash player. Video is getting a major upgrade to the already pwning FLV format on the web, they are moving away from that however towards a H.264 standard format (can you say HD movies on your PC in Flash?). Silverlight (Windows Media VC-9), Quicktime and other formats were looking superior to FLV quality (although noone can beat the file size) but this has changed the game completely.

The people running the Flash product are just answering the calls of the market very effectively.

Some tidbits of what is possible with the new H.264 standard video in Flash:

  • Playing content of other formats inside of Flash without worrying about loading another player or plug-in. (MPEG player or Quicktime movies for instance)
  • Play HD video on your PC in Flash with support from video card manufacturers in the works.
  • Play AAC SBR data instead of MP3, 5.1 channel surround sound.
  • Use open source only tools for your complete video pipeline.

It seems Flash is determined to continue to lead video on the web

What was SWFObject and UFO is now one SWFfix for Embedding Flash in XHTML/HTML

Photo Sharing and Video Hosting at PhotobucketIn case you haven’t heard the SWFObject creator Geoff Stearns and the UFO creator have teamed up to create a new Flash Embed kit for HTML/XHTML called SWFFix that is more DOM compliant yet works.  Its always been a battle on this front of DOM standards vs Javascript when it comes to Flash embedding.

This teamwork to make a common kit will help to consolidate all issues with this and hopefully provide a really solid platform for embedding flash that takes into account all browser and satisfies standards but also works all the time. Making it harder to vote against when it comes time to decide what technology to use.

Of course there have been libraries like SWFAddress (for deep linking in flash and back button support easily) that have been built on top of SWFObject that will have to be switched over that have large user bases and following.

Check out SWFfix (of course this project has been very quiet and is not public since Feb 6-7th) hrm.

Follow

Get every new post delivered to your Inbox.