MY CONVICTION
Love FLASH ActionScript3 need Design Patterns for FLEX Life
and like to play on AIR Desktops
Love FLASH ActionScript3 need Design Patterns for FLEX Life
and like to play on AIR Desktops
Signals: Think Outside the Event.
Signals are light-weight, strongly-typed AS3 messaging tools.
Wire your application with better APIs and less boilerplate than AS3 Events.
AS3 Signals Download: http://github.com/robertpenner/as3-signals
AS3 Signals Hello World: http://wiki.github.com/robertpenner/as3-signals/hello-world
Short Tutorial:
I build some Simple Classes to better understand what you can do with the Signals from Robert Penner
Ok, get startet:
The NativeSignal is Simple easy. I used it to call the onAdded Function.
NativeSignal:
name = new NativeSignal(target, eventClass.constant, eventClass);
name.method(listener);
public function Bubble() {
var addSignal : NativeSignal = new NativeSignal(this, Event.ADDED, Event);
addSignal.addOnce(onAdded);
}
If you want to have a Mouse Signal just take a NativeSignal:
private var _mouseSignal : NativeSignal = new NativeSignal(_sprite, MouseEvent.CLICK);
private function onAdded(e : Event) : void
{
_mouseSignal.add(onClicked); // isn´t it easy
}
private function onClicked(e : MouseEvent) : void {
trace("MOUSE Clicked");
}
And for a Custom Signal just take the Signal Class:
Signal:
// A Signal that will dispatch a String and an integer:
progress = new Signal(String, int);
//later:
progress.dispatch(); // will throw ArgumentError
progress.dispatch(‘The Answer’); // will throw ArgumentError
progress.dispatch(‘The Answer’, 42.5); // will throw ArgumentError
progress.dispatch(‘The Answer’, 42); // will succeed
public var _customSignal : Signal = new Signal(String);
private function onClicked(e : MouseEvent) : void {
trace("MOUSE Clicked");
_customSignal.dispatch("Hello from:" + e.currentTarget + " CLASS:" + this);
}
Ok now the Main CLass or we want to listen to the Signals!
Here you have to get the _customSignal and simple add a listner on it
_bubble._customSignal.add(listenToBubble);
public class Main extends Sprite {
private var _bubble : Bubble;
public function Main() {
_bubble = new Bubble();
_bubble._customSignal.add(listenToBubble);
addChild(_bubble);
}
// Receive the value dispatched from the Signal.
// This is like an event handler but without the Event wrapper.
private function listenToBubble(value : String) : void {
trace(value);
trace("Number of Listner:" + _bubble._customSignal.numListeners);
}
}
Download Sample (includes the Signals SWC)
Ok that ´s all. If you have some questions just feel free to post it here.
private function randRange(minNum:Number, maxNum:Number):Number
{
return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
}
Sample:
var Count:Number = randRange(0,12);
returns: a Number between 0-12
private function formatNumber(nr : uint) : String {
return (nr < 10) ? "0"+ nr : String(nr);
}
Sample:
var myNumber:String = formatNumber(8);
returns : 08
I found that on Twitter and isn´t it Crazy?

AR.Drone
Thanks to its on-board Wi-Fi system, you can control the Parrot AR.Drone using an iPhone®, iPod Touch®, or an iPad®. It was initially designed for the Apple platforms and will be also available on other platforms in the next few months.
More Info and Videos:
http://ardrone.parrot.com/parrot-ar-drone/en
I want to have one …. please Santa C.Â
Today i think about the usage from getter / setter or public vars in Classes. First it was to know that you call a Method when you call a setter / getter.
I found on wonderfl a Performance Test and the Result is Amazing!!!
classA use public Vars
classB use setter / getter
object(set only)————————
classA > 311 ms
classB > 636 ms
string(set only)————————
classA > 85 ms
classB > 532 ms
int(set only)————————
classA > 32 ms
classB > 508 ms
object(get only)————————
classA > 29 ms
classB > 450 ms
string(get only)————————
classA > 30 ms
classB > 452 ms
int(get only)————————
classA > 29 ms
classB > 452 ms
object(set/get)————————
classA > 228 ms
classB > 1105 ms
the hole Test on :
3D 3DText Accessor ActionScript2.0 ActionScript3 ActionScript 3.0 Air Applikation Ar Drone AS3 Autorennen Begeisterung DesignPattern E-Paper Entwurfsmuster Experiment Five3D Flash Flex Framework Fun Game Hype Lab Leidenschaft Light LinkList Mixer MySQL online OOP PHP Plugin Portal Rechner Schieberegler Snippets Sound Technik twitter Typo3 usefull Widget Wordpress XML
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
RT: @andremichelle: Mittagspause im http://www.antipreneur.de noch bis 14:00Uhr - posted on 03/09/2010 12:41:15
Try to delete a Sound Channel or Sound may i put it in an Object and delete this on??? anybodyknow this Prob? - posted on 03/09/2010 12:40:53
RT: @seb_ly: RT @Richard_Lord: How Big is That? BBC Dimensions - http://howbigreally.com/ < v cool! - posted on 02/09/2010 14:35:25