« Hackery costs | Main | Jabber in Breeze »
November 28, 2005
CANVAS in SWF
CANVAS in SWF: I was just reading of a CANVAS example via Manish Jethani, and from doing some web searches found that Paul Colton has recently added a CANVAS example to his JavaScript-controlled generic-SWF AFLAX library. (AFLAX is a way for JavaScript to specify drawing and logic instructions for a SWF, using the externalInterface API of Macromedia Flash Player 8 -- if you develop in SWF you wouldn't need the extra layer, but it's a helpful advance for those more familiar with JavaScript, and can help make the CANVAS tag more browser-independent.) That's cool enough, but then I saw that he also ported Mario Klingemann's Kaleidoscope from ActionScript to JavaScript -- see JavaScript source -- there's a definite performance drop when the browser passes its interactivity into the SWF, but it's very impressive to see that even such an example is possible. This "write in JavaScript to control a SWF" approach is still bending my brain a little, but I think it's a rich area for future work, melding the web technologies together even tighter than before -- check it out!
Posted by John Dowdell at November 28, 2005 12:08 PM
Trackback Pings
TrackBack URL for this entry:
http://weblogs.macromedia.com/mtadmin/mt-tb.cgi/6843
Comments
Very interesting, JD. In an effort to get comfortable with as3 I started writing an HTMLCanvas class which mimics the methods and properties of Canvas and its 2dContext.
To go along with it, I am also writing a wrapper class and companion javascript classes so that individuals can write normal canvas code in their html file once a simple call to an initialize function has been made. If the browser supports the Canvas element, it draws to it as normal. If not, the regular javascript code draws to swf files that have dynamically been inserted inside the Canvas elements.
As usually, work gets in the way and I haven't touched it for a week or two. At this point I'd say the 2d context spec is about half implemented, give or take, and shouldn't be too hard to finish once I have some time.
Still, I get the feeling that Canvas is really more for browser vendors and related uses such as Safari based widgets and mozilla based extensions. I'm sure there will be worthwile uses directly in web pages given time, but...... I dunno. ;)
Posted by: christopher at November 28, 2005 02:16 PM
Over at Digg there's a citation, which mentions in passing "Flash emulators"... no other mentions or links, and I suspect it's an error. One thing that surprised me when scanning the rest of the Digg commentary was how often the CANVAS tag was panned as "non-standard".
Posted by: John Dowdell at November 28, 2005 05:19 PM