<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog . sebastian martens &#187; Flex</title>
	<atom:link href="http://blog.sebastian-martens.de/category/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sebastian-martens.de</link>
	<description></description>
	<lastBuildDate>Fri, 03 Feb 2012 15:55:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>FOTB 2010 Brighton</title>
		<link>http://blog.sebastian-martens.de/2010/10/fotb-2010-brighton/</link>
		<comments>http://blog.sebastian-martens.de/2010/10/fotb-2010-brighton/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 11:39:38 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[André Michelle]]></category>
		<category><![CDATA[Andrew Shorten]]></category>
		<category><![CDATA[Audiotool]]></category>
		<category><![CDATA[Branden Hall]]></category>
		<category><![CDATA[Brighton]]></category>
		<category><![CDATA[Cyriak Harris]]></category>
		<category><![CDATA[Doug Winnie]]></category>
		<category><![CDATA[Flash on the Beach]]></category>
		<category><![CDATA[Flash Usergroup Ruhrgebiet]]></category>
		<category><![CDATA[Flex UG HH]]></category>
		<category><![CDATA[FOTB]]></category>
		<category><![CDATA[Grant Skinner]]></category>
		<category><![CDATA[Hoss Gifford]]></category>
		<category><![CDATA[Hype Framework]]></category>
		<category><![CDATA[Jared Tarbell]]></category>
		<category><![CDATA[joa ebert]]></category>
		<category><![CDATA[Joshua Hirsch]]></category>
		<category><![CDATA[Julien Vallée]]></category>
		<category><![CDATA[Mario Klingemann]]></category>
		<category><![CDATA[Nando Costa]]></category>
		<category><![CDATA[Ralph Hauwert]]></category>
		<category><![CDATA[Richard Galvan]]></category>
		<category><![CDATA[Robert Hodgin]]></category>
		<category><![CDATA[Stefan Sagmeister]]></category>
		<category><![CDATA[The Elevator Pitch]]></category>
		<category><![CDATA[Thibault Imbert]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=531</guid>
		<description><![CDATA[Gleich vorweg: Meine erste Flash on the Beach Erfahrung wird definitiv nicht meine letzte bleiben &#8211; das ist sicher! John schafft es auf beeindruckende Weise hochkarätige und interessante Speaker zusammenzutragen, die die gesamte Konferenz zu einem inspirierenden Erlebnis für Entwickler und Kreative generell werden lässt. Ganz egal ob man sich dann auch noch mit Flash [...]]]></description>
			<content:encoded><![CDATA[<p>Gleich vorweg: Meine erste Flash on the Beach Erfahrung wird definitiv nicht meine letzte bleiben &#8211; das ist sicher! John schafft es auf beeindruckende Weise hochkarätige und interessante Speaker zusammenzutragen, die die gesamte Konferenz zu einem inspirierenden Erlebnis für Entwickler und Kreative generell werden lässt. Ganz egal ob man sich dann auch noch mit Flash beschäftigt oder nicht ( auch wenn Flash natürlich ganz klar der Grund und der Fokus der Veranstaltung ist ).</p>
<p>Die FOTB fand im Brighton Dome und näherer Umgebung statt. Es gab bis zu vier parallele Sessions. Für alle die, die keinen Workshop am Sonntag gebucht hatten fing es Montag morgen mit dem Check-In an. Wäre schön gewesen hätte man sein Mobiltelefon auf UK-Zeit umgestellt. Dann hätte man noch ausschlafen können und wäre nicht eine Stunde zu früh.</p>
<p>Nicht nur der Brighton Dome ( ein altes Theater mit entsprechend größer Bühne und klasse Sitzen ) machte gleich zu Beginn Eindruck. Auch das Opening-Video lässt das kreative Herz höher schlagen:</p>
<p><object width="455" height="280"><param name="movie" value="http://www.youtube.com/v/1Qj6ESzZP2Q?fs=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/1Qj6ESzZP2Q?fs=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="455" height="280"></embed></object><span id="more-531"></span></p>
<p>Die Keynote machen Andrew Shorten, Thibault Imbert, Richard Galvan und Doug Winnie. Alle samt Produktmanager bei Adobe. Es gab wenig Neues. Aber es gab noch eine kleine Preview vom nächsten Flash Player zusehen. Gerade die Mac-User dürften sich freuen, wurde doch endlich deutlich an der Video-Performance Schraube gedreht. Mehr GPU lässt den Flash Player nicht mehr bei 80% sondern 5% CPU-Auslastung bei der Videowiedergabe sein Werk verrichten.</p>
<p>Weiter ging es mit Grant Skinner. Weg vo Code, hin zur Inspiration und was man mit Flash sonst noch so machen kann und ganz. Nimm dir die Zeit &#8211; und plane das am besten auch fest ein &#8211; etwas Neues auszuprobieren. Was gibt die Technologie sonst noch so her. Daraus ergeben sich dann neue Projekte ( und Kunden ) schneller als man das gedacht hätte. Dazu zeigte er seinen eigenen Experimente. Z.B. das <a  href="http://vimeo.com/12574396" target="_blank">Steuern der Carrera Bahn mit einem Android-Phone-Pedal</a>, dem <a  href="http://vimeo.com/12752382" target="_blank">Android-Phone-Multiplayer-Game-Controler</a> oder dem <a  href="http://vimeo.com/13594037" target="_blank">Steuern der Carrera Bahn mit Hilfe von Sound</a> ( welches Kind freut das nicht &#8211; besonders die Großen ).</p>
<p>Next: Andre Michelle: Audio &#8211; was den sonst. Nichts wirklich Neues an dieser Front, aber in dem Saal ist der Sound einfach großartig. Da kann man auch einfach mal genießen was andere mit dem <a  href="http://audiotool.com/" target="_blank">Audiotool</a> so zaubern !</p>
<p>Next: Mario Klingemann. Mario hatte angekündigt, dass er nach diesem Vortrag erst einmal eine kreative Auszeit nehmen wolle. Also vorerst die letzte Chance Mario Klingemann auf der Bühne zu sehen. Das muss man sich dann natürlich auch ansehen. Wie immer wird man nicht enttäuscht. Höhepunkt: Wie baue ich in ein paar Tagen ein Tool aus einer Kamera und Flash, dass mir automatisch eine Puzzle löst &#8230;</p>
<p><a  href="http://hossgifford.com/">Hoss Gifford</a>: &#8220;Things i have learned&#8221;. Im Grunde schon eine &#8220;Get Inspired Session&#8221;. Der Vortrag ist nur schwer zu beschreiben. Aber er hat recht. &#8220;Frühstück ist die wichtigste Mahlzeit des Tages. Nimm dir die Zeit.&#8221;. Es ging nicht nur um die simplen, alltäglichen Dinge, die dann doch irgendwie nicht mehr selbstverständlich sind, aber dann eigentlich doch. &#8220;Warum gehe ich nicht jeden Tag meine Aufgaben so an, wie an dem Tag bevor ich in den Urlaub fahre.&#8221;</p>
<p>Next: Robert Hodgin: So gut, dass John scheinbar bewusst keinen andere Session zur gleichen Zeit angesetzt hat. Eine audiovisuelles Erlebnis der besonderen Art. Als Einleitung von John: &#8220;Wer benutzt iTunes ? Wer kenn in iTunes die Visualisierung zu den Songs ? Das ist der Mann der das gemacht hat!&#8221;. Hier mal ein sehr schönes Beispiel ( auch das im Theater mit riesiger Leinwand und super Sound natürlich &#8220;etwas&#8221; besser ):</p>
<p><object width="455" height="280"><param name="movie" value="http://www.youtube.com/v/TwQ_BwRTDFs?fs=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/TwQ_BwRTDFs?fs=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="455" height="280"></embed></object></p>
<p>Nach drei Stunden Pause und dem einem Freigetränk an der Bar ging es abends um 20h nochmal zur &#8220;Inspired Session&#8221;. Redner am ersten Tag: Stefan Sagmeister mit &#8220;Design and Happiness&#8221;. Wer irgendwann mal die Chance hat diesen Menschen live zu erleben, sollte dies unbedingt tun. Eine wirklich interessante Persönlichkeit. Der gute Mann ist erfolgreicher Designer. Eines seiner Geheimrezepte: Auszeit nehmen. Und in der Tat macht er alle paar Jahre ( 5-6 ) ein Jahr Pause von der normalen Arbeit um für sich kreativ zu sein. Letztendlich mit dem Erfolg, dass es sich nicht nur persönlich, sondern auch monetär für ihn auszahlt. Eine echte &#8220;Inspired Session&#8221;. [Update: Ted Talk von Ihm, quasi das gleiche: <a  href="http://www.ted.com/talks/lang/eng/stefan_sagmeister_the_power_of_time_off.html" target="_blank">http://www.ted.com/</a> ]</p>
<p>Der Abend klingt aus bei eine paar Cola und gemütlichem Beisammensein ! Grüße an die <a  href="https://www.xing.com/net/ugruhrgebiet">Flash Usergroup Ruhrgebiet</a>.</p>
<p>Tag 2</p>
<p>09.00 Uhr &#8211; &#8220;The Elevator Pitch&#8221;: 20 hochmotivierte Künstler / Coder / Speaker haben 3 Minuten Zeit um zu zeigen was sie können. Der Gewinner wird im Nachgang ermittelt und bekommt im nächsten Jahr eine eigene Session. Es war in der Tat ein bunt gemischter Haufen mit Vorträgen bei denen man sich schon gefragt hat &#8211; warum ?! &#8211; und sehr eindrucksvollen Präsentationen bei denen man gerne mehr als 3min gesehen hätte.</p>
<p>Branden Hall: Bisher hatte ich noch nicht die Gelegenheit mir das <a  href="http://www.hypeframework.org/">Hype Framework</a> mal anzusehen und mal schauen wie lange es dauert, bis ich wirklich dazu komme ( -> Auszeit für die Kreativität nehmen ), aber man sollte es auf jeden Fall mal tun. Mit diesem Visualisierungsframework lassen sich wunderbare Sache erschaffen. Besonders erfreut hat mich die Ankündigung, dass auch erste Sachen nach JavaScript portiert wurden ( mehr als Versuch und weniger als dauerhafte Lösung wegen Zeichenperformance &#8211; Flash bleibt Nummer 1 ).</p>
<p>Joa Ebert: Eigentlich dürfte man schon gar nicht mehr zu den Vorträge gehen. Man geht immer mit dem Gefühl raus: &#8220;Was mache ich eigentlich den ganzen Tag.&#8221; Heute: Wir bauen uns einen eigenen Flash Player. Aus Joas stetiger Bemühung der Flash Plattform mehr Performance zu entlocken und dar kompilierte Gut zu optimieren, was derzeit in seinem <a  href="http://code.google.com/p/apparat/" target="_blank">Apparat Framework</a> mündet, ist JITB der jüngste Spross. Letztendlich geht es darum bestehenden ActionScript Code in Java zu wandeln um diesen dann in der wesentlich performanteren JVM laufen zu lassen &#8211; also der Flash API innerhalb von Java. Einfaches und eindrucksvolles Beispiel: Ein winziges Skript, dass einfach nur ein paar tausend Instanzen eines Objektes erzeugt: Laufzeit Flash Player 560ms. Laufzeit in Java nach JITB: 16ms. Liebes Flash Player Team: Da geht noch was bei euch :)</p>
<p>Next: Florian Schmitt &#8211; &#8220;Business in the front &#8211; arty in the back.&#8221; Anfänglich eine wenig schwer aber letztend ganz gut anzusehen.</p>
<p>Julien Vallée, ist ein Designer aus Montreal, den John auf der Offf, für die er auch den Opener kreierte, rekrutiert hat. Er zeigte tolle Entstehungsprozesse und Make Ofs von seine Produktionen für die New York Times oder MTV.</p>
<p><object width="455" height="280"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=12935124&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=12935124&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=1&amp;color=&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="455" height="280"></embed></object>
<p><a  href="http://vimeo.com/12935124">OFFF Paris 2010 Sponsors titles</a> from <a  href="http://vimeo.com/julienvallee">Julien Vallée</a> on <a  href="http://vimeo.com">Vimeo</a>.</p>
<p>Nando Costa &#8211; ein Designer aus den USA, der z.B. den bereits beworbenen Introfilm zur FOTB2010 begesteuert hat, zeigte Einblicke in seine Arbeit, und u.a. das Making Of zu dem Introfilm. Projekte die gelungen sind und Pitches die letztendlich an andere Studios gingen.</p>
<p>Pause, Freigetränk und Ready for Inpsired Session</p>
<p>Brendan Dawes &#8211; &#8220;Makers of Things&#8221;: Talk &#8211; Action = Shit. Eine Reise durch ein paar Jahr(zehnt)e in der digitalen Produktion und Projekten die Brendan gemacht hat. Den ganzen Vortrag gibt es bereits auf seiner Webseite zu sehen: <a  href="http://www.brendandawes.com/project/makers-of-things/" target="_blank">http://www.brendandawes.com/project/makers-of-things/</a></p>
<p>Mehr Bar, mehr den Abend genießen.</p>
<p>Tag 3</p>
<p>Es geht los mit &#8220;6 of the Best &#8211; 10 Mins Each&#8221;. Irgendwie rissen die Sachen leider nicht so vom Hocker, wie man sich das bei dem Titel gewünscht hatte. Trotzdem wert so früh aufzustehen. Auch wenn es nicht live gecodet war, es gab noch mehr von Robert Hodgin zu sehen. Traumhaft.</p>
<p>Robert Reinhardt: Hab ich irgendwie verpasst. Wir haben uns mehr mit dem Gewinnspiel beschäftigt. Den auch in diesem Jahr gab es einen Fotowettbewerb. Die besten Bilder die mit der offiziellen Flash on the Beach Mütze eingereicht werden bekommen Freikarten für das nächste Jahr. Wir haben ein wenig außer der Reihe dann mehr ein Video eingereicht. Hier der Beitrag der Flex Usergroup Hamburg und der Flash Usergroup Ruhrgebiet:</p>
<p><object width="455" height="280"><param name="movie" value="http://www.youtube.com/v/X5ImhSE_h5M?fs=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/X5ImhSE_h5M?fs=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="455" height="280"></embed></object></p>
<p>Letztendlich gab es dann doch noch ein Ticket dafür, John: &#8220;I give it to the nacked guy.&#8221;</p>
<p>Ralph Hauwert &#8211; Auch immer wieder sehenswert. Mehr Code, mehr Mathe, viel 3D &#8211; am besten selber sehen !</p>
<p>Cyriak Harris &#8211; &#8220;Animated Mental Malfunctions&#8221;. Der Titel trifft es eigentlich. Wenn auch nicht in Flash umgesetzt sondern in After Effects is es ein großartiges visuellens und Hirnschmelzendes Erlebnis. Also mal &#8220;Cyriak Harris&#8221; Videos bei YouTube schauen !!! Weniger &#8220;Mental Malfunctions&#8221; aber zusammen mit der Musik sehr gelungen:</p>
<p><object width="455" height="280"><param name="movie" value="http://www.youtube.com/v/QNwCojCJ3-Q?fs=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/QNwCojCJ3-Q?fs=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="455" height="280"></embed></object></p>
<p>Joshua Hirsch ist technischer Leiter bei der Agentur &#8220;The Big Spaceship&#8221;. In seinem &#8220;Summer Fridays&#8221; berichtet er über die Erfahrung mit der kreativen Freizeit. So wird in der Agentur der Freitag Nachmittag in der Regel für interen Projekte genutzt und nicht für Kundenarbeit ( bei dringenden Deadlines mal ausgenommen ). Auch wenn Google in diesem Bereich immer noch den größten Freiraum gewährt ( offiziell 20% für eigene Projekte ) so gibt es auch bei Freitag Nachmittagen entsprechend interessantes das sich letztentlich auch für die Agentur lohnt.</p>
<p>Der letzte Vortrag gehörte Jared Tarbell. Der Designer und Entwickler ist u.a. Co-Founder von etsy.com. und derzeit begeistert von algorithmisch generierter Kunst. Beispiele hier: <a  href="http://www.complexification.net/" target="_blank">http://www.complexification.net/</a>.</p>
<p>Fazit: Flash on the Beach 2011 &#8211; Ich komme !</p>
<div id="attachment_533" class="wp-caption alignnone" style="width: 160px"><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2010/10/IMG_0256.jpg" class="thickbox no_icon" rel="gallery-531" title="Flex UG HH is everywhere"><img src="http://blog.sebastian-martens.de/wp-content/uploads/2010/10/IMG_0256-150x150.jpg" alt="Flex UG HH is everywhere" title="IMG_0256" width="150" height="150" class="size-thumbnail wp-image-533" /></a><p class="wp-caption-text">Flex UG HH is everywhere</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/10/fotb-2010-brighton/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FFK10 &#8211; Day 1</title>
		<link>http://blog.sebastian-martens.de/2010/04/ffk10-day-1/</link>
		<comments>http://blog.sebastian-martens.de/2010/04/ffk10-day-1/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 19:23:53 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=369</guid>
		<description><![CDATA[Hallo und Humppa nach Norddeutschland, wie immer: wer nicht gerade in Köln bei der Flash Forum Konferenz (FFK10 &#8211; http://ffk10.flashforum.de) ist der verpasst etwas. Dieses Jahr geht das Treffen der größten deutschen Community zum Thema Flash und Flash Plattform in die bereits 10 Runde. Wieder einmal konnte die Konferenz mehr Teilnehmer als im Vorjahr anlocken. [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo und Humppa nach Norddeutschland,</p>
<p>wie immer: wer nicht gerade in Köln bei der Flash Forum Konferenz (FFK10 &#8211; <a  href="http://ffk10.flashforum.de/">http://ffk10.flashforum.de</a>) ist der verpasst etwas. Dieses Jahr geht das Treffen der größten deutschen Community zum Thema Flash und Flash Plattform in die bereits 10 Runde. Wieder einmal konnte die Konferenz mehr Teilnehmer als im Vorjahr anlocken. In diesem Jahr sind es Runde 500.</p>
<h3>Keynote</h3>
<p>Wie schon im letzten Jahr kam die Keynot von <a  href="http://www.webkitchen.be/">Serge Jespers</a>, seines Zeichens Evangelist bei Adobe. Es gab wieder eine kleine Übersicht über die Flash Plattform und eine paar Demos zu den Neuerungen im Flash Player, die sich besonders im Mobile-Bereich zeigen. Serge zeigte auch ein Nexus One mit Flash Player. Den Vergleich zwischen HTML5 und Flash gewann natürlich der Flash Player ;) Nicht Teil der Demo ist natürlich das iPhone &#8211; aus aktuellem Anlass eine entsprechend häufiger belächeltes Thema allerortens.<br />
<span id="more-369"></span><br />
Nach der Übersicht gab es noch eine kleine Demo zur neuen Creative Suite 5 von <a  href="http://aflexworld.com/">Alex Ciorapciu</a>.<br />
In CS5 wird die Integration der Adobe und vormals Macromedia Produkten maßgebliche vorangetrieben. Der Datenaustausch zwischen der Software wird immer besser und beeindruckender, was z.B. das öffnen von InDesign in Flash angeht.<br />
Besonders beeindruckend war natürlich die Bildretusche in Photoshop. For zwei Versionen musste man noch aufwendig von Hand mehrere Bilder zusammenpinseln. In CS4 gab es schon ein &#8220;Content aware scaling&#8221; und man konnte mehrere Bilder zusammenführen um die Schnittmenge zu bekommen ( was z.B. Autos oder Fahrradfahrer, die nur in einem Bild auftauchen eleminiert ). Mit CS5 ist dafür nur noch ein langweiliger Pinsel notwendig der irgendwie aus nur einem Bild alles wegretuschiert was nicht gewünscht wird. Keine Ahnung wo der das Haus hinter dem Fahrradfahrer her holt ?!</p>
<h3>Flash Augmented Reality Workflow</h3>
<p><a  href="http://www.jessefreeman.com/">Jesse Freemann</a> zeigt uns seinen Workflow um Augmented Reality im Flash Player wahr werden zu lassen. Dazu muss natürlich erst nochmal gezeigt werden, was Augemented Reality überhaupt ist und was man damit machen kann. So richtig technisch wurde es nicht, aber für einen Überblick hat es gereicht und Spaß gemacht hat es auch noch. Also Objekte in Papervision erstellen und dann das <a  href="http://www.libspark.org/wiki/saqoosha/FLARToolKit/en">Flar Toolkit</a> benutzen. Fertig!</p>
<h3>iPhone-Entwicklung mit Flash CS5</h3>
<p>Der Vortrag von <a  href="http://www.netTrek.de/">Saban Ünlü</a> hatte natürlich eine unerwartete Brisanz bekommen durch die neueren Ereignisse, rund um das &#8220;Flash Verbot&#8221; auf dem iPhone und den Export einer Flash App als iPhone App. Dieser Vortrag schafft Klarheit über den langen Weg einer Anwendung auf das iPhone. Der Teil der dann noch in Flash CS5 eingetragen werden braucht ist erschreckend klein.</p>
<h3>Presentation Patterns</h3>
<p>&#8230; musste leider ausfallen, weil <a  href="http://florian.salihovic.info/blog">Florian Salihovic</a> sich mit chinesischem Essen angelegt und verloren hatte. Gute Besserung! Es soll zu spontanen Vorträgen gekommen sein &#8230;</p>
<h3>Intelligente online Videos auf Basis der Flash Plattform</h3>
<p><a  href="http://www.svenbrencher.de/">Sven Brencher</a> zeigt, dass es auch im Videobereich ordentlich vorangeht, was die Adobe Palette angeht. Natürlich sieht das immer ganz leicht aus wenn die das da vorne machen, aber es ist auch sehr beeindruckend zu sehen wie mit einem Storyboard der gesprochende Text erkannt wird letztendlich recht unkompliziert eine Videoanwendung entsteht, die weiß, welcher Text gerade gesprochen von welchem Sprecher gesprochen wird.</p>
<h3>Tanzen mit Krüken</h3>
<p>&#8220;Es gibt definitv dankbarere Plattformen als Flash, wenn es um dynamische Sound Generierung geht. Die spartanische Sound API von Flash ist bei der Klangerzeugung so nützlich wie einem Tänzer zwei Krüken beim Tango.&#8221; &#8211; so viel zur Erklärung des Titels. Das es trotzdem geht beweist <a  href="http://blog.andre-michelle.com/">André Michelle</a> natürlich spätestens seit dem <a  href="http://www.audiotool.com/">Audiotool</a> ( das jetzt endlich seine eigene Plattform hat, also fleißig ausprobieren und Tracks erstellen ). Natürliche wurde die Tonematrix rausgeholt und natürlich musste man ein Blick in das Audiotool werfen, aber es gab auch neues an der Audio-Kunst-Front. So hatte das wie immer begeisterte Publikum viel Spaß an der froh animierten Kombination aus Tönen und Physikengine &#8211; hüpfende Kugeln &#8211; toll.</p>
<h3>DIY Methodology, or, When Being Agile Can Break Your Back</h3>
<p><a  href="http://blog.snogboggin.com">Chris Pelsor</a>erzählt wie er Projekte angeht und welche Methoden für Ihn funktionieren und welche nicht. War auf jeden Fall sehr zu empfehlen. Sonst bitte unbedingt nochmal &#8220;<a  href="http://gettingreal.37signals.com/">Getting Real</a>&#8221; lesen. Man findet viel wieder.</p>
<h3>UnitZeroOne: Skunkworks</h3>
<p>Spaß! <a  href="http://www.unitzeroone.com/blog/">Ralph Hauwert</a> zeigt, dass sich 3D Objekte auch in Echtzeit wirklich flüssig animieren lassen, was wirklich wörtlich gemeint ist. <a  href="http://www.unitzeroone.com/blog/2010/01/20/pixelbender-raytracer-milkyball/">Demo gibts hier</a>. Oder wie man einen Raytracer in Flash baut. Impressiv &#8211; as usual !</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/04/ffk10-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use your Wii-Remote with the FlashPlayer &#8211; WiiFlash</title>
		<link>http://blog.sebastian-martens.de/2009/08/use-your-wii-remote-with-the-flashplayer-wiiflash/</link>
		<comments>http://blog.sebastian-martens.de/2009/08/use-your-wii-remote-with-the-flashplayer-wiiflash/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 20:12:43 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[com.nonstatics.GestureDetection]]></category>
		<category><![CDATA[Gesture Detection]]></category>
		<category><![CDATA[joa ebert]]></category>
		<category><![CDATA[lowpass filter]]></category>
		<category><![CDATA[Motion Detection]]></category>
		<category><![CDATA[Nintendo]]></category>
		<category><![CDATA[Thibault Imbert]]></category>
		<category><![CDATA[Wii]]></category>
		<category><![CDATA[Wii Remote Control]]></category>
		<category><![CDATA[WiiFlash]]></category>
		<category><![CDATA[Wiimote]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=204</guid>
		<description><![CDATA[You maybe know the Nintendo Wii and its controller the Wiimote. Joa Ebert and Thibault Imbert implement a AS3 package called WiiFlash which allows you to connect the Wiimote ( or Wii Remote Control ) with your Flash/Flex Application. The Wiimote uses several sensors to detect different motion values. It allows you to read the [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.flexughh.de/referenten/" style="border:0; padding:0; margin:0;"><img src="http://www.flexughh.de/images/ads/flexughh_speaker_234_60.jpg" width="234" height="60" border="0" title="Speaker at Adobe Flex User Group Hamburg - Germany" style="border:0; padding:0; margin:0 10px 5px 0; " align="left"/></a>You maybe know the <a  href="http://www.wii.com/">Nintendo Wii</a> and its controller the Wiimote. <a  href="http://www.joa-ebert.com/">Joa Ebert</a> and <a  href="http://www.bytearray.org/">Thibault Imbert</a> implement a AS3 package called <a  href="http://wiiflash.bytearray.org/">WiiFlash</a> which allows you to connect the Wiimote ( or Wii Remote Control ) with your Flash/Flex Application.</p>
<p>The Wiimote uses several sensors to detect different motion values. It allows you to read the acceleration value for X-,Y-, Z-axis and Roll, Pitch and Yaw, which is the rotation around the x-,y- and z-axis. So you have a lot more degrees of freedom than with a simple mouse or keyboard. A funny thing you could implement with this for example is <a  href="http://www.youtube.com/watch?v=PfrKkPLXWYk">WiiSpray</a>, which also uses the WiiFlash Lib.</p>
<p>The WiiFlash package consists of two parts. The first one is the WiiFlash Server. It&#8217;s written in C++ / .NET and handles the communication with the Wiimote. The second part is the WiiFlash ActionScript API, which gives you methods and events to get and handle the Wiimote data.<br />
<span id="more-204"></span><br />
The Wiimote communicates via Bluetooth with its endpoint. So the WiiFlash Server connects to your PCs or Mac Bluetooth stack and reads the data from the Bluetooth connection. This data are send via Socketconnection to the Flash Player. The WiiFlash AS3 API now converts the Wiimote binary protocoll into useable data. Which means you could directly read the values and also get update and/or change events if anything happens.</p>
<p><strong>Connect the Wiimote</strong><br />
The WiiServer is available for PC or Mac. At first you have to connect your Wiimote with your PC or Mac. That means you have to create a Bluetooth connection between them &#8211; pair them via Bluetooth. After this step the WiiFlash Server should be able to find the Bluetooth connection and create the connection to the Flash Player. Find a detailed description how to connect your Wiimote with your PC <a  href="http://wiiflash.bytearray.org/?page_id=25">here</a>.</p>
<p>After you could pair your PC/Mac with the Wiimote, disconnect the Wiimote and start the WiiFlash Server. When the server started connect your Wiimote again ( this is done by pressing the Buttons &#8220;1&#8243; + &#8220;2&#8243; of your Wiimote at the same time ). After a short time you should see the connected Wiimote at the WiiFlash Server. It shows you the Batterylevel and the Wiimote-ID. Both Server versions could connect up to four Wiimotes at the same time.</p>
<p>I did not test the WiiFlash under Windows Vista. But wit OSX 10.5.x you&#8217;ll get an Java error when you start the server:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Cannot launch Java application.  <span style="color: #006633;">Uncaught</span> exception in main method<span style="color: #339933;">:</span>
java.<span style="color: #006633;">lang</span>.<span style="color: #003399;">IllegalStateException</span><span style="color: #339933;">:</span> Bluetooth failed to initialize.
<span style="color: #006633;">There</span> is probably a problem with your local Bluetooth stack or API.</pre></div></div>

<p>You just have to declare the WiiFlash Server as 32bit application. Just open the file properties ( Apple + i ) and check the 32bit-mode checkbox. This will fix the problem. ( Otherwise the application is launched as 64bit application ).</p>
<p>Unfortunately both server versions aren&#8217;t that stabel. From time to time the server crashes or the connection between server and Flash Player doesn&#8217;t seem to work any more. You just have to close the server, disconnect the Wiimote from your PC or Mac and restart the connection. This also helps if the rumble function or the LED setter method seem to quit their work.</p>
<p><strong>Connect the Wiimote with your Flex App</strong><br />
The WiiFlash AS3 API gives you a very clear set of methods, which gives you fully access to the Wiimote data. At first you have to create an instance of the Wiimote class. Now you could create the connection to the Wiimote and access the data.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> org.<span style="color: #006600;">wiiflash</span>.<span style="color: #006600;">Wiimote</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> wiimote:Wiimote;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	wiimote = <span style="color: #000000; font-weight: bold;">new</span> Wiimote<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* use Event.Connect NOT WiimoteEvent.CONTROLLER_CONNECT */</span>
	wiimote.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #0066CC;">CONNECT</span>, connectHandler <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	wiimote.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> connectHandler<span style="color: #66cc66;">&#40;</span> evt:Event <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;Wiimote is connected&quot;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>Read Wiimote data</strong><br />
The accelerator values could be accessed on to different ways. First you could read the data directly from the Wiimote-instance. This is helpful if you have an timed update interval, which handles the data. For example if you use an the enterFrame event to call a method which handles the Wiimote data:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	wiimote = <span style="color: #000000; font-weight: bold;">new</span> Wiimote<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* get Wiimote data onEnterFrame */</span>
	<span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ENTER_FRAME</span>, enterFrameHandler <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	wiimote.<span style="color: #0066CC;">connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> enterFrameHandler<span style="color: #66cc66;">&#40;</span> evt:Event <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> wiimote.<span style="color: #006600;">sensorX</span> <span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> wiimote.<span style="color: #006600;">roll</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The common way is to use the Wiimote Update event. This event is fired on each update update call from the Bluetooth stack. ATTENTION: The communication works with about 100Hz. This means you will get about 100 datasets per second. This is important for how you will later work with your data, and have to be aware of performance issues if you might bad datastructures or uneffective datahandling methods.</p>
<p><strong>Write Wiimote data</strong><br />
You could not only read values from the Wiimote. You could also write two values of the Wiimote. This are the <em>led</em> and the <em>rumble</em> attribute. With the led attribute you should be able to specify which led-light on the Wiimote shines. This is not really working well, but works sometimes &#8230;<br />
You could also use the Force-Feedback of the Wiimote. Just set the <em>rumble</em> value to true and the Wiimote start vibrating. If its used this way, its vibrating all time. You could also set the <em>rumbleTimeout</em> value. The parameter is the time in milliseconds the Wiimote starts to rumble.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* set LEDs */</span>
wiimote.<span style="color: #006600;">leds</span> = Wiimote.<span style="color: #006600;">LED4</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/* set Force Feedback - for positiv direction */</span>
<span style="color: #808080; font-style: italic;">// wiimote.rumble = ( wiimote.sensorX&gt;3 || wiimote.sensorY&gt;3 || wiimote.sensorZ&gt;3 );</span>
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> wiimote.<span style="color: #006600;">sensorX</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">||</span> wiimote.<span style="color: #006600;">sensorY</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">||</span> wiimote.<span style="color: #006600;">sensorZ</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	wiimote.<span style="color: #006600;">rumbleTimeout</span> = <span style="color: #cc66cc;">1000</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>Interprete the Wiimote data</strong><br />
The Wiimote controller returns the acceleration concerning to the gravity value <em>g</em>. 1g means a gravity acceleration of 9.82m/s<sup>2</sup>. The controller itself is able to detect values between -3.6g and +3.6g.</p>
<p>If the Wiimote will not be moved and rests still on the table, you will always have on value (sensorX,sensorY,sensorZ) which is -1 or +1. This is the gravity affecting on the Wiimote. This is the criteria to detect if you Wiimote is in motion or not. Therefore you could use the Euclid Normal Form. If you take the root of the sum of all squares, this will be near +1. Normally you will define a constant values which is a bit higher than exact +1 to ignore very little movements of the Wiimote.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* const to detect motion */</span>
<span style="color: #0066CC;">private</span> const THRESHOLD:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">1.01</span>;
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> wiimoteUpdateHandler<span style="color: #66cc66;">&#40;</span> evt:WiimoteEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">_x</span> = evt.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">sensorX</span>;
	<span style="color: #0066CC;">_y</span> = evt.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">sensorY</span>;
	_z = evt.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">sensorZ</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> euLength:<span style="color: #0066CC;">Number</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* check for &quot;NO MOTION&quot; */</span>
	euLength = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sqrt</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">_x</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">_x</span> + <span style="color: #0066CC;">_y</span><span style="color: #66cc66;">*</span><span style="color: #0066CC;">_y</span> + _z<span style="color: #66cc66;">*</span>_z <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/** set Force Feedback - for positiv direction **/</span>
	wiimote.<span style="color: #006600;">rumble</span> = <span style="color: #66cc66;">&#40;</span> _x<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">||</span> _y<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">||</span> _z<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">3</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span>euLength<span style="color: #66cc66;">&gt;</span>THRESHOLD<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">/* do something */</span>
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>Optimize Wiimote date</strong><br />
Normally you won&#8217;t directly use the rough data from the Wiimote. Because the detection is relative precise you will get a lot of little peaks and a very unsmooth curve of data. If you want to detect a specific gesture or just want to transform the Wiimote motion into a motion of objects in the Flash you should parse the data. For smoothing the input data you should use a lowpass filter. It will smooth the curve by multiply the actual value with older values. In the following example a new value will only enter 10%. 90% of the value is taken from the old value.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* const for filtering values */</span>
<span style="color: #0066CC;">private</span> const FILTER_FACTOR:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0.1</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/* high pass filter */</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> highPassFilter<span style="color: #66cc66;">&#40;</span> oldValue:<span style="color: #0066CC;">Number</span>, value:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">return</span> value - lowPassFilter<span style="color: #66cc66;">&#40;</span> oldValue, value <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* low pass filter */</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> lowPassFilter<span style="color: #66cc66;">&#40;</span> oldValue:<span style="color: #0066CC;">Number</span>, value:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">return</span>  value <span style="color: #66cc66;">*</span> FILTER_FACTOR + oldValue <span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1.0</span> - FILTER_FACTOR <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> wiimoteUpdateHandler<span style="color: #66cc66;">&#40;</span> evt:WiimoteEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">_x</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">lowPassFilter</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">_x</span>, evt.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">sensorX</span> <span style="color: #66cc66;">&#41;</span>;
	<span style="color: #0066CC;">_y</span> = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">lowPassFilter</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">_y</span>, evt.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">sensorY</span> <span style="color: #66cc66;">&#41;</span>;
	_z = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">lowPassFilter</span><span style="color: #66cc66;">&#40;</span> _z, evt.<span style="color: #0066CC;">target</span>.<span style="color: #006600;">sensorZ</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* do something with the data */</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><strong>Gesture detection</strong><br />
If you know have smooth data, which you only will process if the Wiimote is really in motion, you could start to detect gestures. One of the very simple gestures is a shift. If you just shake the Wiimote a little step right it should detect a rightshift and maybe open the next Powerpoint slide. If you shift to left left the application should go on step back.</p>
<p>For this examples you have to watch the x sensor values of the Wiimote. Because you got the accelation of the controller you will not just get on positive peak in x-direction, but you will get a positive peak in x-direction followed by a negative peak in the x-direction. This is because you start a motion in positive x-direction but than stop to motion, which is a negative accelaration. An right shift is a positive x peak followed by a negative x peak. Vice versa a left shift is a negative x peak followed by a positive x peak.</p>
<p>So the first thing to implement is a peak detection class. I do this by writing several values to a history array ( for example of the last 40 values ). I now compare the avarage of the last 2 or 3 values to the avarage of all history values. If the difference between the two avarage values exceed a specific value ( depending on how exact my motion detection should work ) a peak is detected.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * @classdescription: peak detection. detects a peak in an array of values
 * @author: Sebastian Martens - http://blog.sebastian-martens.de/
 * @SVN: $Id$
 *
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PeakDetect<span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _history:Vector.<span style="color: #66cc66;">&lt;</span>number<span style="color: #66cc66;">&gt;</span>;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _historyLength:<span style="color: #0066CC;">int</span>;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _kernelLength:<span style="color: #0066CC;">int</span>;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _peakFactor:<span style="color: #0066CC;">Number</span>;
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _lastPeak:<span style="color: #0066CC;">Boolean</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * @constructor
	 * @param kernelLength Number of values which represent the actual motion
	 * @param historyLength Number of values which are taken as history of motion
	 * @param peakFactor If distance between history and actual motion greater than this value motion is detected
	 *
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> PeakDetect<span style="color: #66cc66;">&#40;</span> kernelLength:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">2</span>, historyLength:<span style="color: #0066CC;">int</span>=<span style="color: #cc66cc;">32</span>, peakFactor:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">0.2</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span>;
&nbsp;
		_history = <span style="color: #000000; font-weight: bold;">new</span> Vector.<span style="color: #66cc66;">&lt;</span>number<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		_kernelLength = kernelLength;
		_historyLength = historyLength;
		_peakFactor = peakFactor;
&nbsp;
		_lastPeak = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// init with 0</span>
		<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>i=<span style="color: #cc66cc;">0</span>;i<span style="color: #66cc66;">&lt;</span>_historyLength;i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			_history<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span> = <span style="color: #cc66cc;">0</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * calculates the intersection value of items in the array
	 * @param startIndex to get avarage value from the history list
	 * @param length number of values which should calculate to avarage value
	 * @return avarage value
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _getIntersection<span style="color: #66cc66;">&#40;</span> startIndex:<span style="color: #0066CC;">int</span>, <span style="color: #0066CC;">length</span>:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">int</span>;
		<span style="color: #000000; font-weight: bold;">var</span> mValue:<span style="color: #0066CC;">Number</span>=<span style="color: #cc66cc;">0</span>;
&nbsp;
		<span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>i=startIndex;<span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&lt;</span><span style="color: #66cc66;">&#40;</span>startIndex+<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&amp;&amp;</span>i<span style="color: #66cc66;">&lt;</span>_historyLength<span style="color: #66cc66;">&#41;</span>;i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			mValue += _history<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span>mValue<span style="color: #66cc66;">/</span><span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * tries to detect a peak in the list of value
	 * @return true if a peak was detected
	 *
	 */</span>
	<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _checkForPeak<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">var</span> pValue:<span style="color: #0066CC;">Number</span>;
		<span style="color: #000000; font-weight: bold;">var</span> aValue:<span style="color: #0066CC;">Number</span>;
		<span style="color: #000000; font-weight: bold;">var</span> peakVal:<span style="color: #0066CC;">Number</span>;
		<span style="color: #000000; font-weight: bold;">var</span> multiPl:<span style="color: #0066CC;">int</span>;
&nbsp;
		pValue = _getIntersection<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>,_historyLength<span style="color: #66cc66;">&#41;</span>;
		aValue = _getIntersection<span style="color: #66cc66;">&#40;</span> _historyLength-_kernelLength, _kernelLength <span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> aValue<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			peakVal = <span style="color: #66cc66;">&#40;</span>aValue-pValue<span style="color: #66cc66;">&#41;</span>;
			multiPl = <span style="color: #cc66cc;">1</span>;
		<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
			peakVal = <span style="color: #66cc66;">&#40;</span>pValue-aValue<span style="color: #66cc66;">&#41;</span>;
			multiPl = -<span style="color: #cc66cc;">1</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span> peakVal<span style="color: #66cc66;">&gt;</span>_peakFactor <span style="color: #66cc66;">&#41;</span>?<span style="color: #66cc66;">&#40;</span>peakVal<span style="color: #66cc66;">*</span>multiPl<span style="color: #66cc66;">&#41;</span>:<span style="color: #cc66cc;">0</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * Adds a new value to item history. Return true if peak is detected.
	 * @param value Number-
	 * @return Boolean -
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addValue<span style="color: #66cc66;">&#40;</span> value:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
		_history.<span style="color: #006600;">shift</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		_history<span style="color: #66cc66;">&#91;</span> <span style="color: #66cc66;">&#40;</span>_historyLength-<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#93;</span> =  value;
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._checkForPeak<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Finally you could now decide on the order of the different peaks which type of gesture it should be. Therefore i use a timer. If one peak is detected the timer starts. If another peak is detected within the runtime of the timer a gesture is detected if the peak order fits to a gusture.</p>
<p>Please find attached a example FlashBuilder Project which consists serveral steps with examples. Including the WiiFlash framework and my GestureDetection library.</p>
<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/08/WiiFlashTest.zip">WiiFlashTest &#8211; FlashBuilder Project</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/08/com.nonstatics.GestureDetection.zip">com.nonstatics.GestureDetection &#8211; Gesture Detection Library for WiiFlash v0.1</a></p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/08/use-your-wii-remote-with-the-flashplayer-wiiflash/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flash / Flex Events in den letzten Tagen</title>
		<link>http://blog.sebastian-martens.de/2009/06/flash-flex-events-in-den-letzten-tagen/</link>
		<comments>http://blog.sebastian-martens.de/2009/06/flash-flex-events-in-den-letzten-tagen/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 20:37:24 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[André Michelle]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[Flash Catalyst]]></category>
		<category><![CDATA[Flash Summer Camp]]></category>
		<category><![CDATA[Flex 4]]></category>
		<category><![CDATA[Flex User Group Berlin]]></category>
		<category><![CDATA[Flex User Group Hamburg]]></category>
		<category><![CDATA[Flex User Group Hannover]]></category>
		<category><![CDATA[flexughh]]></category>
		<category><![CDATA[Gumbo]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=181</guid>
		<description><![CDATA[Hallo und Humppa!, in den letzten Tag gabs es mal wieder eine geballte Ladung von Flash und Flex für mich. 10.06.2009 &#8211; Flex User Group Meeting Hannover: Auch wenn die Runde bei unseren Hannoveraner ( FXUG Hannover Adobe Groups ) Kollegen derzeit noch überschaubar ist, schließlich ist es noch eine ganz junge User Group, wird [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo und Humppa!,</p>
<p>in den letzten Tag gabs es mal wieder eine geballte Ladung von Flash und Flex für mich.</p>
<p><strong>10.06.2009 &#8211; Flex User Group Meeting Hannover:</strong><br />
Auch wenn die Runde bei unseren Hannoveraner ( <a  href="http://groups.adobe.com/groups/12346b454c/summary">FXUG Hannover Adobe Groups</a> ) Kollegen derzeit noch überschaubar ist, schließlich ist es noch eine ganz junge User Group, wird Engagement und Niveau groß geschrieben. An diesem Mittwoch hat sich die Gruppe bei den <a  href="http://www.projektionisten.de/">Projektionisten</a> in Hannover getroffen. Dort wird gerade für Kunden an 3D-Visualisierung gearbeitet. Der erste Vortrag ging daher über die ersten Schritte in 3D im Rahmen des Flex Frameworks. Derzeit sind derzeit nur ein paar Translationen und Rotationen und wird den 3D Frameworks wie Papervision3D oder Away3D derzeit noch nicht das Wasser abgraben können, aber künftig sicher druch einer nativeren Unterstützung durch den Flash Player 10 in Sachen Performance helfen können.<span id="more-181"></span><br />
Im Vortrag 2 ging es um Performance Tipps. Was sollte ich in ActionScript 3 beachten um eine saubere und schnelle Applikation zu entwickelt. Eigentlich ein Dauerbrenner in der Entwicklung. Der Vortrag entwickelte sich zu einer spannenden Diskussion, zu der jeder etwas beizutragen hatte. Wer also im Großraum Hannover an Flex interressiert ist, sei die Flex User Group Hannover ans Herz gelegt.</p>
<p><strong>14.06.2009 Flash Camp Berlin</strong><br />
Die Flex User Group Berlin hat sich alle Mühe gegeben und ein super Community Event auf die Beine gestellt. Mit einem ausgewogenen Programm, dass sich ganz ausdrücklich nicht nur an Entwickler sondern auch an Designer und eigentlich alle anderen wendet könnte sich das <a  href="http://www.flex-labs.de/flashcamp/">Flash Summer Camp Berlin</a> sehen lassen. Das Event ging von 11.00 Uhr bis ca. 21.30 Uhr war kostenlos und das bei freiem Essen und Getränken.<br />
Die Palette der Vorträge ging von der Vorstellung von Flex Startups über Entwicklungsmethoden /-organisation, 3D Frameworks oder Andre Michelles immer wieder begeisternde Audio-Meisterstücke bis hin zum neuen Flash Builder und Flash Catalyst, die Duane Nickull und Sven Claar vorgestellt haben.<br />
Noch einmal ein herzliches Dankeschön an Bettina und Mathias von der Flex UG Berlin für diesen klasse Community Tag in Berlin.</p>
<p><strong>16.06.2009 Flex User Group Meeting Hamburg</strong><br />
Wenn Duane Nickull schon mal in Deutschland ist, dann muss man das natürlich auch ausnutzen. Da er bereits in Berlin zu Gast war hatte er sich auch bereiterklärt einen kleinen Vortrag in Hamburg zu halten. Die Mitglieder der User Group konnten auf der Webseite zwischen drei Themen <a  href="http://www.flexughh.de/2009/05/28/flexughh-meeting-16062009-duane-nickull/">abstimmen</a> die Sie interesierten. Letztendlich siegte das Thema &#8220;Webservices&#8221;. Duane ließ sich aber nicht davon abhalten zu einem großen Rundumschlag auszuholen, der dann noch eine kleine Einfühung zu Flex 4 / Flash Builder enthielt, sowie einen kleinen Einblick in den Workflow in Flash Catalyst. An dieser Stelle noch einmal herzlichen Dank an Duane Nickull für den Vortrag und IBM / <a  href="http://www.fruendt-online.ded/wordpress/">Boris Fruendt</a> für die Location.<br />
Das nächste Flex UG HH Meeting findet bereits am 30.06. statt. Hier wird Sven Claar dann ausgiebig über Flex 4, Flash Builder und Flash Catalyst berichten. Alle Infos wie immer auf dem <a  href="http://www.flexughh.de/2009/06/15/flexughh-meeting-30062009-flex-4-tour-sven-claar-everything-about-flex4-flash-builder-catalyst/">Flex UG HH Blog</a>.</p>
<p>Die Präsentationsunterlagen von Duane:<br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/06/ServiceClients-FB4_TEACHERSGUIDE.pdf">Flash Builder &#8211; Building Service Clients &#8211; Teachers Guide</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/06/Flex4-WHatsNew.pdf">Präsentation: Flex 4 &#8211; What&#8217;s new</a></p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/06/flash-flex-events-in-den-letzten-tagen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>swfInputs: Solving Mozilla + Transparent Mode + Win + Special Chars within inputs</title>
		<link>http://blog.sebastian-martens.de/2009/05/swfinputs-solving-mozilla-transparent-mode-win-special-chars-within-inputs/</link>
		<comments>http://blog.sebastian-martens.de/2009/05/swfinputs-solving-mozilla-transparent-mode-win-special-chars-within-inputs/#comments</comments>
		<pubDate>Fri, 29 May 2009 19:30:43 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[inputs]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[opaque]]></category>
		<category><![CDATA[Player]]></category>
		<category><![CDATA[special characters]]></category>
		<category><![CDATA[swfInputs]]></category>
		<category><![CDATA[transparent mode]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wmode]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=159</guid>
		<description><![CDATA[As you probably know the Flash Player uses three different types of modes an Flash movie is embedded in the browser window. Its is set via the wmode parameter in the embed or param tag. &#60;param name=&#34;wmode&#34; value=&#34;transparent&#34; /&#62; &#60;embed wmode=&#34;transparent&#34; ... With the transparent mode you can influence the relation between the Flash movie [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably know the Flash Player uses three different types of modes an Flash movie is embedded in the browser window. Its is set via the <em>wmode</em> parameter in the embed or param tag.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">  &lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;
  &lt;embed wmode=&quot;transparent&quot; ...</pre></div></div>

<p>With the transparent mode you can influence the relation between the Flash movie an the surrounding HTML. If the set the wmode to window the Flash movie will always lay on top of the rest of the page. This is absolutly helpfull if your application is &#8220;standalone&#8221;, means the only center of user interaction or if you have an full window application ( at least with full screen ).<br />
But often you have other HTML elements around the Flash movie which are at the same level of user interaction and might be as important as the Flash movie ( Best example might by fly-out menus which has to overlay all other content. Or maybe confirm messages which are not realized by the JavaScript confirm-dialog ). If you use <em>wmode</em> window html elements will always behind the Flash movie (setting the html z-index has no effect ), so there is no real interaction between HTML/JavaScript an the Flash movie. For this you need <em>wmode</em> equals <em>transparent</em>.<br />
<span id="more-159"></span><br />
wmode transparent allows an equal mixture between Flash and HTML/ JavaScript. Just as the parameters sounds, the Flash movie will also have an transparent background and let the behind HTML shine through. Attention: The transaparent background is expensive in performance. Use it carefully.<br />
The third mode after <em>window</em> and <em>transparent</em> is <em>opaque</em>. The opaque also allows the mix of Flash and HTML/ JavaScript, but has now transparent background.</p>
<p>Since the introduction of these two modes (<em>transparent, opaque</em>) there is a bug with Mozilla based Browsers and textfields on Window plattforms. If you try to enter special character &#8211; famoused example is the @ &#8211; in text fields it wont work. This is very uncomfortable if you want to have a user login where you use e-mail adresses as username ( @see <a  href="http://bugs.adobe.com/jira/browse/FP-479">Adobe Bug Base</a> ).</p>
<h3>swfInput</h3>
<p>My solution to solve this issue is called swfInputs. It uses the ExternalInterface class of the Flash player. swfInputs is a an AS3 which extends the Flex TextInput class. It communicates with an JavaScript class. This will create normal HTML Inputfields and places it exactly above the original Flash Inputfield.<br />
On entering text in the overlay-HTML-Inputfield the text will be transfered via ExternalInterface into the Flash movie and the corresponding Flash Inputfield. For the Flash application this mechanism is transparent because the access to the field and change events on the input field will still work.</p>
<p>The JavaScript class will only generate the overlay input field if its necessary, means on the Mozilla-Windows-Combination. Other browsers will use the normal Flash movie inputs.</p>
<p>The styles (height, width, border, colors ) which you set on the Flash Input will be transfered to the HTML-Input and set via CSS styles. For further styling like background images you could of course also use standard CSS.</p>
<p>swfInputs also support multiple Flash movies within on HTML page and have an &#8220;point-to-point&#8221; connection between the overlaying HTML-Input and the Flash-Input. So there is no general keylogger on the complete HTML page, which might cause problems with your JavaScript functions. This also means that you could have different Flash movies on one page ( which might also communicate to each other via LocalConnection ) where each movie could have its own TextInputs.</p>
<h3>What to do in your code?</h3>
<p>swfInputs consists of two parts:</p>
<ul>
<li>The SWFTextInput AS3 Class (which create the connection to the JavaScript class)</li>
<li>and the swfInputs JavaScript Class (which handles the creation and HTML communication)</li>
</ul>
<p>To activate the JavaScript part you just need to insert two script-tags into the HTML code and call the constructor method. At the moment swfInputs uses the dojoToolkit JavaScript library for position calculation and basic connection handling. I looking forward to remove this need of dojo to reduce the filesize.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;../javascript/dojo.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;../javascript/swfInputs.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;
&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;
			swfInputs.init('swfInputTestcase');
&lt;/script&gt;</pre></div></div>

<p>The String-value int the constructor call is the channel-name. This is optional if you just use on single instance within the HTML-page.</p>
<p>Within you Flash/ Flex application you have to use the SWFTextInput class for textfields instead of TextInput. The SWFTextInput class uses the <a  href="/2009/03/how-to-handle-massive-externalinterface-calls-jscallstack/">JSCallStack</a> to optimize the JavaScript communiaction ( which could be a lot on fast typing, so its recommanded to use it ).</p>
<p>A basic Flash/ Flex app could look like this. You see there is nothing very special instead of the <strong><em>swfInputs:SWFTextInput</em></strong> class.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
	layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;600&quot;</span> backgroundAlpha=<span style="color: #ff0000;">&quot;0.5&quot;</span> <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;#674523&quot;</span>
	initialize=<span style="color: #ff0000;">&quot;init()&quot;</span> xmlns:swfInputs=<span style="color: #ff0000;">&quot;com.nonstatics.swfInputs.*&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #0066CC;">import</span> mx.<span style="color: #006600;">controls</span>.<span style="color: #006600;">Alert</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">//</span>
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> clickHandler<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
				Alert.<span style="color: #0066CC;">show</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;swfInput01: &quot;</span>+swfInput01.<span style="color: #0066CC;">text</span>+<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+
						   <span style="color: #ff0000;">&quot;swfInput02: &quot;</span>+swfInput02.<span style="color: #0066CC;">text</span>+<span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>+
						   <span style="color: #ff0000;">&quot;swfInput03: &quot;</span>+swfInput03.<span style="color: #0066CC;">text</span><span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;</span>mx:VBox x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;10&quot;</span><span style="color: #66cc66;">&gt;</span>
&nbsp;
		<span style="color: #66cc66;">&lt;</span>mx:TextInput <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;160&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#674523&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{ swfInput01.text + swfInput02.text }&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
		<span style="color: #66cc66;">&lt;</span>swfInputs:SWFTextInput id=<span style="color: #ff0000;">&quot;swfInput01&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#ff0000&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;Verdana&quot;</span> <span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;</span>swfInputs:SWFTextInput id=<span style="color: #ff0000;">&quot;swfInput02&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#00ffff&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;Arial&quot;</span> <span style="color: #66cc66;">/&gt;</span>
		<span style="color: #66cc66;">&lt;</span>swfInputs:SWFTextInput id=<span style="color: #ff0000;">&quot;swfInput03&quot;</span> <span style="color: #0066CC;">borderColor</span>=<span style="color: #ff0000;">&quot;#0000ff&quot;</span> fontFamily=<span style="color: #ff0000;">&quot;Times&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
		<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> label=<span style="color: #ff0000;">&quot;Senden&quot;</span> click=<span style="color: #ff0000;">&quot;clickHandler()&quot;</span> <span style="color: #66cc66;">/&gt;</span>
&nbsp;
	<span style="color: #66cc66;">&lt;/</span>mx:VBox<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<h3>Download Files (swfInputs 1.0)</h3>
<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/swftextinput.as">SWFTextInput.as</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/swfinputs.js">swfInputs.js</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/swfinputtestproject.zip">SWFInputs Eclipse Testproject (ZIP)</a></p>
<p>Please feal free to leave some comments and let me know if its helpful or what should be done for future releases.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/05/swfinputs-solving-mozilla-transparent-mode-win-special-chars-within-inputs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>ActionScript Data Structures</title>
		<link>http://blog.sebastian-martens.de/2009/05/actionscript-data-structures/</link>
		<comments>http://blog.sebastian-martens.de/2009/05/actionscript-data-structures/#comments</comments>
		<pubDate>Mon, 18 May 2009 21:12:19 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Binary Search Tree]]></category>
		<category><![CDATA[Datastructure]]></category>
		<category><![CDATA[Double Linked List]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[FlexUnit]]></category>
		<category><![CDATA[Garbadge Collector]]></category>
		<category><![CDATA[joa ebert]]></category>
		<category><![CDATA[Linked List]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Pooling]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=143</guid>
		<description><![CDATA[In the good old Java world ( not that i&#8217;m that familiar with it ) real data structures are a well non secret. Not only in Java but in all older object oriented progaming languages exists different of Design Patterns for effecient data structures and fast access to data structures for different kind of use [...]]]></description>
			<content:encoded><![CDATA[<p>In the good old Java world ( not that i&#8217;m that familiar with it ) <em>real</em> data structures are a well non secret. Not only in Java but in all older object oriented progaming languages exists different of Design Patterns for effecient data structures and fast access to data structures for different kind of use cases.</p>
<p>With data structures i don&#8217;t mean an normal or byte array which might be <strong>the</strong> data structures an the flash  world, because you use it without waisting any thought of it ( me included ). in the very most situations were you used the Flash plattform right now this might be ok, because often you don&#8217;t have the mass of data. So the performance of the Flash Player is well enough.</p>
<p>But the possiblities of the Flash Plattform are growing ( very fast in the last time :) ) and more and more applications ( also real applications ) are written for the web ( or for both worlds if you use AIR ). <span id="more-143"></span></p>
<p>So you might now run in the situation to build an realy big application which has to handle a lot of data and you have to think about performance. One big thing in performance is the datastructure itself. Each application is different. Is it important for your app to write data fast or read it fast; which happens mor often; do you process all data always complete or do you just need a small part of it ?! For each use case there is for sure a very well data structure.</p>
<h3>Data Structure</h3>
<p>Example A: <a  href="http://blog.joa-ebert.com/" target="_blank">Joa Ebert</a> had a talk on Flash Forum Conference 09 (which also inspired me for the second part &#8211; see below &#8211; and made me happy to see that datstructures are already present in the flash world ) where he presented his data structure for the <a  href="http://www.hobnox.com/audiotool" target="_blank">audio tool</a>. When they output the audio stream they always have to process a (large) list of single audio-items ( one for each bit of the stereo 44.100kHz Audiostream ). -&gt; Fast access of elements (always complete and in the same order ) one by one. Best datastructure: Linked List.</p>
<p>What is a linked list ? A linked list is an list of very light weight elements where each element holds a reference to it next neightbour. In your app you only have one reference to the first node of this list and that loop over the list by setting the reference further (example for calculating the length of the list):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * Returns the cardinality of the map - the number of elements
 * @return A value of &lt;code&gt;Int&lt;/code&gt;, the number of elemets
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> card<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> ref:SimplyLinkedListElement = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>;
	<span style="color: #000000; font-weight: bold;">var</span> card:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
	<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
		ref = ref.<span style="color: #006600;">next</span>;
		++card;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> card;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>You also could insert a new element very fast ( if it is ok to put it on the first position ). You just have to change the reference to the root element to the new element and link the next reference of the new element to the old root element.</p>
<p>Example B: You have an application which often reads from its datastructure, but always only searches on random element. If you would use a linked list, in the worst case you have to look at each element if it is the searched one. Looking at each element is to expensive. One solution are Tree-Datastructures. The simplest is the Binary Tree. Again you have an root reference. But each element now have to references to the next elements. One to the right ( bigger element ) and one to the left ( smaller element ). If you insert an element in the tree you&#8217;ll look at the existing node. Is your new node larger, you will look at the right reference, is it smaller at the left reference of the node. Is the reference empty you could place it there.</p>
<p>If not you will look at the data again. In the worst case you now don&#8217;t need to look at each element because you have a structure and will find the fastest way by compare the keys. The search is logarithmic not linear.</p>
<h3>Garbadge Collector / Pooling</h3>
<p>The next big thing with datastructure and performance in the Flash Player is the Garbadge Collector ( which it don&#8217;t were that aware before Joas talk ). So the Garbadge Collector is realy slow. So we have to avoid that he is coming to action. How ? By reusing your elements or <em>pool</em> them.</p>
<p>The Garbadge Collector will free space in the memory if there are no more references to an allocted section. So you have to control the references. In your mass of objects you should not drop unused items, because the are not used for now, but pool them. You remove the reference from the main datastructure to the unused element and reference it within a list of unsed elements. When you now need a new element you don&#8217;t have to create a new one ( which is also realy expensive ) but you could take one element from you pool.</p>
<p>Find attached some of my older datastructures (LinkedList, DoubleLinkedList, BinarySearchTree) which i just updated so they will now use pooling for unused elements ( and of course there are also some simple FlexUnit Testcases included ! :) &#8211; <a  href="http://florian.salihovic.info/blog/?p=55">Florian Salihovic</a>).</p>
<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/as3datastructures.zip">Download AS3DataStructure.zip</a></p>
<h3>Binary Search Tree</h3>
<p>Here is one longer example of an Binary Search Tree implementation. It&#8217;s not fully done yet, but most common methods are implemented and ready to use. I&#8217;m sure the is some optimaziation potential (please let me know if you find anything, then i will correct it).<br />
Because there are no real Generics in ActionScript this is an Example for a Map which uses an String value as Key and an Number value as data. This has of course to be adopted for your case:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">package com.<span style="color: #006600;">nonstatics</span>.<span style="color: #006600;">as3collection</span>.<span style="color: #006600;">map</span>.<span style="color: #006600;">MapAsBinarySearchTree</span>
<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/**
	 * Implements a map as binary search tree
	 *
	 * @author Sebastian Martens http://www.sebastian-martens.de || http://blog.sebastian-martens.de
	 * @copyright Creative Commons, free to use &quot;as is&quot;
	 * @date $Id: MapAsBinarySearchTree.as 21 2009-05-18 20:06:59Z dinnerout $
	 */</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MapAsBinarySearchTree
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #808080; font-style: italic;">/**
		 * root reference
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_root</span>:MapAsBinarySearchTreeElement;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * root reference of pooled elements
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _poolRoot:MapAsBinarySearchTreeElement;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * cardinality of map
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _cardV:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * is vadinality valid
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> _validCard:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * construction method
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> MapAsBinarySearchTree<span style="color: #66cc66;">&#40;</span> n:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// build pool elements to avoid construction on runtime</span>
			<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span> n<span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPush</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
				--n;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #0066CC;">this</span>._cardV = <span style="color: #cc66cc;">0</span>;
			<span style="color: #0066CC;">this</span>._validCard = <span style="color: #000000; font-weight: bold;">false</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Test if Map is an empty map
		 * @return A value of code&gt;Boolean&lt;/code&gt;, if map is empty
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> isEmpty<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> == <span style="color: #000000; font-weight: bold;">null</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Returns the cardinality of the map - the number of elements
		 * @return A value of &lt;code&gt;Int&lt;/code&gt;, the number of elemets
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> card<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>._validCard <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._cardV;
			<span style="color: #0066CC;">this</span>._cardV = <span style="color: #0066CC;">this</span>._card<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0066CC;">this</span>._validCard = <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._cardV;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * recursiv card() helper method
		 * @private
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/int&gt; processed node
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _card<span style="color: #66cc66;">&#40;</span> node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">1</span> + <span style="color: #0066CC;">this</span>._card<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span> + <span style="color: #0066CC;">this</span>._card<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * returns an element by its key
		 * @param key value of &lt;code&gt;String&lt;/code&gt;, search key
		 * @return value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getElement<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">key</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._getElement<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>, <span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * recursive helper method for getElement
		 * @private
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;, processing node
		 * @param key value of &lt;code&gt;String&lt;/code&gt;, search key
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _getElement<span style="color: #66cc66;">&#40;</span> node:MapAsBinarySearchTreeElement, <span style="color: #0066CC;">key</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> l:MapAsBinarySearchTreeElement;
			<span style="color: #000000; font-weight: bold;">var</span> r:MapAsBinarySearchTreeElement;
&nbsp;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #0066CC;">key</span> == <span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> node;
			<span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&gt;</span> node.<span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span>?<span style="color: #0066CC;">this</span>._getElement<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">r</span>, <span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">this</span>._getElement<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">l</span>, <span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * checkes if an value v is in the map
		 * @param v a value of &lt;code&gt;Number&lt;/code&gt;,element value to search for
		 * @return true if value is containing in one element
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> containsValue<span style="color: #66cc66;">&#40;</span> v:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._containsValue<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>, v <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * recursive helper method for containsValue
		 * @private
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/int&gt; processed node
		 * @param v value of &lt;code&gt;Number&lt;/code&gt;, search value
		 * @return value of &lt;code&gt;Boolean&lt;/code&gt;, value found in tree
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _containsValue<span style="color: #66cc66;">&#40;</span> node:MapAsBinarySearchTreeElement, v:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">value</span> == v <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span> v <span style="color: #66cc66;">&gt;</span> node.<span style="color: #006600;">value</span> <span style="color: #66cc66;">&#41;</span>?<span style="color: #0066CC;">this</span>._containsValue<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">r</span>, v <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">this</span>._containsValue<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">l</span>, v <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Test if this map equals to another map ( equals means same elements not same structure )
		 * @param map value of &lt;code&gt;MapAsBinarySearchTree&lt;/code&gt; to test this map with
		 * @return a value of &lt;code&gt;Boolean&lt;/code&gt;
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> isEqualTo<span style="color: #66cc66;">&#40;</span> map:MapAsBinarySearchTree <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span> == map <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;&amp;</span> map.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #66cc66;">!</span>map.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">||</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #0066CC;">this</span>.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;&amp;</span> map.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">card</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">!</span>= map.<span style="color: #006600;">card</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._isEqualTo<span style="color: #66cc66;">&#40;</span> map, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * recursive helper method for isEqualTo
		 * @param map value of &lt;code&gt;MapAsBinarySearchTree&lt;/code&gt;, map to compare with
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/node&gt;, processing node of this map
		 * @return false if element not in reference tree
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _isEqualTo<span style="color: #66cc66;">&#40;</span> map:MapAsBinarySearchTree, node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #000000; font-weight: bold;">var</span> item:MapAsBinarySearchTreeElement = map.<span style="color: #006600;">getElement</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>item <span style="color: #66cc66;">||</span> item.<span style="color: #006600;">value</span><span style="color: #66cc66;">!</span>=node.<span style="color: #006600;">value</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._isEqualTo<span style="color: #66cc66;">&#40;</span> map, node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">this</span>._isEqualTo<span style="color: #66cc66;">&#40;</span> map, node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * inserts a new value into the map
		 * @param k value of &lt;code&gt;String&lt;/code&gt;, key
		 * @param v value of &lt;code&gt;Number&lt;/code&gt;, value
		 * @return this
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">insert</span><span style="color: #66cc66;">&#40;</span> k:<span style="color: #0066CC;">String</span>, v:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTree<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// invalidate cardinality</span>
			<span style="color: #0066CC;">this</span>._validCard = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// empty map</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span> item:MapAsBinarySearchTreeElement = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
				item.<span style="color: #006600;">value</span> = v;
				item.<span style="color: #0066CC;">key</span> = k;
				item.<span style="color: #006600;">l</span> = <span style="color: #000000; font-weight: bold;">null</span>;
				item.<span style="color: #006600;">r</span> = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
				<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> = item;
				<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// non empty map</span>
			<span style="color: #0066CC;">this</span>._insert<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>, k, v <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * recursive helper method for insert method
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;, processed node
		 * @param k value of &lt;code&gt;String&lt;/code&gt;, key
		 * @param v value of &lt;code&gt;Number&lt;/code&gt;, value
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _insert<span style="color: #66cc66;">&#40;</span> node:MapAsBinarySearchTreeElement, k:<span style="color: #0066CC;">String</span>, v:<span style="color: #0066CC;">Number</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// existing keys will be updated</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #0066CC;">key</span> == k <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				node.<span style="color: #006600;">value</span> = v;
				<span style="color: #b1b100;">return</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">var</span> item:MapAsBinarySearchTreeElement;
&nbsp;
			<span style="color: #808080; font-style: italic;">// insert left or right</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> k <span style="color: #66cc66;">&gt;</span> node.<span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">// right node exist</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">this</span>._insert<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">r</span>, k, v <span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #808080; font-style: italic;">// new node at right leave</span>
				<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
					item = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					item.<span style="color: #0066CC;">key</span> = k;
					item.<span style="color: #006600;">value</span> = v;
					item.<span style="color: #006600;">l</span> = <span style="color: #000000; font-weight: bold;">null</span>;
					item.<span style="color: #006600;">r</span> = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
					node.<span style="color: #006600;">r</span> = item;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">// left node exists</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #0066CC;">this</span>._insert<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">l</span>, k, v <span style="color: #66cc66;">&#41;</span>;
&nbsp;
				<span style="color: #808080; font-style: italic;">// new node at left leave</span>
				<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
					item = <span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
					item.<span style="color: #0066CC;">key</span> = k;
					item.<span style="color: #006600;">value</span> = v;
					item.<span style="color: #006600;">l</span> = <span style="color: #000000; font-weight: bold;">null</span>;
					item.<span style="color: #006600;">r</span> = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
					node.<span style="color: #006600;">l</span> = item;
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * returns if the map contains an element with k
		 * @param k value of &lt;code&gt;String&lt;/code&gt;, key to search for
		 * @return true if mao contains key
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> contains<span style="color: #66cc66;">&#40;</span> k:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._contains<span style="color: #66cc66;">&#40;</span> k, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * recursive helper method for contains
		 * @param k value of &lt;code&gt;String&lt;/code&gt;, key to search for
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;, start node
		 * @return
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _contains<span style="color: #66cc66;">&#40;</span> k:<span style="color: #0066CC;">String</span>, node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #0066CC;">key</span>==k <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> k <span style="color: #66cc66;">&gt;</span> node.<span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._contains<span style="color: #66cc66;">&#40;</span> k, node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> k <span style="color: #66cc66;">&lt;</span> node.<span style="color: #0066CC;">key</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._contains<span style="color: #66cc66;">&#40;</span> k, node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">// Traverse the tree complete</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _containsF<span style="color: #66cc66;">&#40;</span> k:<span style="color: #0066CC;">String</span>, node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span>node.<span style="color: #0066CC;">key</span>==k<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">||</span> <span style="color: #0066CC;">this</span>._containsF<span style="color: #66cc66;">&#40;</span>k,node.<span style="color: #006600;">l</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">||</span> <span style="color: #0066CC;">this</span>._containsF<span style="color: #66cc66;">&#40;</span>k,node.<span style="color: #006600;">r</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * returns the rightes leave of an part tree
		 * @private
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;, start node
		 * @return latest right leave from node
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _getRight<span style="color: #66cc66;">&#40;</span> node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// already latest right node</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> node;
&nbsp;
			<span style="color: #808080; font-style: italic;">// find right</span>
			<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				node = node.<span style="color: #006600;">r</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #b1b100;">return</span> node;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * returns the most left leave of an part tree
		 * @private
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;, start node
		 * @return latest left leave from node
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _getLeft<span style="color: #66cc66;">&#40;</span> node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// already latest right node</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> node;
&nbsp;
			<span style="color: #808080; font-style: italic;">// find right</span>
			<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				node = node.<span style="color: #006600;">l</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #b1b100;">return</span> node;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * finds the parent node of the element with key k
		 * @private
		 * @param k value of &lt;code&gt;String&lt;/code&gt;
		 * @param nod value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;, processed element
		 * @return parent node of node with key k, null if not found
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _findKeyParent<span style="color: #66cc66;">&#40;</span> k:<span style="color: #0066CC;">String</span>, node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">//  root node to remove</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> node.<span style="color: #0066CC;">key</span> == k <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> node;
&nbsp;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span>node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&amp;&amp;</span> node.<span style="color: #006600;">l</span>.<span style="color: #0066CC;">key</span> == k<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">||</span> <span style="color: #66cc66;">&#40;</span>node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&amp;&amp;</span> node.<span style="color: #006600;">r</span>.<span style="color: #0066CC;">key</span> == k<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> node;
&nbsp;
			<span style="color: #b1b100;">return</span> <span style="color: #66cc66;">&#40;</span>k <span style="color: #66cc66;">&gt;</span> node.<span style="color: #0066CC;">key</span><span style="color: #66cc66;">&#41;</span>?<span style="color: #0066CC;">this</span>._findKeyParent<span style="color: #66cc66;">&#40;</span> k, node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">this</span>._findKeyParent<span style="color: #66cc66;">&#40;</span> k, node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * removes an element by its key
		 * @param k value of &lt;code&gt;String&lt;/code&gt;, key of element to remove
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> remove<span style="color: #66cc66;">&#40;</span> k:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTree<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// empty list</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// search for parent node of key element</span>
			<span style="color: #000000; font-weight: bold;">var</span> searchN:MapAsBinarySearchTreeElement = <span style="color: #0066CC;">this</span>._findKeyParent<span style="color: #66cc66;">&#40;</span> k, <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> ref:MapAsBinarySearchTreeElement;
			<span style="color: #000000; font-weight: bold;">var</span> ref2:MapAsBinarySearchTreeElement;
&nbsp;
			<span style="color: #808080; font-style: italic;">// parent of key found, remove element</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> searchN <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">// invalidate cardinality</span>
				<span style="color: #0066CC;">this</span>._validCard = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
				<span style="color: #808080; font-style: italic;">// remove root node</span>
				<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> searchN == <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">key</span> == k <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
					ref = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>;
&nbsp;
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #66cc66;">!</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
						<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> = <span style="color: #000000; font-weight: bold;">null</span>; <span style="color: #808080; font-style: italic;">// only root element</span>
						<span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPush</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
					<span style="color: #66cc66;">&#125;</span>
&nbsp;
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #66cc66;">!</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
						<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">r</span>; <span style="color: #808080; font-style: italic;">// empty left tree</span>
						<span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPush</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
					<span style="color: #66cc66;">&#125;</span>
&nbsp;
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span><span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&amp;&amp;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
						<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">l</span>; <span style="color: #808080; font-style: italic;">// empty right tree</span>
						<span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPush</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
					<span style="color: #66cc66;">&#125;</span>
&nbsp;
					<span style="color: #808080; font-style: italic;">// both trees are filled</span>
					ref2 = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">r</span>;
					<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">l</span>;
&nbsp;
					<span style="color: #0066CC;">this</span>._getRight<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">r</span> = ref2;
&nbsp;
					<span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPush</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span>;
					<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
&nbsp;
				<span style="color: #808080; font-style: italic;">// remove node from tree middle</span>
				<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
					<span style="color: #808080; font-style: italic;">// found in left tree</span>
					<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> searchN.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&amp;&amp;</span> searchN.<span style="color: #006600;">l</span>.<span style="color: #0066CC;">key</span> == k <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
						ref = searchN.<span style="color: #006600;">l</span>;
&nbsp;
						searchN.<span style="color: #006600;">l</span> = searchN.<span style="color: #006600;">l</span>.<span style="color: #006600;">l</span>;
						<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> searchN.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
							<span style="color: #0066CC;">this</span>._getRight<span style="color: #66cc66;">&#40;</span> searchN.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">r</span> = ref.<span style="color: #006600;">r</span>;
						<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> searchN.<span style="color: #006600;">l</span> = ref.<span style="color: #006600;">r</span>;
&nbsp;
						<span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPush</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
&nbsp;
					<span style="color: #808080; font-style: italic;">// found in right tree</span>
					<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
						ref = searchN.<span style="color: #006600;">r</span>;
&nbsp;
						searchN.<span style="color: #006600;">r</span> = searchN.<span style="color: #006600;">r</span>.<span style="color: #006600;">l</span>;
						<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> searchN.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
							<span style="color: #0066CC;">this</span>._getRight<span style="color: #66cc66;">&#40;</span> searchN.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">r</span> = ref.<span style="color: #006600;">r</span>;
						<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> searchN.<span style="color: #006600;">r</span> = ref.<span style="color: #006600;">r</span>;
&nbsp;
						<span style="color: #0066CC;">this</span>.<span style="color: #006600;">poolPush</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span>;
						<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
&nbsp;
					<span style="color: #66cc66;">&#125;</span>
				<span style="color: #66cc66;">&#125;</span>
			<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
&nbsp;
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * @return the ratio of left to right tree card
		 * large number means heavy weight on left side, negavtive numbers means weight on right side
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getTreeBalance<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">isEmpty</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
&nbsp;
			<span style="color: #000000; font-weight: bold;">var</span> l:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">this</span>._card<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> r:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">this</span>._card<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span>.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> l <span style="color: #66cc66;">&gt;</span> r <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> l <span style="color: #66cc66;">/</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">max</span><span style="color: #66cc66;">&#40;</span> r, <span style="color: #cc66cc;">0.01</span> <span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> r <span style="color: #66cc66;">&gt;</span> l <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> -<span style="color: #cc66cc;">1</span><span style="color: #66cc66;">*</span> <span style="color: #66cc66;">&#40;</span> r <span style="color: #66cc66;">/</span> <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">max</span><span style="color: #66cc66;">&#40;</span> l, <span style="color: #cc66cc;">0.01</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * creates an string representation of the map
		 * @return String value of map
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._toString<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_root</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * recursice helper method for toString
		 * @param node value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt;, processed node
		 * @return string reprsentation
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> _toString<span style="color: #66cc66;">&#40;</span> node:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">!</span>node <span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #ff0000;">&quot;&quot;</span>;
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>._toString<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">l</span> <span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">' {k:'</span> + node.<span style="color: #0066CC;">key</span> + <span style="color: #ff0000;">' v:'</span>+ node.<span style="color: #006600;">value</span> +<span style="color: #ff0000;">'} '</span> + <span style="color: #0066CC;">this</span>._toString<span style="color: #66cc66;">&#40;</span> node.<span style="color: #006600;">r</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * Returns the cardinality of the pool - the number of elements
		 * @return A value of &lt;code&gt;Int&lt;/code&gt;, the number of elemets
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getPoolSize<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> ref:MapAsBinarySearchTreeElement = <span style="color: #0066CC;">this</span>._poolRoot;
			<span style="color: #000000; font-weight: bold;">var</span> card:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
			<span style="color: #b1b100;">while</span><span style="color: #66cc66;">&#40;</span> ref <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				ref = ref.<span style="color: #006600;">r</span>;
				++card;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #b1b100;">return</span> card;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * removes all unused elements from pool
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> emptyPool<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">this</span>._poolRoot = <span style="color: #000000; font-weight: bold;">null</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * pushed an element to the local pool
		 * @private
		 * @param n a value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt; Item to push into pool
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> poolPush<span style="color: #66cc66;">&#40;</span> n:MapAsBinarySearchTreeElement <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// empty pool</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>._poolRoot == <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #0066CC;">this</span>._poolRoot = n;
				<span style="color: #0066CC;">this</span>._poolRoot.<span style="color: #006600;">r</span> = <span style="color: #000000; font-weight: bold;">null</span>;
				<span style="color: #0066CC;">this</span>._poolRoot.<span style="color: #006600;">l</span> = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// non empty pool, keep reference</span>
			<span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
				n.<span style="color: #006600;">r</span> = <span style="color: #0066CC;">this</span>._poolRoot;
				<span style="color: #0066CC;">this</span>._poolRoot = n;
				<span style="color: #0066CC;">this</span>._poolRoot.<span style="color: #006600;">l</span> = <span style="color: #000000; font-weight: bold;">null</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * gets an objects from pool. if pool is empty element will be created
		 * @private
		 * @return a value of &lt;code&gt;MapAsBinarySearchTreeElement&lt;/code&gt; - single list item
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> poolPop<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#123;</span>
			<span style="color: #808080; font-style: italic;">// non empty pool, take first from pool</span>
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>._poolRoot <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">var</span> res:MapAsBinarySearchTreeElement = <span style="color: #0066CC;">this</span>._poolRoot;
&nbsp;
				<span style="color: #0066CC;">this</span>._poolRoot = <span style="color: #0066CC;">this</span>._poolRoot.<span style="color: #006600;">r</span>;
				res.<span style="color: #006600;">r</span> = <span style="color: #000000; font-weight: bold;">null</span>; <span style="color: #808080; font-style: italic;">// empty reference to pool nodes</span>
				res.<span style="color: #006600;">l</span> = <span style="color: #000000; font-weight: bold;">null</span>;
&nbsp;
				<span style="color: #b1b100;">return</span> res;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			<span style="color: #808080; font-style: italic;">// empty pool, create new element</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> MapAsBinarySearchTreeElement<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/05/as3datastructures.zip">Download AS3DataStructure.zip</a></p>
<p>&#8230; to be continued.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/05/actionscript-data-structures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FFK09 &#8211; Day02</title>
		<link>http://blog.sebastian-martens.de/2009/04/ffk09-day02/</link>
		<comments>http://blog.sebastian-martens.de/2009/04/ffk09-day02/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 22:52:20 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[André Michelle]]></category>
		<category><![CDATA[ffk09]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flashforum]]></category>
		<category><![CDATA[frank reitberger]]></category>
		<category><![CDATA[joa ebert]]></category>
		<category><![CDATA[Malte Beyer]]></category>
		<category><![CDATA[Mario Klingemann]]></category>
		<category><![CDATA[Nicolas Cannasse]]></category>
		<category><![CDATA[stefan nitzsche]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=118</guid>
		<description><![CDATA[Hallo und Humppa nach Norddeutschland, Tag 2. Nach einem doch längeren Abend als geplant im Studio 672 &#8211; der offiziellen Aftershowparty zur FFK &#8211; ging es heute morgen weiter im Text. &#8220;Interface Design &#8211; Best Practices&#8221; &#8211; Die FFK09 ist ja nun ausdrücklich keine reine Entwicklerkonferenz. Es geht um die Verschmelzung von Code und Design. [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo und Humppa nach Norddeutschland,</p>
<p>Tag 2. Nach einem doch längeren Abend als geplant im Studio 672 &#8211; der offiziellen Aftershowparty zur FFK &#8211; ging es heute morgen weiter im Text.</p>
<p>&#8220;Interface Design &#8211; Best Practices&#8221; &#8211; Die FFK09 ist ja nun ausdrücklich keine reine Entwicklerkonferenz. Es geht um die Verschmelzung von Code <strong>und</strong> Design. Der für mich beste Vortrag der in die Kategorie &#8220;Design&#8221; fällt war definitiv dieser. <a  href="http://nitzsche.info/">Stefan Nitzsche</a> die großen Probleme und die wichtigsten goldenen Regeln des Interfacedesigns ( nicht das ich mir anmaßen würde alle zu kennen und das wirklich beurteilen könnte, dass es die wichtigsten Regeln sind &#8211; aber ich alle schon mal gehört und erfolgreich wieder verdrängt ) in einem optisch inhaltlich und presentatorisch wertvollen Vortrag zusammengefasst. Prädikat besonders wertvoll.<span id="more-118"></span></p>
<p>Unter dem Titel &#8220;Einblicke in den Werkzeugkasten eines ActionScript Profis&#8221; hat Malte Beyer von den Powerflashern ( hat sich da eigentlich jemals jemand Gedanken gemacht das das im englischen schon ziemlich suboptimal ist ?! Flasher = Flitzer [ i.d.R. unbekleidet ] ) einen exemplarischen Workflow &#8211; wie er auch bei den Powerflashers vollzogen wird &#8211; für das Zusammenspiel von Designer und Entwicklern under Verwendung von <a  href="http://fdt.powerflasher.com/">FDT</a> und <a href="ant.apache.org/ivy/">Ivy-Ant-Task</a> gegeben. Immer sehr interessant zu sehen wie man es noch machen kann, und dabei noch Zeit spart &#8230;</p>
<p>Während im einen Saal unter dem Titel &#8220;Silverlight 3 Sneak Peak&#8221; die Vertreter der anderen Plattform mit Sicherheit viel Platz zum Tennisspielen hatten, drängte sich das Publikum zusammen um an den &#8220;10 Hot Minutes&#8221; teilzuhaben. Denn wenn das Flashforum ruft dann folgen dem alle Großen. Und nun durften die Mal zeigen was man alles mit der Flash Plattform machen kann wenn man dem Status des Normalsterblichen entwachsen ist. Frank Reitberger, Joa Ebert, Nicolas Cannasse, André Michelle und Mario Klingemann hatten jeweils 10 Minuten Zeit das Publikum zu beeindrucken.</p>
<p>Frank Reitberger hat auf seine PixelBender Blobs noch eins draufgesetzt. Den Sound kann auch ein Interface sein ( was von Stefan Nitzsche allerdings ausgeklammert wurde ). Mit dem Geräusch eines Föns hat er PixelBender Effekte gesteuert die den Eindruck von Wind auf ein Bild anwendeten. In der höheren Stufe des Föns wurde die Pixel dann sogar im wahrsten Sinne des Wortes dahingefegt.</p>
<p>Joa Ebert hat in 14 Minuten ein Partikelsystem erstellt, dass mit mehreren Tausend Partikeln performanter lief als ein C-Code der mittels Alchemy eingebunden und eigentlich auch schon performant lief ( und das war mal wirklich SpeedCoding ) &#8211; ohne Worte.</p>
<p>Nicolas Cannesse hat mittels HaXe und Physics Engine den Traum eines jeden kleinen und großen Kindes erfüllt. Mit Bauklötzen auf Bauklotztürme schießen und genüßlich zusehen wie alles in sich zusammenfällt. Und der Versuch mit einer Festkörperphysik Flüssigkeiten zu simulieren&#8230;</p>
<p>André Michelle schafft es mit 30 Zeilen Code und einer Klasse eine Guitarre aus dem Nichts zu erzeugen. Er demonstriert wie man eine zufälliges Nichts ( White Noise ) in Bytecode so mit kleinen Filter bearbeitet, dass es wirklich wie eine echte Guitarrenseite klingt. Noch ein paar Zeilen und Regler dazu in Jimmy Hendrix konnte einpacken! ( Audio-Design!  )</p>
<p>So wie André Michelle seinen Narren an Tönen gefressen hat kommt Mario Klingemann nicht von seiner Bildbearbeitung los. In seinen hot 10 minutes ging er unter die Fälscher und erstellte einen Van-Gough-Filter für Bilder.</p>
<p>Nach der Mittagspause ging es weiter mit &#8220;What is SWF?&#8221;.  Nicolas Cannesse nahm einmal den SWF Bytecode auseinander, bzw. wie dieser überhaupt erstellt wird. Ein wenig Werbung für HaXe war an dieser Stelle durchaus erlaubt, das an der ein oder anderen Stelle besseren OptCode erzeugt als Adobes AS-Compiler.</p>
<p>In dem vorletzten Vortrag ging es bei Andrè Michelle natürlich um Töne. Hier durfte mal in den Source vom Audiotool geguckt werden. Wie erzeugt man ein Delay im AS Code und wo kommen die Töne eigentlich her. Und natürlich gabs auch eine C64 Sounddemo. Amazing :)</p>
<p>Im letzten Vortrag hat Mario Klingemann nochmal den Werdegang eines digitalen Kunstwerks vollzogen. Welche kleinen Gedankenspiele und Codeschnipsel sind nötig, bzw. fügen sich später zu einem Großen und Ganzen zusammen &#8211; es gab also jede Menge bunte Bilder zu sehen &#8211; sehr passend und ein eindrucksvoller Abschluss für die FFK09 im Mediapark in Köln.</p>
<p>Vielen, vielen Dank an Marc Thiele und Sasche Wolter. Great Job. Well done. See you next year.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/04/ffk09-day02/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FFK09 &#8211; Day 01</title>
		<link>http://blog.sebastian-martens.de/2009/04/ffk09-day-01/</link>
		<comments>http://blog.sebastian-martens.de/2009/04/ffk09-day-01/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 19:20:40 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[augmented reality]]></category>
		<category><![CDATA[ffk09]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flashforum]]></category>
		<category><![CDATA[frank reitberger]]></category>
		<category><![CDATA[joa ebert]]></category>
		<category><![CDATA[marc thiele]]></category>
		<category><![CDATA[sasche wolters]]></category>
		<category><![CDATA[sven brencher]]></category>
		<category><![CDATA[tom krcha]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=112</guid>
		<description><![CDATA[Hallo und Humppa nach Norddeutschland, für alle die die es in diesem Jahr nicht zur großartigen Flashforum Konferenz nach Köln geschafft haben sei versichert &#8211; ihr habt etwas verpasst! Wieder einmal haben sich Marc Thiele und Sascha Wolters alle Mühe gegeben ein bunten Strauss an Vorträgen Rund um Kreativität in der Flash-Welt zu organisieren &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo und Humppa nach Norddeutschland,</p>
<p>für alle die die es in diesem Jahr nicht zur großartigen Flashforum Konferenz nach Köln geschafft haben sei versichert &#8211; ihr habt etwas verpasst! Wieder einmal haben sich <a  href="http://www.marcthiele.com/blog/">Marc Thiele</a> und <a  href="http://www.wolter.biz/">Sascha Wolters</a> alle Mühe gegeben ein bunten Strauss an Vorträgen Rund um Kreativität in der Flash-Welt zu organisieren &#8211; es ist erst Tag 1, aber es ist bereits gelungen.<br />
<span id="more-112"></span><br />
Die Keynote hielt Adobe Evangelist <a  href="http://www.webkitchen.be/">Serge Jespers</a>. Er gab eine breite Übersicht über die Flash Plattform. Wie weit ist Flash verbreitet und welche tollen Beispiele gibt es für jeden Bereich. Besonderen anklang fanden natürlich die Augmented Reality Beispiele (war mir auch neu: <a  href="http://www.livingsasquatch.com/">http://www.livingsasquatch.com/</a>, und natürlich GE <a  href="http://ge.ecomagination.com/smartgrid/">http://ge.ecomagination.com/smartgrid/</a>). Dann gabs natürlich noch den Klassiker der aktuellen Adobe Präsentationen: der tolle Workflow von Photoshop über Catalyst zu Flex Builder &#8230;</p>
<p>Unter dem Titel &#8220;The Return of the Blob&#8221; zeigte <a  href="http://gotballs.prinzipiell.com/">Frank Reitberger</a> was man nicht alles mit den klassischen Flash Filtern machen kann und eine ganze Reihe von Filtern für die man scheinbar nie echte Anwendung gefunden hat. Es müssen eben nicht immer nur animierte Quadrate sein, es geht auch mit Runden Ecken. Also ganz im Sinne von Web 2.0 tauschte man für eine Stunde in die Demo-Szene ab ( spitze Zungen behaupteten, die Blobs ( runde Gebilde ) erinneren mehr an aktuelle Schweinegrippe-Viren ).</p>
<p>Hinter &#8220;Audiotool Private Parts&#8221; versteckte sich der Vortrag von<a  href="http://www.joa-ebert.com/"> Joa Ebert </a>der zeigte, was er eigentlich alles nicht am Audiotool von Hobnox macht. Wirklich eindrucksvoll demonstrierte er was man alles schon mal im Informatikstudium gemacht hat und es auch durchaus einsieht und für sinnvoll hält, aber in den eigenen Projekten zu wenig einsetzt: vernünftige Datenstrukturen! Das Audiotool lebt in den wenigsten Fällen tatsächlich durch hochoptimierten Code sondern durch die Wahl der geeignten Datenstruktur, wie sie auch in Joas <a  href="http://wiki.joa-ebert.com/">ActionScript- Wiki</a> einzug halten sollen oder brereits haben. Aber nicht nur hier hat das Audiotool Team guten Code produziert. Auch an anderen Stellen werden ungünstige Frameworkbestandteile durch eigene Entwicklungen ersetzt ( z.B. das Eventmodell ). Getreu dem Motto &#8220;Open minds. Open source.&#8221; wurden und werden Teile der Projekte als Open Source unter <a  href="http://opensource.hobnox.com/">http://opensource.hobnox.com/</a>. bereitgestellt. Danke Hobnox ( die auch die Party gleich sponsoren ).</p>
<p>&#8220;Die Flash Video Plattform&#8221; &#8211; <a  href="http://www.svenbrencher.de/">Sven Brencher</a> at its best. Das Adobe Tools universal Genie fasste den Workflow von Video innerhalb der Adobe Welt zusammen &#8211; das Ganze aber unter dem Aspekt der Semantik. Adobe Premiere liest ein Video ein und ermittelt via Speech to Text den textuellen Inhalt. Dies wird auf die Timeline gemappt &#8211; ich passe evtl. noch Keywords an. Ab durch den Media Encoder damit rein in meinen Streamingserver und in meiner Flex Endanwendung tippe ich ein Suchwort ein, dass mich dann direkt an die Stelle springen lässt, an der der Sprecher das Wort benutzt hat &#8211; wenn doch alles soooo einfach wäre &#8230; :)<br />
( <a  href="http://www.slideshare.net/svenbrencher/flash-video-plattform">Die Slides gibt es hier</a> )</p>
<p>Ein hab ich noch: &#8220;Creating Realtime Flash Apps&#8221; &#8230;. war im Grunde der Anschlussvortrag zu Sven. Tom Krcha ging hier allerdings nochmal ein wenig tiefer auf die verschieden (Streaming) Server von Adobe ein. Was geht mit Blaze DS / LiveCycle oder FMS und welche Protokolle erlauben mir was und warum. Immer wieder toll ist aber natürlich die Kommunikation der einzelnen Flashplayer 10 untereinander. Einmal durch Adobe Stratus aufeinander aufmerksam gemacht kann das P2P-Netzwerk losgehen &#8230;</p>
<p>Auf einen spannenden zweiten Tag !</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/04/ffk09-day-01/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to handle massive ExternalInterface calls (JsCallStack)</title>
		<link>http://blog.sebastian-martens.de/2009/03/how-to-handle-massive-externalinterface-calls-jscallstack/</link>
		<comments>http://blog.sebastian-martens.de/2009/03/how-to-handle-massive-externalinterface-calls-jscallstack/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 20:45:22 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[JsCallStack]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=79</guid>
		<description><![CDATA[We use the ExternalInterface of the Flash Player to let JavaScript resize the HTML-Container of the Flex application. Our App loads dynamic content via XML and builds a list of entries. But we would like the user to use the standard browser scrollbar and not a scrollbar within the flex application. So we have to [...]]]></description>
			<content:encoded><![CDATA[<p>We use the ExternalInterface of the Flash Player to let JavaScript resize the HTML-Container of the Flex application. Our App loads dynamic content via XML and builds a list of entries. But we would like the user to use the standard browser scrollbar and not a scrollbar within the flex application. So we have to resize the HTM-Container of the Flex application, depending on its actual loaded content. Each time a new entry is added to the list, we call an JavaScript method from the Flex app via ExternalInterface to resize the HTML. This is done by using the resize-Event of Flex.</p>
<p>But sometimes the resize event is called up to 100 times within a second. In this cases some browsers ( sorry, but the IE seems to be ok ) didn&#8217;t get all JavaScript calls we made via ExternalInterface and some of our calls weren&#8217;t handled ( the container was not resized and our Flex list was cutted off ).<br />
<span id="more-79"></span><br />
In our first version of the app we made an default call, which calls the last JavaScript-resize after a specific period again. Easy but not very elegant.</p>
<p>What if done now is to implement an JavaScript-Call-Stack. You put in your ExternalInterface calls and the stack will process each after an other after a given pause between the calls. If you often have the same call, maybe only with updated parameters, just like our resize-Event which has different height and width values, the stack is able to clean older calls ( which aren&#8217;t processed up to than ) and only calles the latest (in our example the JavaScript method runs ~3 times and not 100 times). The disadvantage of ExternalInterface calls via such a stack is that this is no an asynchronous process and you have to define a callback-handler if you expect an return value of the JavaScript method.</p>
<p>How it&#8217;s done:<br />
Create an instance of the JsCallStack class. You should  set the timer for the JavaScript calls in ms (will be 500ms by default). Maybe this value could differ from browser to browser (and maybe client hardware), i didn&#8217;t test best values for that.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// init JS function call stack</span>
<span style="color: #0066CC;">this</span>._jsCalls = <span style="color: #000000; font-weight: bold;">new</span> JsCallStack<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">this</span>._jsCalls.<span style="color: #006600;">timerInterval</span> = <span style="color: #cc66cc;">30</span>;</pre></div></div>

<p>It is also possible to give the stack a different mode. By default the stack will be handled as FIFO-Stack (First-In-First-Out). This means that every new call will set at the last position of the queue. It&#8217;s also possible to use it as LIFO-Stack (Last-In-First-Out), means that the last call will be handled next.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// init JS function call stack as LIFO-Stack</span>
<span style="color: #0066CC;">this</span>._jsCalls = <span style="color: #000000; font-weight: bold;">new</span> JsCallStack<span style="color: #66cc66;">&#40;</span> JsCallStack.<span style="color: #006600;">STACK_MODE_LIFO</span> <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Second easy step: Make your JavaScript call:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">this</span>._jsCalls.<span style="color: #006600;">addJSCall</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;swfInputs.swfInputInit&quot;</span>, <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>, jsInitCompleteHandler<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>This will add a JavaScript method-call to your stack. First param is the method-name (here: method &#8220;swfInputInit&#8221; of the swfInputs-Object). The second parameter is an object which will be passed to the JavaScript method. This parameter is optional. The third parameter is the result-handler reference. If you expect any results from the JS-method, they will be handed over to this AS-method.<br />
The return value of the addJSCall-method is an integer value of the stack position your call have ( 1 = will be processed next ). If the result is -1 the ExternalInterface isn&#8217;t available.</p>
<p>There are also two more parameters: The fourth is the <em>skipOldCalls</em>-parameter. If this is set to true (default is false) older calls of the same JS-method name will be ignored and removed from the stack. The fifth-parameter is <em>convertToJSON</em>. This will convert your given object, which should pass to the JS-method, to JSON.</p>
<p>Happy AS + JS coding.</p>
<p>Download (2009/12/19) <a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/12/jscallstack.as">JsCallStack.as (Vector)</a><br />
Download (2009/03/29) <a  href="http://blog.sebastian-martens.de/wp-content/uploads/2009/03/jscallstack.as">JsCallStack.as (ArrayCollection)</a></p>
<p>cheers,<br />
Sebastian</p>
<p>Doing nice code-comments allows you faster blog-posts:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * constructor method
 * @param stackMode:int - stack mode of handling stack entries
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> JsCallStack<span style="color: #66cc66;">&#40;</span> stackMode:<span style="color: #0066CC;">int</span>=JsCallStack.<span style="color: #006600;">STACK_MODE_FIFO</span> <span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * adds an javascript function call to call stack
 * @param funcName:String - function name of js function to call
 * @param paramter:Object - object of paramters to path to the javascript function
 * 							Object will be converted to JSON and hand over an JSON-Object
 * @param resultHandler:Function - method to handler javascript results
 * @param skipOldCalls:Boolean - if true older calls in stack of the same functionname won't be
 * 								 called any more, only latest call
 * @param convert2JSON:Boolean - if true the parameter object will be converted to JSON for the javascript call
 * @return Int value of stack position, returns -1 if External Interface is not available
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addJSCall<span style="color: #66cc66;">&#40;</span> funcName:<span style="color: #0066CC;">String</span>, parameter:<span style="color: #0066CC;">Object</span>=<span style="color: #000000; font-weight: bold;">null</span>, resultHandler:<span style="color: #000000; font-weight: bold;">Function</span>=<span style="color: #000000; font-weight: bold;">null</span>, skipOldCalls:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">false</span>, convert2JSON:<span style="color: #0066CC;">Boolean</span>=<span style="color: #000000; font-weight: bold;">false</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * removes an javascript call from stack
 * @param id:int - identifier position of call which was returned from addJSCall Method
 * @return Boolean - function found an removed, false if already called
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> removeJSCall<span style="color: #66cc66;">&#40;</span> id:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * returns if the timer is running
 * @return Boolean - is the execution timer running
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> isExecutionRunning<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Boolean</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * returns the n number of registered functions at this momment
 * @return INT - numer of registered functions, which are not executed yet
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getRegisteredFunctionsCount<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * setter method for timer interval value
 * @param value:Int - timer interval in milliseconds
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">set</span> timerInterval<span style="color: #66cc66;">&#40;</span> value:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * getter method for timer interval
 * @return Int - set timer interval
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">get</span> timeInterval<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">int</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * pauses the execution of javascript calls
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> pauseExecution<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/**
 * restarts the execution of javascript calls
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> startExecution<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/03/how-to-handle-massive-externalinterface-calls-jscallstack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe MAX Europe Milan &#8211; Day 3</title>
		<link>http://blog.sebastian-martens.de/2008/12/adobe-max-europe-milan-day-3/</link>
		<comments>http://blog.sebastian-martens.de/2008/12/adobe-max-europe-milan-day-3/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 19:09:14 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=55</guid>
		<description><![CDATA[Hallo und Humppa! (aus Deutschland), Letzter Tag der Adobe MAX in Mailand. Nur noch ein paar Sessions bevor es wieder nach Hause geht mit dem Adobe MAX Bus ( auf der Rücktour haben wir nur 23 Stunden bis nach Hamburg gebraucht, und keine 28 wie auf der Hintour, glücklicherweise gabs weniger Schnee ). Erste Session. [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo und Humppa! (aus Deutschland),</p>
<p>Letzter Tag der Adobe MAX in Mailand. Nur noch ein paar Sessions bevor es wieder nach Hause geht mit dem Adobe MAX Bus ( auf der Rücktour haben wir nur 23 Stunden bis nach Hamburg gebraucht, und keine 28 wie auf der Hintour, glücklicherweise gabs weniger Schnee  ).</p>
<p>Erste Session. Nach der vorabendlichen Party doch irgendwie dünner besucht &#8230;<span id="more-55"></span><br />
&#8220;Flash Player Internals&#8221; &#8211; Endlich mal ws für Entwickler wenn man sich nicht schon mal zwangsläufig näher damit beschäftigt hat. Hier ging es darum wie der Flash Player arbeitet. Wann werden Objekte gezeichnet und wann und wie schlägt eigentlich der Garbadge-Collector zu.</p>
<p>Zweite Session: &#8220;Flash Lite 3: Learn How to Package and Distribute Mobile Content&#8221;.<br />
Um es vorweg zu nehmen, wann endlich AS3 für den Lite Player kommt und ws noch wurde nicht zufriedenstellend beantwortet. Aber eigentlich ging es auch mehr um den Workflow wie meine Flash App auf das Endgerät kommt.</p>
<p>Dritte Session: &#8220;Finding Away3D&#8221;.<br />
<a  href="http://www.away3d.com/">Away3D</a> ist ein Ableger des wohlbekannten Papervision. Allerdings mit ein paar schönen Bugfixes und Neuerungen. Gerade im Bereich Texture Mapping scheint Away3D seine stärken zu sehen. Der Vortrag stellte eine ganze Reihe von Umsetzungen von Projekten vor, die mit Away3D produziert wurden. Alle sehr eindrucksvoll anzusehen. U.a. auch einen animierten Ork der am Ende der Präsentation auch mit Hilfe C-Bibliotheken ( <a  href="http://labs.adobe.com/wiki/index.php/Alchemy">Alchemy</a> sei dank ) als Augmented Reality auf eine Blatt Papier projeziert wurde, das in die Webcam gehalten wird.</p>
<p>Unter &#8220;Flex and Adobe AIR Freestyle Hacking&#8221; versteht man es wenn Dirk Eismann Sven Claar einlädt eine Runde Code zu schreiben um Probleme zu lösen, die das Publikum live reinruft. Vorher im Blog angekündigt konnte man zu Beginn wenigesten zwei Probleme vorstellen und lösen um dem Publikum die Angst zu nehmen, den erfahrungsgemäß ist so ein Publikum ja ganz gerne mal schüchtern. Dies traf auch leider diesmal zu, und das Publikum wartete erst gegen Ende des Vortrags mit spannenden Fragen auf &#8211; Alles in Allem aber dennnoch lustig anzusehen.</p>
<p>Auch unter der letzten Session Flex und PHP hab ich mir eigentlich mehr drunter vorgestellt als die Erklärung wie man in Eclipse eine Flex und ein PHP Projekt erstellt und diese dann per AMF ( ws jetzt wohl neu auch im Zend-Framework enthalten ist ) miteinander reden zu lassen.</p>
<p>Das wars von der MAX, wir sehen uns dann ja alle Montag beim UG-Meeting.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2008/12/adobe-max-europe-milan-day-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

