Activate your free membership today | Log-in

Wednesday, May 6th, 2009

SoundManager 2: Cool New Flash 9 Features

Category: Flash, JavaScript, Sound, Video

Scott Schiller has updated his popular SoundManager 2 library to include new functionality made possible by Flash 9, such as:

* Full-screen MPEG-4 video (HE-AAC/H.264) and audio support
* “MultiShot” play (layered/chorusing effects)
* Waveform/frequency spectrum data
* Peak (L/R channel volume) data
* Audio buffering state/event handling

In addition, SoundManager 2 now includes improved console.log()-style debugging, a troubleshooting/help tool, and the project website sports redesigned documentation, updated API demos, and more examples.

One of those examples is a “360° UI” sound visualization; this is the screenshot at the head of the post. The website features plenty of other demos, including full-screen video playback, etc.

This obviously takes SoundManager to a whole new level and is very exciting stuff.

Posted by Ben Galbraith at 8:00 am
8 Comments

++++-
4.6 rating from 32 votes

Friday, April 24th, 2009

Mouse Gestures with GWT

Category: Flash, Fun, Gears, UI

Marc Englund wrote to us about his recent experiments with mouse gestures and GWT:

SimpleGesture is a GWT (and IT Mill Toolkit) implementation of the mouse gesture recognition method described by Didier Brun at bytearray.org (as I understand it). It allows you to register easy to understand (human readable) gestures, and receive events when these occur. Additionally, SimpleGesture can record new gestures, so that you don’t have to write them by hand.

In this video demo, he’s using a Wii to show it off (this confused me at first, but he’s using the Wii as a mouse and isn’t doing anything with the Wii-specific inputs):

You can also play with a live demo.

SimpleGesture relies on a bit of Flash to do its thing:

I have used the bytearray mouse gesture library for a Flash project before, and I love how simple the method is, and yet it works very well.
The method works by assigning a number depending on which direction the mouse moves in (moving right will produce “0″, moving down will produce “2″, and so on), and comparing the resulting string of numbers to the registered gestures. The gesture with the lowest Levenshtein distance (and below a set threshold), is considered a match.

Posted by Ben Galbraith at 9:00 am
5 Comments

+++--
3.5 rating from 22 votes

Monday, March 16th, 2009

Going full circle: could falling back to Flash solve IE’s lack of canvas support?

Category: Canvas, Flash, IE

There is an interesting blog post* and demo code on Azarask explaining Flash Canvas as a solution for IE’s lack of support for Canvas:

How does FlashCanvas work?

FlashCanvas is modeled after ExplorerCanvas which means it is a turn-key solution for adding Canvas support to IE. You can code away, happily using open standards and then use FlashCanvas to forcefully and silently upgrade IE to also being standards compliant.

There are two main components in FlashCanvas: the base FlashCanvas.swf flash file (a mere 688 bytes), and the FlashCanvas.js wrapper. I’ve used the excellent swfobject.js to embed the Flash into the page.

The FlashCanvas.js file implements a fake-canvas object and converts all existing canvas element into a flash object. The javascript intercepts canvas commands and forwards them to the FlashCanvas.swf movie file using the ExternalInterface provided by the flash player. The flash movie clip then interprets the command and draws accordingly.

Aza originally thought that this would also solve the performance problems other fallbacks to VML have but found out that sadly enough this is not the case because of the lag between ActionScript and JavaScript via ExternalInterface.

Each call via the ExternalInterface is taking approximately 0.5 ms. Since we know the time it takes to call an actionscript method from javascript, we can deduce the amount of time it takes for Flash to render. For the example1.htm page it takes ~24 ms to render 20 anti-aliased lines. In Safari a call into actionscript takes roughly 0.4 ms — this is only the call time, it doesn’t include the time to render anything. For example1.htm a single “particle” calls actionscript 3 times with the commands: [lineStyle,moveTo,lineTo]; each particle takes 1.2 ms in JS-to-AS calls; to take 1 second to render the frame ~833 particles need to be rendered.

