Flash Player 9 April 2008 Security Update affects me too

April 11th, 2008 § 2 comments § permalink

So here I was, thinking that the Flash Player 9 security update (version 9.0.124) wasn’t going to affect me. A silly assumption, of course—I should have tested with the beta, regardless—but since I didn’t do anything fancy with sockets or web services, I thought I would be fine.

Ha!

I missed this section: “You have SWFs that are exported for Flash Player 7 (SWF7) or earlier that communicate with the hosting HTML by any means”.

And when they say “any means,” that includes LoadVars.send(), which I am using, in a SWF that is hosted on a different subdomain than the page which contains it (petswf.bunnyherolabs.com vs bunnyherolabs.com).

Luckily, the fix was simple: I just had to add the parameter allowScriptAccess = "always" to the embed tag. Phew!

Next time I see one of these announcements, I promise I will test it, even if I don’t think it applies to me ;)

Virtual Worlds

April 4th, 2008 § 3 comments § permalink

I am currently attending the Virtual Worlds conference in New York City. It’s quite a fascinating conference, covering full-blown 3D worlds (a la Second Life), browser-based paper doll communities (Stardoll) and everything in between. Flash is well-represented here; if it’s 2D or 2.5D virtual world (i.e. not a full 3D environment), it’s done in Flash, period (no sign of Papervision, Sandy 3D or other Flash-based 3D engines, though).

Today I attended a session introducing Electrotank‘s ElectroServer Universe Platform (they don’t have a section on their website for it yet, it’s that new!). It builds on their successful ElectroServer product, adding things like a high-performance isometric rendering engine, a world editor, and content management systems. It looks very advanced and quite impressive, and would probably give any developer wanting to create a virtual world a solid leg up. I will definitely investigate this platform further should I decide to extend bunnyhero labs in a more persistent-world direction.

Tweaking gskinner’s compileProject script

February 21st, 2008 § Comments Off on Tweaking gskinner’s compileProject script § permalink

Recently I had the need to rebuild a whole bunch of Flash movies, more than I wanted to do manually. Before writing my own JSFL script to automate the process, I did a quick Google search and found Grant Skinner’s FLA Batch Compiler script. It’s very flexible and very handy: exactly what I needed.

Grant’s script uses a text file to specify what files need to be built and where the resulting SWFs should be copied. However, the text file uses single tab characters (ASCII 9) to separate the fields, and I like to configure my text editors to insert spaces instead of the tab character.

I made a small modification to Grant’s script to allow any amount of whitespace (spaces or tab characters) in between each field in the schema file.

