Archive for the ‘ActionScript’ Category

WP-SWFObject Patch

Friday, June 12th, 2009

I’ve been using WP-SWFObject for some time now in WordPress and it works fine except when you want to provide the source to the file. By default Flash will use a relative path from the HTML page the SWF is embedded in and not relative to itself. Firstly to solve this I monkey patched the Flex Application class, but patching WP-SWFObject makes more sense.

This slight alteration enabled you to specify the ‘base’ parameter…

base – . or [base directory] or [URL]. Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.

in the settings for the plugin.

Download patched WP-SWFObject

Library & LibraryManager

Friday, May 23rd, 2008

Here’s and example of our Library & LibraryManager classes that we use in some of our Flex and AS 3.0 projects to manage our external assets stored in SWF’s.

The classes enabled you to create multiple libraries of embedded (retaining and giving access to code) or loaded SWF’s.

You can create instance of Library wherever you want, but you can also create them through the LibraryManager giving you a single class to gain access to all your Library instances.

Here’s a quick example creating 2 Library instances using the LibraryManager. Each Library contains 2 SWF’s, each containing a BitmapData and MovieClip which are created using the Library. One Library instance embeds the SWF’s the other loads them. Not shown in the example, but you can also have a mix of loaded and embedded SWF’s in the same Library, and they contain fonts as well as custom classes.

LibraryExample
LibraryExample source (NOTE: The source has already been edited but not updated here. I suggest you pull down the latest version from our google code repository)

You can obviously get it one our Google Code repository.

Tink – Google Code Library

Friday, May 16th, 2008

I’ve been meaning to set this up for a while and finally I have a couple of classes in there.

I’ll move all our publicly released stuff into this code library for ease of use over time, i.e. users will be able to get an email when me make updates or additions.

http://code.google.com/p/tink/

FDT3 Open Beta

Tuesday, September 4th, 2007

For those of you who have never used FDT for your AS 2.0 development, you’ve been seriously missing out.

FDT was the first tool to provide a serious coding enviroment for ActionScript and Flash and for many Flash developers (including myself) FDT also provided us with our first steps into using the Eclipse IDE.

It’s an extremely important tool in the evolution of Flash and it looks like they have some great addition features in the new version, and of course support for AS 3.0.

FDT3 Open Beta

FWiidom

Thursday, February 15th, 2007

Good friend Adam has been playing with the Wiimote and Flash on Windows for a while now. About two weeks ago he was round mine showing me the classes he had put togther to enable Flash to interact fully with the Wiimote and he knocked up this first demo of intergrating what he had with Papervision3D.

He now has a site up dedicated to Flash and Wiimote intergration over at http://www.fwiidom.org/ (check the John Grdn inspired StarWiis).

I believe Pete Hobson who has an OSX version up and running named Fii is now working with Adam to provide a cross platform solution.

All this stuff looks very promising!

FlashInterface

Thursday, February 8th, 2007

Want to start writing AS 3.0 or use Flex 2.0, but need to use them alongside older elements created in AS 2.0 and published for Flash Player 8 or lower? You could use LocalConnection or ExternalInterface, both having their own limitations, or you could take a look at FlashInterface.

FlashInterface allows direct communication between AVMs with a common API for both AS 2.0 and AS 3.0. It also supports controlling Flash Player 7 and lower SFW’s through a Flash 8 wrapper.

Features
Bi-direction communication between AVMs, Synchronous calls, Returns values from within same call, Common API, Call Local Properties, Call Local Methods, Anonymous Calls, Global Access to SWF elements, Optional Event Listener Model, No limitation on data size.

Download, documentation, tutorials and examples.

gotAPI.com

Friday, September 15th, 2006

gotAPI.com has a large collection of programming API’s all in one place. All the info is loaded live from original source so everything is bang up to date and easily accessable in one page. Nice!

A Round Trip with FileReference

Friday, April 21st, 2006

Last night I presented the session I wrote for webDU at the London user group. Due to there being a lot to cover and lack of time I nowhere near got through the whole presentation only really getting to cover the first 3 examples on FileReference, and taking a quick look at the main class in the AS 2.0 ‘Round Trip’. I didn’t actually really get to cover any of the AS in the ‘Round Trip’, or any of the server side stuff either.

You can view the webDU presentation here, and the London user group presentation here. They are both the same except they have slightly different graphics.

If there’s enough people who actually want me to go through the ‘Round Trip’, then post your requests in the comments here or on the London user group forum and I’ll see what I can do.

All the source for the examples in the presentation can be downloaded from the ‘Download Example’. If anyone has any questions whether it be the AS, the PHP, or just working with classes, don’t be shy! Post your questions here and I will do my best to answer them.

I’m going to concentrate on developing the Flex 2.0 version (its beta 1 at the moment) for a future talk at any conference that will have me.

Why Would You Stream a Sound?

Friday, March 31st, 2006

Its very rarely I do any animations and especially animations that need to sync with a sound. The other day I had a small job that required this.

I set my framerate and then import sound onto the timeline and set it’s Sync property to ‘Stream’. Once the animation was complete and I tested the movie the sound quality was absolutely aweful. It just wasn’t useable at all. The problem here was that is was just a voice over. The rest of the voices overs have been added directly to a director file and they are crystal clear, so I couldn’t just have a major drop in quality on this small flash animation. I tried lots of different compression settings but none of them produced a sound that was usable (i presume if your sound is music, then the quality difference wouldn’t be so noticable).
(more…)

FileReference Mixing UI with RPC

Wednesday, March 22nd, 2006

Some of you may think I spend my life working with FileReference as I go on about it so much. I’ve gone on about how extremely easy to use it is, until today.

If you want to make up little Apps, FileReference it is perfect for the job and you wouldn’t run into this problem (in fact you’d probably think the way I would like to see it implemented would make things a lot more awkward for you), but if you were to build anything bigger seperating out your view components, model, controller and RPC etc you will run into a problem.

The FileReference object mixes user interaction (FileReference.browse() FileReference.download()) with RPC (FileReference.upload()) which really complicates things.
(more…)