flamingsquirrel

Archive for the ‘Flex’ Category

Actionscript 3 Simple click EventListener

Monday, February 23rd, 2009

If like me you are making the transition from Actionscript 2 to 3 you may well find that creating simple onPress functions don’t use the same syntax. I checked the Adobe help files but got confused by the overly complex details.

If you want a simple clickable moveClip use the following code. The first line means that the movie clip will act like a button and the cursor will change when the mouse is hovering over.

movieclip_name.buttonMode = true;
movieclip_name.addEventListener(MouseEvent.CLICK, onClick);

function onClick(event:MouseEvent):void{
trace(“Yes, this works!”)
}

Flex bandwidth profiler

Monday, February 23rd, 2009

I have just started learning Flex and realised there is no way to test the download speed of your movie and whether your preloader is working as it should – like you can with the bandwidth profiler in Flash.

After a quick search I decided that Charles met my requirements. I have had a quick play with it and the interface is well designed, it has a Firefox extension and most importantly I can test my Flex preloaders are working! It also works on OSX which means I can use it on my home machine as well. Its seems to be a great bit of software and well worth testing.

Update – I couldn’t figure out how to get it to throttle my bin-bug folder which resides on my local drive. To get around this I created a new workspace on my local server (http://localhost/flex/….) which solved the problem. This probably isn’t the correct way to set-up your Flex development environment….. any advice appreciated.

Subscribe to this site