Posts tagged flash

Murten does an air app!

0

It took a little longer than expected but here I am again sending messages to the interweb!

A few weeks ago I made an application that streams a couple of webcams totally live with the help of red 5.

“Well… that’s nice, little boy” I hear you guys and girls think, if it wasn’t for the totally awesome fact that some great people actually liked it and decided to feature it in their design book! This does not only mean that my application works but also that it looks nice!

I truly believe you guys and girls are as anxious as I am so I was so generous to provide you all with a screenshot.

spaceApp

Until then: keep watching the stars! (haha.. *ahum*)

Actionscript 3.0 Key Listener after button-click

0

Today I found out that a Actionscript 3.0 Key Listener doesn’t work after a button-click until you click somewhere on the stage. Ofcourse I made it a quest to find out how I could easily fix this and behold!

The problem

private function someFunction():void {
	start_btn.addEventListener(MouseEvent.CLICK, clickHandler);
	start_btn.buttonMode = true;	
}
 
private function clickHandler(e:Event):void {
	removeChild(start_btn);
	stage.addEventListener(KeyboardEvent.KEY_DOWN, downHandler);
}
 
private function downHandler(e:Event):void {
	trace("heej");
}

It will not do the trace until you click the stage. So I went on a searching spree and together with my good friend Frederik “the wonderkid” Humblet found out that “stage.focus = null;” fixes it. Well, he found out, but I steal the credits by posting it for you all!


The solution

private function someFunction():void {
	start_btn.addEventListener(MouseEvent.CLICK, clickHandler);
	start_btn.buttonMode = true;	
}
 
private function clickHandler(e:Event):void {
	removeChild(start_btn);
	stage.focus = null;
	stage.addEventListener(KeyboardEvent.KEY_DOWN, downHandler);
}
 
private function downHandler(e:Event):void {
	trace("heej");
}

Until next time my dear readers!

Embedding fonts in actionscript 3.0

0

Embedding a font is what you do if you don’t want the user viewing his own version of the font or – even worse – a totally different font.

Embedding a font is quite useful for a couple of reasons, namely:

- You can rotate embedded fonts.
- The text looks alot more smooth.
- Your text supports transparency.

If you’re looking for a universal way to easily embed your fonts in actionscript 3.0 this may be the class you want!

Originally written by my main man Jannes this class basically sets all the stuff you need to embed a font and therefore is a must have for every serious developer.

(more…)

Go to Top