Archive

Archive for the ‘Work’ Category

AS3 liquid layout class

April 8th, 2009

I’m sure everyone has needed one of these at one time or another. I just decided to finally get one together for myself.

To use, you first call StageAlignTool.init() and pass in the stage, and optionally a minimum width and a minimum height (defaults to 1024×768).
Next, you call StageAlignTool.registerLocation() and pass in the displayObject you wish to register, which position you wish it to lock to (StageAlignTool .TL means Top Left, StageAlignTool.MC means Middle Center), and optionally if you want it to stay relative to where it is now (true) or snap to the edge of the stage (false).
The class automatically sets your stage scale mode to NO_SCALE and the stage align to TOP_LEFT. It also expects the display objects you pass it to have their registration points in the top left corner.

Download

Usage:


//StageAlignTool.init(Stage reference[, min width = 1024, min height = 768]);
StageAlignTool.init(stage, 1024, 768);

//StageAlignTool.registerLocation(a DisplayObject, position to lock to[, stay relative to current = false]);
//possible locations are [StageAlignTool.]TL, TC, TR, ML, MC, MR, BL, BC, BR

StageAlignTool.registerLocation(bg, StageAlignTool.MC);

Give it a try and tell me what you think.

Julian Work , , , ,

Adobe Flash Player 10 beta

May 15th, 2008

http://labs.adobe.com/technologies/flashplayer10/demos/

What does this mean for papervision 3d? I know a lot of the tools that team has built will soon become redundant but what of their work can they keep? Texture mapping perhaps, camera movement (I don’t think adobe’s version of 3d accounts for a camera in space)

Also, with Adobe’s tools, can you create a cube in 3d (say by rotating and aligning 6 sides) and then rotate that cube as a whole in 3d space?

Julian Work , ,

My TextFormat won’t stick to my TextField

April 1st, 2008

Run this SWF and click the button, the text stays pink.
Then run this and click on the text, then click the button.
The text defaults size and color. Why??????textFormatBug

var titleTF:TextFormat = new TextFormat();
titleTF.color = 0xFF00FF;
titleTF.size = 22;
//titleTF.font = avantBold.fontName;
var titleText:TextField = createTF(10, 10, 200, 26, true, titleTF, “This is a test”);
addChild(titleText);

function createTF(_x:Number, _y:Number, _width:Number, _height:Number, _autoSize:Boolean, _defaultTF:TextFormat, _text:String):TextField {
var tf:TextField = new TextField();
tf.x = _x;
tf.y = _y;
tf.width = _width;
tf.height = _height;
tf.autoSize = (_autoSize) ? TextFieldAutoSize.LEFT : TextFieldAutoSize.NONE;
tf.wordWrap = true;
tf.multiline = true;
tf.defaultTextFormat = _defaultTF;
tf.htmlText = _text;
//tf.setTextFormat(_defaultTF);
return tf;
}

clicker.addEventListener(MouseEvent.CLICK, swapText);

function swapText(e:*):void{
titleText.htmlText = “This is now a changed test” + String(Math.random());;
}

Julian Work , , ,

Web Services in AIR (Flash CS3)

March 19th, 2008

I have been banging my head against a wall for days. I am trying to get web services to work in an AIR app built with Flash CS3. My co-workers use a solution that works for Flash only http://labs.qi-ideas.com/2007/12/25/using-flex-compiled-code-within-flash

But every time I tried to use it with an AIR app it would crash.

I then found http://manmachine-tech.blogspot.com/

but after days of frustration I found a critical bug:

In the WSProxy class there is a variable _busyOnCall = true; that gets set within callMethod()

and it gets set to false in onComplete()

but it NEVER GETS SET IN onFault

After that it’s all good. I hope this helps anyone in the same boat as myself.

Julian Work , , ,

How do I use Yahoo! Maps API in Flash CS3?

February 14th, 2008

I was really excited about the new Yahoo! Maps API coming out for AS3 and I happily applied for a developer key and downloaded it. However, it’s compiled for Flex! How the heck am I supposed to use this? Is there some source repository I can get a hold of so I can use the classes in Flash CS3? There’s no apparent reason for it to be limited to Flex as far as I can tell. Anyone have any thoughts?

Julian Work ,

Adobe AIR 1.0 soon

February 13th, 2008

I can feel it in my bones. And I can’t wait because I’ve wanted to deploy an AIR app for so long but it’s a hard sell to a client to say “Users will have to download a framework, then the app, and then in 2 months update both when it goes 1.0″

This will be a defining moment for Adobe and the web.

Julian Work ,

SWF Capture AIR app

December 7th, 2007

I’m currently working on an AIR app that will load a SWF, take screen grabs at a selected interval and then load the screen grabs back in and allow you to scrub back and forth through them.
The main purpose for this is that many things my coworkers and I do at RT is entirely dynamic and code based with very little on the timeline. This app allows for selecting a specific frame in any SWF, code or timeline based, and for playing back the animation many times repeatedly.
A side benefit to the app is that when creating backup GIFs for banner ads, if you run your banner through this app, will spit out cropped captures of your banner ad and may speed up the most boring part of banner ad creation.
If you’re feeling daring you can install this alpha version of SWF Capture and see how it works
I’ve got a lot of features left to build in but this does the basics.

Also, if you’re interested I’ve got my Flapture FLV Capture toolavailable too. It automates one screen grab per FLV for a folder full of FLVs and was how I learned the basics of AIR.

Julian Work , , , ,

Latest project: save-my-relationship.com

November 8th, 2007

See my latest at:

http://save-my-relationship.com/

It is a landing page for a banner campaign for Energizer’s Energi To Go iPod charger. The concept was mocking ‘relationship aide’ products such as Viagra or even dating sites. One huge bug though is that something with the Tween class in ActionScript 3 makes some tweens just decide to up and stop when running in Firefox, which means that if you’re visiting with FF you’ll only see the HTML page :( If you would like to give me your feedback on the Flash version it’s directly linked here

Julian Work , , , ,