I changed this (around line 49 in compileProject.jsfl):

    var l = schema.length;
    for (var i=0;i<l ;i++) {
        var row = schema[i].split(String.fromCharCode(9));

to

    var l = schema.length;
    var regExpDelimiter = new RegExp("[ \t]+");
    for (var i=0;i<l ;i++) {
        var row = schema[i].split(regExpDelimiter);

And that was that!

(I originally tried using the literal RegExp notation [e.g. scheme[i].split(/[ \t]+/)], but it didn’t seem to want to compile that way.)

AIR Monster Attack updated to latest beta

January 3rd, 2008 § Comments Off on AIR Monster Attack updated to latest beta § permalink

No new features: just rebuilt and repackaged to run on AIR beta 3. Note that the newest AIR beta properly displays animated GIFs, which makes this silly app look much better :)

I did have to make a change from the original version, to conform to the new AIR HTML security model. My original code used setInterval, with a string to execute as the first parameter. This is a no-no in the new security model (since the executable string is the equivalent of an eval). I could have put the whole thing into an iframe in a non-application sandbox, but instead I used the AIR-native Timer class, which did the trick.

Download the updated Monster Attack! (requires Adobe AIR beta 3)

Weird Flash 8 compiler bug?

November 9th, 2007 § 2 comments § permalink

I haven’t delved into this in detail (so it could simply be an error on my part), but I had a function that returns a string. The string is long and complex, so my return statement looked something like this:

return
    'string stuff'
    + ' more string stuff ' + someVariable + 'string stuff'
    + ' more string stuff'
    + ' more string stuff'
    /* ... about 20 lines of this ... */
    + ' more string stuff';

The resulting function always returned undefined instead of the string.

Baffled, I changed the code to look like this:

var result:String =
    'string stuff'
    + ' more string stuff ' + someVariable + 'string stuff'
    + ' more string stuff'
    + ' more string stuff'
    /* ... about 20 lines of this ... */
    + ' more string stuff';
return result;

…and that worked as expected. Huh.

on AIR Bus Tour Photos

September 27th, 2007 § Comments Off on on AIR Bus Tour Photos § permalink

My crappy cellphone pictures from the on AIR Bus Tour event. The food was amazing. Check out the chocolate fountain!

Also see public photos on Flickr from the event.

AIR Monster Attack

September 26th, 2007 § 4 comments § permalink

lizardWell that was easy!

I made a quick AIR version of my monster attack “application”. The copy of AIR for JavaScript Developers Pocket Guide that they gave us at the on AIR Tour Bus event was very helpful (along with the demos that they actually presented at the event).

All I had to do was create the application descriptor XML file and add a bit of AIR code (in JavaScript) to maximize the window and make it “always on top” (or alwaysInFront in the AIR API), and voilà: monster attacking your desktop!

It’s not quite finished though. The biggest problem is that the current beta of the AIR runtime does not display animated GIFs correctly (it just displays the first frame), so the fires do not look right (this is a known bug and should be fixed by the 1.0 release of AIR). I may change the code to do the animations myself. Besides that, I have not created any application icons yet, and has only been tested on Windows, on a single machine :P No idea how well it runs on the Mac. UPDATE: After fixing the mime type for AIR files, it now downloads on Safari on my Mac and runs correctly. On top of that, the animated GIFs run properly on Mac OS X!

If you run this, be warned that it eats a lot of CPU time, which is not a surprise; after all, it’s a full-screen transparent window!

monster-screenshot.jpg
View screenshot

I’m pretty excited about the possibilities of JavaScript/HTML AIR apps that leverage the Flex libraries in JavaScript. Plus I think it might be a great way to learn the new Flex/Flash/AS3 APIs without having to learn MXML at the same time (especially since I don’t have Flash CS3 yet).

If you have the AIR runtime installed (available here), then give this a try.

Download monster attack!

Verlet

September 26th, 2007 § Comments Off on Verlet § permalink

I’m pretty happy with how the Verlet integration engine I’ve been building is turning out. I’m using it for the next virtual pet animal I’m working on. It’s somewhat cleaner and much more extensible than the system I hacked together for my monkey. When combined with my wide-curve-drawing routines, you can create some interesting-looking stuff (IMHO :) ). Once my new pet is done you’ll be able to see it. I might upload a simple demo before then, though…

I’m considering releasing it under an open source licence of some sort… not that it’s that amazing or awesome, but it could be useful or interesting to others.

Not liveblogging the Adobe AIR Tour

September 26th, 2007 § Comments Off on Not liveblogging the Adobe AIR Tour § permalink

I’m here at the Toronto stop of the Adobe AIR Tour. So far it’s been pretty keen with cool demos, including stuff like applying Flash filters (e.g. blur, bevel, etc) to HTML elements. Nice.

I still haven’t done anything in Flex or AS3 yet, but being able to use HTML/CSS/JavaScript with full access to AS3 libraries seems pretty powerful, with a much lower learning curve than jumping straight into full Flex.

Right now Akamai just announced the release of an AS3 Media Player Framework…

Oh yeah, I’m not liveblogging :P

panorama phone pic 2 at adobe air bus tour

Short note: Bézier curves

September 25th, 2007 § Comments Off on Short note: Bézier curves § permalink

In my current project, I am drawing Bézier curves in code rather than using MovieClip.curveTo(), thanks to the bug I wrote about back in May. Since I’m doing it in code myself, I thought I might as well use cubic Béziers (four control points) rather than Flash’s quadratic curves (only three control points). Plus, for the application in question, cubics just seemed to make more sense.

I found this helpful article, “Derivation of Incremental Forward-Difference Algorithm for Cubic Bezier Curves using the Taylor Series Expansion for Polynomial Approximation”. That title is quite a mouthful, but the upshot is it shows how to use only additions while drawing the curve, instead of a bunch of multiplications, for faster drawing time.

Where Am I?

You are currently browsing the Flash category at bunnyhero dev.