There are few more ideas in the comments to the article and this might be an interesting concept to take further. Somehow it seems ironic to go back to Flash to make IE render standards, but then again VML is proprietary, too.

* Hat tip to Scott Schiller for pointing out this older, but somehow forgotten post.

Posted by Chris Heilmann at 4:43 pm
18 Comments

++++-
4.3 rating from 22 votes

Thursday, January 15th, 2009

Seeding the clipboard in Flash10 with Zero Clipboard

Category: Flash, Library, Security

Following the bombshell of Adobe announcing that Flash 10 will not support unsolicited clipboard access from Flash and JavaScript as malicious flash ads flooded clipboards a lot of developers were wondering how to make the “copy to clipboard” still work without having to do it in Flash itself.

An interesting and also slightly creepy approach to the problem is the JavaScript library Zero Clipboard:

The Zero Clipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface. The “Zero” signifies that the library is invisible and the user interface is left entirely up to you.

This library is fully compatible with Flash Player 10, which requires that the clipboard copy operation be initiated by a user click event inside the Flash movie. This is achieved by automatically floating the invisible movie on top of a DOM element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mouse down effects.

So in other words, zero clipboard is a legitimate use of the clickjacking trick to cover an element with a transparent element that provides another functionality.

There are detailed instructions how to use the library on the homepage.

I don’t know about you, but somehow “copy to clipboard” buttons seem a bit redundant to me and by keeping this functionality working cause more security holes than usability benefits.

Posted by Chris Heilmann at 9:21 pm
5 Comments

++++-
4.3 rating from 10 votes

Wednesday, November 19th, 2008

How Flash Can Join The Open Web

Category: Editorial, Flash, HTML

As it is Adobe MAX this week, there is a lot of talk about the Flash platform. How does this relate to the Open Web? Well, it turns out that Dion and I have been discussing how Flash can join and become a part of the Open Web.

Dion kicks things off with his blog post “The Flash Platform: How Adobe could join the Open Web to take on…”. He first talks about how developers see Flash today versus other options:

Adobe (via Macromedia) has traditionally been a Web designer company, but developers haven’t jumped in to the same degree (note: not to say they haven’t been wildly successful!). I think that the perception is something like this:

Dion discusses how Adobe has an opportunity to position themselves relative to Silverlight much more strongly in the Open Web camp:

With Silverlight making a huge charge I worry about a world where you have “Best viewed in Silverlight and IE” (which in fact is “only viewed in…”) and people often ask: “But isn’t Flash just as bad?”

Adobe has an opportunity here. They can move to the right and Flash could become strongly in the Open Web camp. Then we would all be stronger as we come up against Silverlight :)

The next logical question related to this is open sourcing Flash:

The conversation tends to end up with opensourcing Flash, which I think will happen at some point through necessity, and the sooner the better (for everyones sake). Flex has a loyal base and has some open source help, but hasn’t gotten the love that it could get because it sits on top of something that isn’t open source itself. It is hard to get excited about an open source tech that sits on top of the same vendors proprietary platform!

I agree with Dion that open sourcing Flash and having it join the Open Web camp is a very compelling idea. Open source would just be the first step, though, so following up on Dion’s post I put together an editorial titled “How Flash Can Integrate With The Open Web”:

As Dion points out open sourcing Flash is one big part of making this happen, but another huge aspect would be to have Flash and Flex integrate better into the web stack and be less of a ‘black box’ on the screen…The important point is to integrate Flash and Flex more deeply into how the Open Web works:

  1. Cross-Platform Standards
  2. No Vendor Lock-in
  3. Anyone Can Innovate
  4. Powerful, Universal Clients
  5. Open Source Implementations
  6. Mashable, Searchable, and Integrated

I give a list of suggested ways to do this; the important thing is to have Flash integrate more deeply — these are just some suggestions to kick things off. Here are some of them; click on them to read more in-depth how this might work:

I wrap up with a conclusion:

At the end of the day Adobe is a tools company, a really damn good tools company actually. Doing the above should allow Adobe to continue creating powerful tools that help authors and content creators while expanding the size of the market they can target.

