Waiting for events in flash

Friday, August 24th, 2007

You really have to wait for them!

Right - when you load XML for example in something like a repository object and then you want to get at what it may have loaded up such as an array of objects you need to wait until it has actually loaded!

To do this add a public function in the Repository class called onLoad:

public var onLoad:Function = function(){};

And then pass true or false or whatever to this function when done:

repository.onLoad(true);

or if not

repository.onLoad(false);

When using this repository we can now get at this by:

_demoRepository = demoRepository;
var demo:Demo = this;
_demoRepository.onLoad = function() {
//do something now we know it has loaded!
}

In this case we may want to call something on the object calling the repository so we create an instance of itself and that reference will be pulled in.

Flash Lite optimisation

Wednesday, July 18th, 2007

Really useful tips on optimsing for flash lite. Also useful tips for flash in general:

http://www.gotoandplay.it/_articles/2005/09/cc.php

Using XRay with FlashDevelop

Friday, July 6th, 2007

useful post:

http://www.flashdevelop.org/community/viewtopic.php?t=1253

Download the Connector Only version. I found the link at http://osflash.org/xray but you can hit it directly here .
Unzip and place the classes in your classes folder (ok, that part was obvious).
Place the xrayConnector_1.6.2.swf in the folder that your swf compiles to. That is probably the root of your project. (Where your .fdp file is).


In your entry point function, add this line: var connect:com.blitzagency.xray.util.XrayConnect = com.blitzagency.xray.util.XrayConnect.getInstance(_root, true);
Finally, compile the swf under test and run the Xray client.Â

ASUnit test assertions

Friday, July 6th, 2007

Useful list of available assertions in AS unit - until they actually get buried into my brain they can stay here:

assertEquals(msg:Object, assertion1:Object, assertion2:Object)

assertNull(msg:Object, assertion:Object)

assertNotNull(msg:Object, assertion:Object)

assertUndefined(msg:Object, assertion:Object)

assertNotUndefined(msg:Object, assertion:Object)

assertSame(msg:Object, object1:Object, object2:Object)

assertTrue(msg:Object, assertion:Boolean)

assertFalse(msg:Object, assertion:Boolean)

Fuse Documentation

Tuesday, July 3rd, 2007

http://www.mosessupposes.com/Fuse/fuse2docs/index.html

Easing Class - a list of types

Tuesday, July 3rd, 2007

Categories

Strong
Back
Elastic
Regular
Bounce
None

Types

easeIn
easeOut
easeInOut
easeNone

Also useful for reference but just use fuse!

 http://www.actionscript.org/resources/articles/170/1/Flash-MX-2004-Undocumented-TweenEasing-Classes-Documented/Page1.html

Flade Flash Dynamics engine - Really useful!

Wednesday, June 27th, 2007

http://www.cove.org/flade/

Actionscript Unit Testing ASUnit

Thursday, June 21st, 2007

This is a great tutorial for getting started using ASUnit:

http://www.flashcodersny.org/wordpress/?p=103Â

Flash NetStream Object Rererance

Wednesday, June 20th, 2007

Found this whilst getting captions working for a FLV.

http://www.brajeshwar.com/reference/as2/NetStream.html

Open Source Flash - the place to look first….

Tuesday, June 19th, 2007

http://osflash.org/projects