Get Adobe Flash player

FlashApplications

J.Sontag
  • Home
  • Impressum
  • About Me
  • Kontakt

MY CONVICTION

8. Juli 2009 Jörg Sontag Kommentare ausgeschaltet

Love FLASH ActionScript3 need Design Patterns for FLEX Life

and like to play on AIR Desktops

KategorienAllgemeines Tags: ActionScript3, Air, Applikation, AS3, Begeisterung, Flash, Flex, Leidenschaft

Entry into AS3 Signals

1. September 2010 Jörg Sontag Keine Kommentare

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)

AS3_Signals

Ok that ´s all. If you have some questions just feel free to post it here.

KategorienActionScript3, FlashLab Tags: AS3, Framework, Signals

AS3 random Range

27. August 2010 Jörg Sontag Keine Kommentare

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
KategorienAS3 Snippets, FlashLab Tags: AS3, Snippets

AS3 format Numbers 0-9 to 01,02…

27. August 2010 Jörg Sontag Keine Kommentare

private function formatNumber(nr : uint) : String {
return (nr < 10) ? "0"+ nr : String(nr);
}

Sample:

var myNumber:String = formatNumber(8);

returns : 08
KategorienAS3 Snippets, Allgemeines Tags: AS3, Code, Snippets

A new Toy for us AR.Drone

16. August 2010 Jörg Sontag Keine Kommentare

I found that on Twitter and isn´t it Crazy?

AR.Drone

AR.Drone

First quadricopter that can be controlled by an iPhone/iPod Touch/iPad

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.  ;)

KategorienAllgemeines Tags: Amazing, Ar Drone, Toy

AS3 Accessor Performance

12. August 2010 Jörg Sontag Keine Kommentare

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 :

http://wonderfl.net/c/ywZH

KategorienActionScript3, Allgemeines Tags: Accessor, ActionScript 3.0, ActionScript3, AS3, Experiment, usefull
Ältere Einträge
RSS
  • Google
  • Youdao
  • Xian Guo
  • Zhua Xia
  • My Yahoo!
  • newsgator
  • Bloglines
  • iNezha
Twitter

Flash Conferences:

ffk10

Brighton 26th-29th Sept. 2010

FDT

Kategorien

  • Allgemeines (15)
  • BookLists (1)
  • Desktop (1)
  • FlashLab (18)
    • ActionScript3 (13)
    • AS3 Snippets (3)
  • Games (6)
  • Referenzen (11)

Archiv

  • September 2010 (1)
  • August 2010 (10)
  • Juli 2010 (2)
  • Juni 2010 (2)
  • April 2010 (2)
  • März 2010 (2)
  • Februar 2010 (2)
  • Januar 2010 (1)
  • August 2009 (8)
  • Juli 2009 (5)

Tag Cloud

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.

Latest Tweets

Flashapplicatio@Flashapplicatio
  • Jörg Sontag RT: @andremichelle: Mittagspause im http://www.antipreneur.de noch bis 14:00Uhr - posted on 03/09/2010 12:41:15
  • Jörg Sontag 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
  • Jörg Sontag 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
My Twitter, by Xhanch

Flash-Blogs:

  • actionscript microcosmos
  • Beautify Code
  • blog.joa-ebert.com
  • ByteArray
  • FlashRealTime
  • gBlog
  • Hawaii Flash User Group
  • Mario Klingemann
  • Seb Lee-Delisle Blog
  • The Way of Flex
  • theFlashBlog
  • unitzeroone

Flash-Links:

  • Beautifl-Flash Gallery
  • Creative Applications
  • FIVe3D
  • Flash & Math
  • Flashforum
  • gotoandlearm.com
  • Papervision3D
  • Powerflasher FDT 3
  • RobotLegs AS3
  • wonderfl

Flash-Talks

  • Grant Skinner Talks

Valid XHTML 1.0 Transitional

Oben WordPress
Copyright © 2009-2010 FlashApplications
Theme by NeoEase. Valid XHTML 1.1 and CSS 3.