Archive for the 'Flash' Category

Flash – HTML5 Drag and drop integration

After seeing Mario Klingemann’s HTML5 drag and drop demo, I wanted to write a library around it and make it a little more cross-browser.

Register the necessary event listeners to the class and react to events such as dragging a file / element over your swf, dropping data or dropping a file on the swf.

FlashDragDrop.addEventListener(FlashDragDropEvent.DROP_DATA, dropDataHandler);

You don’t need to add any extra javascript to your flash embed, the javascript necessary to add the drag and drop support is injected automatically.

You can detect the drag and drop events in the latest versions of Firefox, Safari and IE. Accessing the content of the dropped files only works in the latest version of Firefox (try dropping an image).

You can check out a demo or download the source files.

Webcam Difference Keying

Some of my students are working on a project where they need a photo-booth-like keying application (take snapshot with somebody out of the picture, then step back in the picture and the background disappears). I’ve been experimenting with pixelbender the last week, and created some classes that do just that.

difference_keying

Check out the example, and play around with the parameters. Please note that it works best with a background without too much detail or similarities with the person in front. Also make sure there’s enough lighting.

You can download the source files and play around with them.

Actionscript 3.0 Gradients and Curves code generator

Now and then, I have to use the drawing API to draw a gradient, or a bezier curve. Every time, I have to dig through the help, to check the meaning of the different parameters, and where they belong in the function call. To make this more easy, I created a little code generator for gradients, and for drawing bezier curves with Actionscript 3.0.

Gradients code generator:

Actionscript 3.0 Code generator for gradients

Beziers code generator

Bezier curve code generator (AS3)

flash remoting with SWX and CakePHP

So, you want to learn how to create a sexy blog in flash, creating posts, comments, database storage, …? Are you afraid of spending hours writing complex queries, parsing XML data or writing loads of php files? Don’t be, and see the power of cakephp and SWX combined. CakePHP being a rapid development framework for PHP and SWX, the native data format for the flash platform! Continue reading ‘flash remoting with SWX and CakePHP’

CakeSWXPHP updated to SWX version 1.01

Aral Balkan released SWX version 1.0 a few weeks ago. I finally found the time to incorporate the changes into CakeSWXPHP! The changes include the swxAssembler class (instead of the old swfCompiler) and the rebranded service explorer.

Go to the cakeswxphp page for the latest downloads!

CakeSWXPHP updated to SWX beta 1.3

I took some time updating my cakeswxphp package to the SWX beta 1.3. One of the new features is the new service explorer from SWX.

You can test your cake gateway, pointing your browser to the /explorer/ directory, gateway location being: cake_amf_gateway.php

Go to the cakeswxphp page for the latest downloads!

Enjoy!

call cakephp through swx / amf

As some of you might know, I’m a great fan of the cakephp framework. It is a rapid application framework for php. Cakephp already had a subproject called cakeamfphp. Looking at the code from cakeamfphp, I was able to get SWX running and call the cake controllers as remoting services.

Go to the cakeswxphp page for the latest downloads…

Just copy/past in your cake directory! Gateway locations are:

swx.php (SWX)
amf.php (AMFPHP)
json.php (JSON)

Currently it uses an adjusted version of SWX, based on SWX beta 1.0. I will try to update it to future versions of SWX when I get the time…

More info about SWX and cakephp at:

http://www.swxformat.org/
http://www.aralbalkan.com/ (Aral Balkan, SWX author)
http://www.cakephp.org/

Enjoy!

Popforge open source

Hooray! Popforge, an ActionScript 3 code library by André Michelle and Joe Elbert is nog open source! I was especially interested in the audio classes, that enable you to generate audio at runtime in AS3. You can check out the library at the google code page.

FMX Conference – day 3

I’m at the FMX Conference in Stuttgart right now. Arrived today on day 3 of a 4-day conference. I was just in time to get to Greg Rewis’ Session about Flash Video.

It was a basic session on how to import and use video in flash cs3. Greg imported video directly in flash, encoding it to flv. Then he demonstrated some of the new components: the FLVPlayback AS3 version and a subtitle component. I found the subtitle thing quite interesting: it allows you to show subtitles from cuepoints in your flash video during the playback. Cuepoints can be defined inside the FLV or – and this I liked particulary – from an XML export out of premiere or aftereffects. So cuepoint info (time & subtitle) is in an XML format and can be linked to the video through standard components. Nice.

Greg will be at multi-mania aswell, talking about CS3 in general.