Archive | ActionScript RSS for this section

I hate using AVM1Movie…

Developer beware.  AVM1Movie content (running ActionScript 2 content inside ActionScript 3 movies) is a spiralling nexus of doom that will lead to your eventual insanity, if you persist in walking down that path.

Read More…

StarRequests, Simple-Box2D & Flickr – a example mashup.

Mark (of MarkStar.co.uk) has been working away on his pet project “StarRequests“ for a little while now, so I thought I’d give it a whirl and see what he’s come up with – and of course, what I could come up with off the back of it.  This is the result; a Flickr image loader, with a smidge of Box2D mixed in to make it all seem more interesting.

Read More…

Link: Value Object Class generator for ActionScript 3

A bit specialist perhaps, and the need for such a tool might become redundant if the Flash Builder hype is to be believed, but I found this quite useful for speeding up the process of writing a value-object class in AS3.

http://projects.stroep.nl/ValueObjectGenerator/

What is a value object anyway?

For the uninitiated, a value object class is essentially a class with very little or no application logic inside it.

Instead of being a file that actually does something, it’s more of a class for just storing data.  What makes it special is that AS3 classes are not all dynamic, so you have to plan what data you need to store and how you’ll store it; and you can achieve a vast majority of that with value object classes.

If you’re coming from an AS2 or Flash IDE background you might think it’s a bit unnecessary or even frustrating, but when you plug value object classes into a development environment like Flex Builder you see where it comes in useful, when it can actually gives you useful autocomplete suggestions, and warns you if you’re passing the wrong type of data into your classes.

Link: Computer mind control with ActionScript 3.0

This is a very cool experiment – using a socket in AS3 to interface with Brain Computer Interface (BCI) hardware. Check it out at this url: http://seantheflexguy.com/blog/2009/12/30/neurosky-mindset-brain-computer-interface-actionscript-3-0-api/

Simplifying Box2DAS3…

One of the downsides to the Box2DAS3 project – and probably one of the major hurdles to most Flash developers – is the fact that it’s inherited a lot of the syntax from the C++ project that it’s derived from.  Maybe it’s just because we’re used to it, but Actionscript is pretty easy to understand, and its methods of working pretty tolerant of inefficient coding.

C++ – or whatever Box2D is written in – is not, and it’s a little painful to setup and easy to break.  For my sanity as much as anyone else’s I’m working on a set of classes in AS3 that wrap around the Box2DAS3 classes, and provide you with a more familiar syntax for working with Box2D – objects, methods and utilities that makes it quicker to throw things together and don’t require you to rethink the way you work.

Well, that’s the eventual aim anyway.

Here’s the result of the first round of development – creating a Box2D world and adding objects, in about 6 lines of code.

var options:Box2DWorldOptions = new Box2DWorldOptions( 500, 280, 30, 9.8 );
options.setWorldEdges( true, true, true, true );
var world:Box2DWorld = Box2DUtils.createBoxedWorld( options );
world.debugDraw = true;
world.animateOnEnterFrame = true;
addChild( world );
for ( var i:int = 0; i < 30; i++ )
{
world.createCircle( 500 * Math.random(), 280 * Math.random(), 50 * Math.random());
}

And here’s the result:

Read More…