The above list was just a suggestion to kick things off. The real focus is on having Flash integrate into the web stack better itself (and evolving both Flash and the web stack themselves into the future).

How do you see this happening?

Posted by Brad Neuberg at 6:00 am
10 Comments

+++--
3.7 rating from 21 votes

Saturday, September 27th, 2008

Flash 10 and the bad news for JavaScript interaction

Category: Accessibility, Adobe, Flash, Security

Right now you can use Flash to work around a lot of JavaScript limitations and many products use an invisible Flash movie to for example batch upload files (Flickr, Wordpress), play movies in a screenreader accessible manner (with DHTML controls outside the main movie - Yahoo Video, for example) or automatically add content to the browser clipboard (snipurl.com).

All of these will cease to work without user interaction in flash as reported on the adobe devnet. There are very good reasons for it as explained by Lee Brimelow but it is a real problem that will cease to make Flash a useful tool to patch inaccessible solutions.

As long as you cannot access a Flash movie in non-Internet Explorer browsers via keyboard, there will be no such thing as an accessible flash page. Research findings presented at Scripting Enabled last week showed that for example many screen reader users skip Flash as soon as they hear that there is a movie on the page, regardless of how much effort you put in to make the movie itself keyboard enabled. DHTML controls worked around that issue - a button that cannot be accessed is very secure, but also pointless.

There must be some middle ground there somewhere…

Posted by Chris Heilmann at 4:11 pm
25 Comments

++++-
4.3 rating from 49 votes

Thursday, September 4th, 2008

Dojo Multifile Uploader with Flash

Category: Dojo, Flash

SitePen continues their work on Deft with a multi-file uploader:

The Dojo Toolkit now has support for multi-file uploads, thanks to the new Deft project. The dojox.form.FileUploader class embeds a hidden SWF file in the page which, when triggered, will open a system dialog that supports multiple file selection, and also file masks, which allows the user to filter their selection by file type.

Better yet, it’s fully degradable. If the user does not have version 9 or greater of the Flash Player installed it can, depending on the options you set, present the user with a standard HTML file input instead (or the option to install the latest Flash Player). The HTML form also supports multiple files, although due to browser restrictions, only one can be selected at a time. But they are all uploaded at once.

A major benefit to developers is the flexibility to supply your own styled upload button. For example, a paperclip icon toolbar button in an email application should not look like the standard file input with a text field followed by a “browse …” button. What inspired this design was working on projects where designers and clients would hand me a specification which would say, “the upload button looks like this“.

To use it? Fairly simple:

JAVASCRIPT:
  1.  
  2. var uploader = new dojox.form.FileInputFlash({
  3.         uploadUrl:"http.localHost/FileUpload.php",
  4.         button:myButton,
  5.         uploadOnChange: false,
  6.         selectMultipleFiles: true,
  7.         fileMask: ["All Images", "*.jpg;*.jpeg;*.gif;*.png"],
  8.         degradable: true
  9. });
  10.  

Want to try it out?

This comes after the YouTube uploader that uses Gears.

Posted by Dion Almaer at 10:09 am
7 Comments

+++--
3.6 rating from 31 votes

Monday, August 4th, 2008

Deft-fully using Dojo and Flex

Category: Dojo, Flash

Tom Trenka of SitePen has created a new top-level Dojo package called Deft which "focuses on ActionScript components created in support of the various projects within the Dojo Toolkit (mostly for DojoX). Deft source files are well organized based in part on the organization of other Dojo Toolkit projects, as well as the package structure required by the Flex compiler. Most Flex applications are based on the Flex AS3 Application class, which forces you to write at least one “controlling” MXML file in order compile your code. Instead of this, Deft components inherit primarily from the Sprite class — which allows you to write pure ActionScript code."

It contains a few goodies in it including the multi-image uploader, and pre-alpha quality support for dojox.gfx. Future plans include support for audio and video. "Hopefully Adobe will continue its current path towards being open source friendly, helping Deft flourish."

The article goes into detail on downloading the Flex SDK so you can build applications with it.

This is an interesting experiment in the melding of Flash and Ajax techniques. I would love to see the Flash player giving us more access via simple JavaScript, so we don't even need to create SWF bridges.

Posted by Dion Almaer at 6:38 am
5 Comments

+++--
3.9 rating from 17 votes

Wednesday, June 25th, 2008

flXHR: Flash based XHR from flensed

Category: Ajax, Flash, JavaScript, Library

Kyle Simpson has announced a new family of opensource projects called flensed and the first project being flXHR which "utilizes javascript+flash to create a complete, literal drop-in replacement (by being API identical) for the native browser XHR (Ajax) communication mechanism. However, flXHR uses Flash Player's security model to enable direct cross-domain communication, and also has a number of other very helpful extensions."

http://flxhr.flensed.com/code/tests/flxhr-4.html

There are a number of demos which illustrate how it easy it is to take the API-compatible flXHR and swap it to any of your favorite JS frameworks (Dojo, Prototype, YUI, ExtJS, etc) in place of its usage of native XHR... once the simple adapt/swap happens, everything else about the framework library communication works the same, because flXHR speaks the same familiar protocol and API, and so it really is what I like to call "set it and forget it" good.

Hasn't this been done before?

There have been several other attempts at similar things before, including SWFHttpRequest, FlashXMLHttpRequest, Fjax, and F4A. However, all those fell short of the mark in different ways. On my site, there are comparison charts and detailed FAQ's which show how flXHR stands up to these predecessors, and exceeds them in very important and powerful ways. I believe flXHR has accomplished its goal, which was to be *the* complete solution for SWF-based Ajax calls as an identical API-compatible drop-in replacement for native XHR, not to mention many helpful improvements including robust error callback handling, timeouts, and convenience configuration functions, to name a few.

Posted by Dion Almaer at 9:53 am
23 Comments

++++-
4.2 rating from 39 votes

Sunday, June 1st, 2008

Acrobat.com: PDF and Flash sitting in a tree

Category: Flash, Showcase

Acrobat.com

Ever since Macromedia and Adobe merged, we have been waiting for a day where PDF and Flash played really nice together, and today is the day. Very symbolic for the folks from the companies before the merge.

As TechCrunch says:

At the same time Adobe is launching Acrobat.com, it is releasing Acrobat 9—a major upgrade to one of its anchor desktop apps. the big news here is that for the first time, Adobe’s PDF-creating desktop software will supports Flash. So people can now create documents with embedded Flash movies from YouTube, or developers can design entire new skins for electronic documents using Adobe’s Flex framework—the same programming tool they use to create Web applications.

PDF documents made with Acrobat 9 also support collaboration among multiple authors and reviewers over the Internet, making them connected documents. Best of all, they no longer take forever to load. The next step is for Adobe to make it easy to turn any PDF into a Web page, and vice versa.

Acrobat.com Services

This is the biggest news for me. Acrobat.com itself is a very nice integration of Buzzword, ConnectNow, PDF, and Share. It feels quite snappy (despite the "loading..."), and there are a lot of nice animations of course. A good showcase for Flex.

Posted by Dion Almaer at 11:46 pm
2 Comments

+++--
3.8 rating from 24 votes

Tuesday, May 6th, 2008

Porting Dojo Methods to Flash

Category: Dojo, Flash

Mike Wilcox has started a nice series of posts on porting Dojo methods to Flash as a homage for Open Screen (aside: I applaud Adobe's intentions, but need to see a non-assert of their IP before I can do anything with it.)

In part one of the series Mike ports dojo.hitch to ActionScript:

JAVASCRIPT:
  1.  
  2. _global.lang = {
  3.         hitch: function(scope, method){
  4.                 if(!method){
  5.                         method = scope;
  6.                         scope = _global;
  7.                 }
  8.                 var args;
  9.                 if(arguments.length>2){
  10.                         args = arguments;
  11.                         args.shift();
  12.                         args.shift();
  13.                 }
  14.                 if(typeof(method) == "string"){
  15.                         return  function(){ scope[method].apply(scope, args) };
  16.                 }
  17.                 return function(){ method.apply(scope, args) };
  18.         }
  19. }
  20.  

In part two he adds support for dojo.connect(), resulting in:

JAVASCRIPT:
  1.  
  2. _global.lang = {
  3.         __conListeners:{},
  4.         __id:0,
  5.         connect: function(source, event, target, callback){
  6.                 var hitched = this._hitch(target, callback);
  7.  
  8.                 var listener = new Object();
  9.                 listener[event] = function(args){
  10.                         hitched();
  11.                 }
  12.  
  13.                 if(!source.broadcasters) {
  14.                         source.broadcasters = {};
  15.                         AsBroadcaster.initialize(source)
  16.                 }
  17.  
  18.                 source.addListener(listener);
  19.  
  20.                 if(!source.broadcasters[event]){
  21.                         source[event] = function(){
  22.                                 source.broadcastMessage(event, arguments);
  23.                         }
  24.                         source.broadcasters[event] = true;
  25.                 }
  26.  
  27.                 var id = "connect_"+this.__id++;
  28.                 this.__conListeners[id] = {listener:listener, source:source};
  29.                 return id;
  30.         }
  31.  
  32.         disconnect: function(id){
  33.                 var con = this.__conListeners[id];
  34.                 if(con){
  35.                         con.source.removeListener(con.listener);
  36.                         con = null;
  37.                 }
  38.         }
  39. }
  40.  

Posted by Dion Almaer at 7:12 am
1 Comment

++++-
4.5 rating from 14 votes

Monday, April 28th, 2008

FancyUpload: Swiff meets Ajax

Category: Component, Flash, JavaScript, MooTools

FancyUpload

Harald Kirschner has created a new version of FancyUpload "a file-input replacement which features an unobtrusive, multiple-file selection menu and queued upload with an animated progress bar."

A good example is the Queued Photo Uploader which is coded by:

JAVASCRIPT:
  1.  
  2. var swiffy = new FancyUpload2($('demo-status'), $('demo-list'), {
  3.         'url': $('form-demo').action,
  4.         'fieldName': 'photoupload',
  5.         'path': '../../source/Swiff.Uploader.swf',
  6.         'onLoad': function() {
  7.                 $('demo-status').removeClass('hide');
  8.                 $('demo-fallback').destroy();
  9.         }
  10. });
  11.  
  12. /**
  13. * Various interactions
  14. */
  15. $('demo-browse-all').addEvent('click', function() {
  16.         swiffy.browse();
  17.         return false;
  18. });
  19.  
  20. $('demo-browse-images').addEvent('click', function() {
  21.         swiffy.browse({'Images (*.jpg, *.jpeg, *.gif, *.png)': '*.jpg; *.jpeg; *.gif; *.png'});
  22.         return false;
  23. });
  24.  
  25. $('demo-clear').addEvent('click', function() {
  26.         swiffy.removeFile();
  27.         return false;
  28. });
  29.  
  30. $('demo-upload').addEvent('click', function() {
  31.         swiffy.upload();
  32.         return false;
  33. });
  34.  

Posted by Dion Almaer at 8:37 am
4 Comments

++++-
4.5 rating from 81 votes

Thursday, March 27th, 2008

Adobe Photoshop Express Launches

Category: Adobe, Flash, Showcase

The launch of Adobe Photoshop Express has been much anticipated. We are seeing the move of a large software company going from desktop to Web for a major application.

As Erick Schonfeld points out "Photoshop Express is by no means just Photoshop ported onto the web."

I am a big fan of Picnik and for awhile was using it quite regularly, so I wanted to see how they compared.

It seems like Photoshop Express is pretty limited and seems very much focused on taking images, putting them online, and doing little touch-ups. One of the things that I am always doing is taking a picture and adding text and shapes to it, and this isn't available, so I kinda don't know when I would use this other than for simple cropping and resizing.

The interface is sleek and Flash-y but somehow doesn't feel as nice as Picnik to me.... I don't know why.

View Source has some fun though:

HTML:
  1.  
  2. <!--
  3. Smart developers always View Source.
  4. This application was built using Adobe Flex, an open source framework
  5. for building rich Internet applications that get delivered via the
  6. Flash Player or to desktops via Adobe AIR.
  7. Learn more about Flex at http://flex.org
  8. // -->
  9.  

What do you think?

Adobe Photoshop Express

Posted by Dion Almaer at 2:14 am
8 Comments

+++--
3.3 rating from 12 votes

Monday, March 24th, 2008

FaviconGrabber and Social Graph

Category: Flash, Showcase

Alistair Rutherford has written a nice looking Flex application that visualizes the Social Graph API:

Flex Graph API

Alistair told us about the application, and some of the fun features:

The initial version was a bit boring looking so I thought it would be nice to pull the 'favicons' for the sites returned in the results. I have detailed how I did this here

Because I could not fetch the icons directly using HTTPService I have used a cgi proxy script written in Python to fetch the target icons and convert them into a Base64 encoded string before returning the data to the Flex application.

The Flex application decodes the Base64 and then passes the data to a modifed version of the IconLoader class from the flexlib library.

The modifications to flexlib took the form of adding in support for 8bpp and 24bpp images.

The graph is implemented using the flexvizgraphlib visualisation component from here:

The application also uses a novel IFrame component which lets you
embed html pages directly into your Flex application.

Posted by Dion Almaer at 10:11 am
1 Comment

+++--
3.5 rating from 8 votes

Monday, March 17th, 2008

Dojo Storage updated for 1.0

Category: Dojo, Flash, Gears

Brad Neuberg, a partner of crime on the Gears team, has released an update to Dojo Storage that has it cooking with gas on the new Dojo 1.x codebase:

Dojo Storage makes it possible to store large amounts of data (hundreds or megabytes of K) on the client-side, way beyond the 4K limit of cookies. Developers are given a simple key/value storage abstraction, similar to a hash table. What makes Dojo Storage unique is that it automatically determines the best way to achieve this. If Google Gears, a small open-source plug-in that teaches current browsers new tricks, is present then this will be used for storage; if the browser supports HTML 5 DOM Storage, such as Firefox 2, then this is used; and finally, if none of the others are available, then a hidden Flash applet is used to store the data permanently. There are even Adobe AIR storage providers (thanks to SitePen and Adobe) if you are running in an AIR environment!

Dojo Storage has been around for a few years. However, when Dojo made the big move to the Dojo 1.0 architecture, the Flash and HTML 5 storage providers broke; plus, new versions of Flash and new browsers made the old design inefficient. I have seriously re-factored the Flash storage system to be much faster and simpler and fixed bugs in the HTML 5 and Gears storage systems. There is now a new storage.js profile build that you can grab and include in your page to easily use Dojo Storage with the three main browser storage providers: Gears, HTML 5, and Flash. The new Dojo Storage will come out as part of the Dojo 1.1 release coming soon.

I've created a screen cast demoing the different storage providers in action:

Posted by Dion Almaer at 6:35 am
1 Comment

+++--
3.7 rating from 15 votes

Wednesday, February 27th, 2008

Adobe extending Flash platform: Run C, C++, Java and more

Category: Adobe, Flash

Paul Krill picked up on Kevin Lynch saying "It's basically a way to take other languages and make them run on top of Flash Player" as he answered a question from the audience at Engage the other night.

Expanding on the project, Ted Patrick, Adobe technical evangelist, said the technology would allow for cross-compiling existing code from C, C++, Java, Python, and Ruby to ActionScript. This would enable components written in those languages to be integrated into a larger project, Patrick said. "That code becomes perfectly portable into our application platform," he said.

For example, an alternative PDF renderer providing a lighter version of PDF could be cross-compiled, and the Flash Player could read it and display PDFs.

"Right now, everything has to be written in ActionScript or our lower level byte code languages," said Patrick.

In Flash Player, everything has to compile down to SWF byte code, Patrick said. The byte code language inside SWF is called ActionScript byte code.

Of course, this has been talked about quite some time ago. As Tamarin grows up and becomes a solid VM, we are likely to see the polyglot come to being in full force.

Posted by Dion Almaer at 6:20 am
12 Comments

++++-
4.1 rating from 17 votes

Next Page »