<?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; JavaScript</title>
	<atom:link href="http://blog.sebastian-martens.de/tag/javascript/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>Webinale 2011</title>
		<link>http://blog.sebastian-martens.de/2011/05/webinale-2011/</link>
		<comments>http://blog.sebastian-martens.de/2011/05/webinale-2011/#comments</comments>
		<pubDate>Tue, 31 May 2011 16:26:56 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Gernot Pflüger]]></category>
		<category><![CDATA[Martin Oetting]]></category>
		<category><![CDATA[NUI]]></category>
		<category><![CDATA[Peter Schaar]]></category>
		<category><![CDATA[Sensory Minds]]></category>
		<category><![CDATA[wahwahfm]]></category>
		<category><![CDATA[webinale]]></category>
		<category><![CDATA[Wolfgang Henseler]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=602</guid>
		<description><![CDATA[Endlich habe ich es mal geschafft zur webinale nach Berlin zu kommen. Drei Tage Web Von-Bis bei gutem Essen und interessanten Themen &#8211; so der Plan. Die Eröffnungs Keynote kommt von Peter Schaar, dem Bundesbeauftragten für den Datenschutz und die Informationsfreiheit, und damit dem beruflichen Feind von Google. So versteht er seine Aufgabe aber zum [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2011/05/IMG_0412.jpg" class="thickbox no_icon" rel="gallery-602" title=""><img src="http://blog.sebastian-martens.de/wp-content/uploads/2011/05/IMG_0412-e1307132582441-150x150.jpg" alt="" title="IMG_0412" width="150" height="150" class="alignright size-thumbnail wp-image-619" /></a>Endlich habe ich es mal geschafft zur webinale nach Berlin zu kommen. Drei Tage Web Von-Bis bei gutem Essen und interessanten Themen &#8211; so der Plan.</p>
<p>Die Eröffnungs Keynote kommt von Peter Schaar, dem Bundesbeauftragten für den Datenschutz und die Informationsfreiheit, und damit dem beruflichen Feind von Google. So versteht er seine Aufgabe aber zum Glück nicht. Auch die Keynote war natürlich keineswegs der Aufruf alle tollen Apps einzustellen. Er wollte das Bewusstsein für den Datenschutz und die Selbstbestimmung des Users schaffen. Datenschutz gehört mit an den Anfang der Anwendungsentwicklung und nicht in irgendeine Phase nach dem Livestart &#8211; &#8220;Da war ja was&#8221;.</p>
<p>Start-up-Karussell: Innovative Multi-Device-Lösungen:<br />
Hier gabs zweimal ein Startup für digital Publishing für verschiedene Tablets, einen Geo-Location Dienst zum Freunde finde und Prämien bei Check-Ins kassieren und <a  href="http://wahwah.fm">wahwah.fm</a>. Letzteres hat mich offensichtlich überzeugt, weil es genau die Komponente abbildet die mir bei grooveshark.com noch fehlt: Zusammen musik hören. Der User stellt seine Playlist mit seiner eigenen Musik zusammen ( auch die eigene Musik hochladen oder entsprechende Musikportale einbinden &#8211; derzeit nur Soundcloud ) und stellt das dann als eigene Radiostation zusammen. Die verbundenen Freunde können dann zusammen die gleiche Musik hören und sich entsprechend dazu auch austauschen. Die iPhone App befindet sich im Review. Überzeugt!<br />
<span id="more-602"></span></p>
<p>Social &#8211; Idee Heineken &#8211; The Invite:<br />
<iframe src="http://player.vimeo.com/video/23215772?title=0&amp;byline=0&amp;portrait=0" width="455" height="252" frameborder="0"></iframe>
<p><a  href="http://vimeo.com/23215772">Heineken &#8211; The Invite</a> from <a  href="http://vimeo.com/maxgebhardt">Max Gebhardt</a> on <a  href="http://vimeo.com">Vimeo</a>.</p>
<p>Das mobile Internet im Jahr 2021:<br />
&#8230; hier wurden keine großen Geheimnisse ausgeplaudert die sonst noch keiner weiß. Aber es war eine sehr gute Zusammenfassung aktueller Trends und vieler Studien die so zusammengenommen, ein gutes Bewusstsein für allg. Weiterentwicklung schärften.</p>
<p>Ganzheitliche Webseitenoptimierung &#8211; mehr als nur SEO<br />
&#8230; klang erstmal nach allg. Performance Tipps und zumindest technisch und eben nach mehr als eine einseitige Betrachtung von SEO. Aber als man nach 15min die große Geheimformel immer noch &#8220;Man muss die wirklich wichtigen Personen im Team des Kunden herausfinden&#8221; war, fand ich das dann doch eine große Schleife zu Thema SEO. Erste Stunde Projektmanagement &#8211; wenn überhaupt, war irgendwie unangebracht.</p>
<p>Viral = genial? Eine Gebrauchsanleitung für virale Kommunikation<br />
Entsprechend 15min verspätet dort angekommen &#8211; tolle Unterhaltung. Sicherlich kann man einen viralen Erfolg nur sehr schwer planen. Aber unterlegt mit viel Beispielen &#8211; was hat funktioniert, was hat nicht funktioniert und was gibt es überhaupt an viralen Kampagnen ( man bekommt ja doch nicht alles mit ) &#8211;  hat der Vortrag nicht nur einen tollen Unterhaltungwert sondern auch einen echten Nährwert. Hier nochmal ein paar Beispiele:</p>
<p>Greenpeace vs. Nestle:<br />
<a  href="http://www.youtube.com/watch?v=ToGK3-2tZz8">http://www.youtube.com/watch?v=ToGK3-2tZz8</a><br />
<a  href="http://www.youtube.com/watch?v=VaJjPRwExO8">http://www.youtube.com/watch?v=VaJjPRwExO8</a></p>
<p>TomTom &#8211; Break Free mit John Cleese:<br />
<a  href="http://www.youtube.com/watch?v=n0HZhM_CrSg&#038;feature=relmfu">http://www.youtube.com/watch?v=n0HZhM_CrSg&#038;feature=relmfu</a><br />
<a  href="http://www.youtube.com/user/tomtombreakfree#p/u/1/gxMS2cSsNJo">http://www.youtube.com/user/tomtombreakfree#p/u/1/gxMS2cSsNJo</a></p>
<p>Frank geht ran &#8211; Nummer für Deutschland ( symio ):<br />
<a  href="http://www.frank-geht-ran.de/">http://www.frank-geht-ran.de/</a></p>
<p>Canal+ Good Story:<br />
<a  href="http://www.youtube.com/watch?v=PWcc2hCwsWM">http://www.youtube.com/watch?v=PWcc2hCwsWM</a></p>
<p>Mach du das:<br />
<a  href="http://www.youtube.com/watch?v=k6taxx5NBu0">http://www.youtube.com/watch?v=k6taxx5NBu0</a></p>
<p>Need a new barbeque:<br />
<a href="http://www.ibelieveinadv.com/2006/10/vijay-sales/ ">http://www.ibelieveinadv.com/2006/10/vijay-sales/ </a></p>
<p><strong>Tag 2</strong><br />
NUI Usability &#8211; Zur Gestaltung des Nichts<br />
Spitzenklasse. Wolfgang Henseler &#8211; Professor und Creative Managing Director von <a  href="http://www.sensory-minds.com/">Sensory Minds</a> hat einen sehr interessanten Vortrag zum Thema &#8220;Natural User Interface&#8221; gehalten. Er beschrieb die Entwicklung das Wie und Warum, von dem Command Line Interface (CLI) über das heutige Graphical User Interface (GUI) hin zu der nächsten Station der Interfaces dem Natural Uer Interface. Wenn von der Eingabe hin zu situativen Diensten ohne spezielle Eingabemedien. Es bedarf keiner künstlichen Abstraktionsebene mehr für eine Operation sondern das Object wird direkt bearbeitet ( &#8220;Zur Gestaltung des Nichts&#8221; ). Jetzt muss man mal wieder was mit Touch bauen. ( Nachtrag: Video von der FFK10 <a  href="http://vimeo.com/18400281">http://vimeo.com/18400281</a> )</p>
<p><iframe src="http://player.vimeo.com/video/6648869?title=0&amp;byline=0&amp;portrait=0&amp;color=CCFF00" width="455" height="252" frameborder="0"></iframe>
<p><a  href="http://vimeo.com/6648869">ring°wall</a> from <a  href="http://vimeo.com/sensoryminds">SENSORY-MINDS</a> on <a  href="http://vimeo.com">Vimeo</a>.</p>
<div style="width:455px" id="__ss_8171897"> <strong style="display:block;margin:12px 0 4px"><a  href="http://www.slideshare.net/sensoryminds/nui-usability-zur-gestaltung-des-nichts" title="NUI Usability - Zur Gestaltung des Nichts">NUI Usability &#8211; Zur Gestaltung des Nichts</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/8171897" width="455" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a  href="http://www.slideshare.net/">presentations</a> from <a  href="http://www.slideshare.net/sensoryminds">SENSORY-MINDS</a> </div>
</p></div>
<p>Einblicke in die Fußangeln der weltweiten Browserspieleentwicklung<br />
&#8230; war kein technischer Vortrag, sondern ein Walk-Through durch alle Schritte einer Browsergame Entwicklung. Worauf muss ich achten, woran sollte ich denken. Alles kein Hexenwerk und eigentlich bekannt, aber gut zusammengefasst und gut das man es mal wieder hört. Auch andere haben deine Probleme :)</p>
<p>Dawning Age of Mobile Internet<br />
&#8230; war leider so gar nicht Keynote. Mobile Blabla, das irgendwie in anderen Vorträgen besser rüber kommt / kam.</p>
<p>Webdesigntrends 2011<br />
Klingt natürlich ein wenig hochtraben, war aber letztlich doch ganz gut. Vitaly Friedman vom Smashing Magazin erzählte nicht darüber welche Designelemente jetzt gerade &#8220;In&#8221; sind oder nicht, sondern darüber wie Webseiten aufgebaut sein sollten um heutigen Richtlinien stand zu halten. Besonders das Thema Multi-Device, sprich unterschiedliche Auflösungen war ein Thema: Stichwort Fluid Layout und CSS3 Media Quiries.</p>
<p>JavaScript: Best Practise zur Qualitätssicherung<br />
Cool: Ich mach das schon wie die ( abgesehen von der automatisierten Einbindung von JS Unit Tests ).<br />
Eigentlich ging es in dem Vortrag um den klassischen Aufbau eines Softwareprojektes ( Modular, Testing, Refactoring, Coding Guidelines, &#8230; ) angewendet auf JavaScript.</p>
<p><strong>Tag 3</strong><br />
Das digitale Paradies uns seine Sklaven<br />
Gernot Pflüger stellt seine Erfahrungen der letzten 20 Jahre mit einem ganz anderen Firmenmodell vor. Der erste Vortrag seit langem der völlig ohne Slides auskommt. Einfach toll und inspirierend.</p>
<p>Strategie ist Trump &#8211; Neue Maßstäbe für Browsergames<br />
Holger Nathrath von Blue Byte/ Ubisoft stellt die online Version des Klassikers &#8220;Die Siedler&#8221; vor. Umgesetzt wurde das Spiel mit Adobes Flash Plattform. Interessante Einblicke in die Planung und die Gründe für die Flash Plattform. Klasse Umsetzung.</p>
<p>Der virale Faktor<br />
Schon der zweite Vortrag der ohne Slides auskommt. Aber keines Falls schlechter auch hier ein klasse Abriss über die Medienlandschaft aus der Sicht von Martin Oetting. Sehr empfehlenswert.</p>
<p>Fighting Layout Bugs<br />
&#8230; war die Vorstellung von <a  href="http://code.google.com/p/fighting-layout-bugs/">http://code.google.com/p/fighting-layout-bugs/</a> einer Scriptsammlung zur automatischen Erkennung von Layoutbugs, wie z.B. dem Herausragen von Texten über Kanten, überflüssiger horizontale Scrollbalken o.ä. Die Scripte setzen dabei auf dem Selenium 2 Framework auf.</p>
<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2011/05/IMG_0413.jpg" class="thickbox no_icon" rel="gallery-602" title=""><img src="http://blog.sebastian-martens.de/wp-content/uploads/2011/05/IMG_0413-150x150.jpg" alt="" title="IMG_0413" width="150" height="150" class="alignright size-thumbnail wp-image-622" /></a>Wer Gewinnspiele braucht, hat keine Botschaften &#8211; Social Media uns so !<br />
Love It !! Vielen Dank Christoph Bornschein von Torben, Lucie und die gelbe Gefahr. Nicht nur das ich den Firmenname liebe, sondern auch den Vortrag. Die 60 &#8220;blanker Hass&#8221; gegen Facebook Gewinnspiele ohne Sinn und Verstand waren ein wahrhaft krönender Abschluss für mich für die Konferenz. Was bringen mir xy-Tausend Friends auf Facebook die ich über ein Gewinnspiel &#8220;angelockt&#8221; habe ? Die reine Anzahl bringt mein Unternehmen keines wegs weiter. Vielleicht nur schlecht gelaunte Freunde die auf das nächste Gewinnpspiel warten. Aber keiner von denen identifiziert sich mit meiner Marke.</p>
<p>Die Glücklichen, die sich rechtzeitig Tickets organisiert hatten, durften sich dann noch über ein Intellibook Netbook freuen. Vielen Dank. Wieder eine wenig Spielzeug. Dann vielleicht bis zum nächsten Jahr.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2011/05/webinale-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSCONF 2010, Berlin</title>
		<link>http://blog.sebastian-martens.de/2010/10/jsconf-2010-berlin/</link>
		<comments>http://blog.sebastian-martens.de/2010/10/jsconf-2010-berlin/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 21:24:13 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Brendon Eich]]></category>
		<category><![CDATA[cloud9 ide]]></category>
		<category><![CDATA[common.js]]></category>
		<category><![CDATA[dojo]]></category>
		<category><![CDATA[Douglas Crockford]]></category>
		<category><![CDATA[ECMA5]]></category>
		<category><![CDATA[ie9]]></category>
		<category><![CDATA[jsconf]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[peter higgins]]></category>
		<category><![CDATA[require.js]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=512</guid>
		<description><![CDATA[Hallo und Humppa nach Norddeutschland, Endlich darf ich mal wieder raus. Dieses mal zur JavaScript Conference Europa ( jsconf.eu ) nach Berlin. Die Tickets ware relativ schnell ausverkauft &#8211; es sollte auch bewusst klein gehalten werden. Insgesamt wurde knapp 200 JS-Fans Eintritt gewährt. Man merkte auch recht schnell, dass es sich wirklich um eine europäische [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo und Humppa nach Norddeutschland,</p>
<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2010/10/IMG_0241.jpg" class="thickbox no_icon" rel="gallery-512" title=""><img src="http://blog.sebastian-martens.de/wp-content/uploads/2010/10/IMG_0241-e1286737537334-150x150.jpg" alt="" title="IMG_0241" width="150" height="150" class="alignnone size-thumbnail wp-image-519" /></a> Endlich darf ich mal wieder raus. Dieses mal zur <a  href="http://www.jsconf.eu/">JavaScript Conference Europa</a> ( jsconf.eu ) nach Berlin. Die Tickets ware relativ schnell ausverkauft &#8211; es sollte auch bewusst klein gehalten werden. Insgesamt wurde knapp 200 JS-Fans Eintritt gewährt. Man merkte auch recht schnell, dass es sich wirklich um eine europäische Konferenz handelte. Deutsche Sprache war eher die Außnahme.</p>
<p>Die Keynote von Dion Almaer, Ben Galbraith ( ajaxian.com ) zusammengefasst: &#8220;Das Web ist gut und ganz wichtig in der Zukunft. Die JavaScript Performance wird besser. Ende&#8221; &#8211; war also recht übersichtlich.</p>
<p>Als Freund von <a  href="http://dojotoolkit.org">dojo</a> habe ich mich natürlich auf Peter Higgins ( @phiggins ) gefreut. Es gab nichts großes Neues. Mehr ein &#8220;Good Parts&#8221; Version von Peter Higgins.<span id="more-512"></span> Dazu gehörten für ihn auch die Etablierung von serverseitiges JavaScript mit node.js und CommonJS, sowie require.js.</p>
<p>Jenn Lukas Vortrag &#8220;JavaScript + Web Standards II: The Quickening&#8221; war im Wesentlich ein Vortrag zu Webstandards. &#8220;Halte dich an Standards. Achte darauf das deine Seite auch ohne JavaScript funktioniert. Denke an ScreenReader uns SEO.&#8221; Immer mal wieder gut sich auf den Boden der Tatsachen zurückholen zu lassen. Genauso wie man auch Test für seine Anwendung schreiben sollte &#8230;.</p>
<p>Tim Caswell hat in seinen &#8220;Techniques and Tools for Taming Tangled Twisted Trains of Thought&#8221; node.js vorgestellt und dessen non-blocking Architektur.</p>
<p>Ein wenig off topic war der Vortrag von <a  href="http://www.stubbornella.org/content/">Nicole Sullivan</a>. Ihr Job ist die Optimierung von CSS in großen Projekten. Sie hat z.B. das CSS von Facebook optimiert. &#8220;Benutze &#8216;grep&#8217; um doppelte Definitionen von Tags zu finden. Erstelle ein einheitliches Gridlayout um Seitendefinitionen nicht unnötig zu wiederholen.&#8221; -> &#8220;It&#8217;s all about pattern matching.&#8221; Sehr schön zu sehen, dass man es eigentlich schon ganz richtig macht, und sich nur häufiger mal dazu zwingen müsste aufzuräumen.</p>
<p>Sehr spannend und unbedingt einen Blick wert ist die <a  href="http://www.cloud9ide.com/">Cloud9 IDE</a> die Fabian Jakobs vorgestellt hat. Dabei handelt es sich um einen webbasierten Editor mit allem was dazugehört. Sieht gut aus und scheint flüssig zu laufen. Und das alles auch noch erweiterbar und weitestgehend opensource -> <a  href="http://github.com/ajaxorg/cloud9">http://github.com/ajaxorg/cloud9</a>. Give it a try !</p>
<p>Spannend und politisch wurde es als Microsofts Product Manager Pete LePage den neuen IE9 vorstellt. Microsoft scheint sich tatsächlich an Standards halten zu wollen und steuert dafür eine große Zahl von Testfällen bei. Auch die JavaScript Engine wurde maßgeblich verbessert. Außerdem wird der IE9 die Grafikkarte zum Rendern verwenden werden können. Man wird also wirklich gespannt sein können. Und dann darf man sich wieder über den IE ärgern, wenn man die ganzen Anpassungen für den IE wieder umbauen muss weil sie aufmal funktionieren wie in anderen Browsern.</p>
<p>Den Abschluss für den ersten Tag bildete Brandon Eich, einer der Schöpfer von JavaScript und immer noch tätig im ECMA Ausschuss für die Weiterentwicklung von JavaScript, Er stellt die Pläne und aktuellen Drafts zu ECMA5 vor. Dort ging es vor allem um Proxy Objecte innerhalb der JavaScript Implementationen. Die Proxy Objekte stellen eine API zu einer Meta-Ebene bereit. Dies soll z.B. die Implementationen von Getter und Setter Methode vereinfachen. Dann wird es sicher noch viel mehr Anwendungsfällen geben wenn man das alles richtig verstanden hätte. Diese Proxy- Handling ist bereits im aktuellen Firefox 4 umgesetzt. Für WebKit steht ebenfalls eine Implementation bereit.</p>
<p>Bevor es mit Bussen zur Party ging wurden noch die Gewinner des zuvor ausgelobten <a  href="http://js1k.com/home">1kB JS Wettbewerbs</a> gekrönt. Ziel war es etwas möglichst Eindrucksvolles in maximal 1024 Zeichen JavaScript Code zu pressen. Ich hätte es nicht für möglich gehalten. Wie der erste Platz beweist bekommt man ein komplettes Jump + Run Spiel in 1024 Zeichen unter. Nur auf dem zweiten Platz: Ein komplettes Schachspiel inklusive Computergegner ( der sich zudem noch nicht schlagen lässt ). Man sollte sich die Liste der Gewinner unbedingt mal ansehen</p>
<p><strong>Tag 2</strong></p>
<p>Den Opener am zweiten Tag machte der JavaScript Guru Douglas Crockford der mit einem einfachen Slide die anwesenden Massen begeistern konnte &#8221; <strong>IE6 must die!</strong> &#8220;.  Es ging weiter um Schleifen innerhalb von JS und natürlich auch dort um serverseitiges JavaScript. Auch als Presenter sehr zu empfehlen.</p>
<p>Jens Arps	stellte in &#8220;The hitchhiker&#8217;s guide to client side persistent data storage.&#8221; die verschieden aktuellen Methoden vor Daten auf dem Client dauerthaft und ggf. in größerer Menge zu speichern. Leider kommt er zum Schluss, dass man immer noch nicht über die Verknüpfung mehrer Lösungen herumkommt, da auch hier die Browserwelt zu differenziert ist und SQLite noch nicht ausreichend verbreitet und auch in der Implementation zu unterschiedlich ist.</p>
<p>Ryan Dahl ist der Schöpfer von node.js. In &#8220;Techniques for a single stack world&#8221; stellt er die aus seiner Sicht 10 größten TODOs für node.js vor. So fehlt z.B. im Moment noch ein richtiger SSL support und eine ausreichende Performance Test Suite.</p>
<p>Bei Jed Schmidt ging es um sein (fab) framework, das für einen nicht blockierenden Code sorgt, und dabei einen möglichst reibungslosen Callback- Mechnismus implementiert. Die Schreibweise des Codes ist dabei zwar bei wenigen Zeilen schnell getan und das Ergebnis vermutlich auch schnell funktionsfähig, doch bevor dafür nicht jemand einen vernünftigen Editor / Syntaxhighlighting gebaut hat, scheint es zu schnell zu unübersichtlich zu werden.</p>
<p>Ebenfalls etwas fürs Auge: &#8220;Robotic JavaScript&#8221;. Jörn Zaefferer &#038; Nikolai Onken gingen der Frage nach was man mit JavaScript alles anstellen kann, wenn man den Browser erst einmal verlassen hat. In Verbindung mit node.js auf dem Server lassen sich so nicht nur Verbindung mit dem Wii- Controller herstellen, sondern auch Hardware ansteuern, wie z.B. Discokugeln -ferngesteuert mit dem iPhone.</p>
<p>Mark Wubben, den man sonst als Schöpfer von siFr kennt, beschäftigte sich mit der Erstellung von Browser-Extensions. Leider musste ich die Bahn rechtzeitig erwischen, sonst gäbe es vielleicht mehr zu berichten.</p>
<p>JSONF EU &#8211; Gerne wieder.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/10/jsconf-2010-berlin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>User Mouse Tracking / Website Research</title>
		<link>http://blog.sebastian-martens.de/2010/07/user-mouse-tracking-website-research/</link>
		<comments>http://blog.sebastian-martens.de/2010/07/user-mouse-tracking-website-research/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 11:08:24 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Selfnote]]></category>
		<category><![CDATA[Click Test]]></category>
		<category><![CDATA[Mousetracking]]></category>
		<category><![CDATA[useability test]]></category>
		<category><![CDATA[user tests]]></category>
		<category><![CDATA[Usertracking]]></category>
		<category><![CDATA[Website Analytics]]></category>
		<category><![CDATA[website research]]></category>
		<category><![CDATA[websitetest]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=478</guid>
		<description><![CDATA[If you use website statistic tools &#8211; and thats something i guess everybody is interested in &#8211; you got well numbers about how many users visit your website and exactly which page of your website. You will also know from which other website the came and which key words they used within Google to get [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2010/07/mouse-move-tracker.jpg" class="thickbox no_icon" rel="gallery-478" title=""><img src="http://blog.sebastian-martens.de/wp-content/uploads/2010/07/mouse-move-tracker-150x150.jpg" alt="" title="mouse-move-tracker" width="150" height="150" class="alignnone size-thumbnail wp-image-479" /></a></p>
<p>If you use website statistic tools &#8211; and thats something i guess everybody is interested in &#8211; you got well numbers about how many users visit your website and exactly which page of your website. You will also know from which other website the came and which key words they used within Google to get to your page. Each of this are very important facts for exmaple for SEO aspects, etc. For example Google Analytics is of course a great free tool for this ( include the old discussion how many more should Google know about you and your website ).<span id="more-478"></span></p>
<p>What i also want to know is where do the users navigate best on my website. What are the best places to put links, so the users will find AND click them ( no &#8211; i don&#8217;t plan to put any adds on my website &#8211; just interested ). Google Analytics has an overlay mode. But this will highlight the existing links. So it will show up which links works best. This comes close, but not perfect.</p>
<p>There are some enterprise tools which do such kind of overlay mode with the users mouse movements. But they are too expensive for me. I guess there will be also some free tools available out there, but programming is also fun :)</p>
<p>So i wrote my little tool which will save the users mouse postion each X milliseconds. If the users leavs the current page, it will make one AJAX request and save all mouse coordinates within one file ( currently not in a database, beacuse writing to filesystem is a bit faster ). When you would like to display the users mouse activity just add <strong>#overlay</strong> at the end of the current URL. It will sum up all saved mouse movements and create a grid overlay over your website. By default the grid elements are 10&#215;10 px large. Each grid field get a color by its relative mouse overs. The more often users moved their mouse over these coords the more red the field will be ( see screenshot for example ).</p>
<p>Of couse this is no perfect solution. But because most users move the mouse the same way they also look over the screen this is a very easy way to track such behaviour.</p>
<h5>How to implement:</h5>
<p>It&#8217;S very easy to use. Just extract the ZIP below onto your webserver and put a little piece of JavaScript into your HTML code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span> language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;javascript&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #003366; font-weight: bold;">var</span> mouseMoveTracker <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> MouseMoveTracker<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #3366CC;">'rootNodeId'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'contentNode'</span><span style="color: #339933;">,</span>
			<span style="color: #3366CC;">'actionURI'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'../server/'</span><span style="color: #339933;">,</span>
			<span style="color: #3366CC;">'actionURIOverlay'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'../server/result/'</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>The <strong>MouseMoveTracker</strong> class has three major parameters:</p>
<p><em>rootNodeId</em>: The html root node of the tracked section. Because the script id coordinate based it works best with a fixed size layout. Therefor you should enter the Id of the node which has a fixed width and sourrounds all content.</p>
<p><em>actionURI</em>: This is the path to the serverside writing script. To this adress the AJAX requests for writing the user coords will be send.</p>
<p><em>actionURIOverlay</em>: This is the url the script expects to get data from for creating the overlay mode. It will request data via AJAX from this URL after you enter #overlay at the end of the URL and refresh your page.</p>
<p>Feel free to use, modify the code and/or comment here.</p>
<p><a  href="http://blog.sebastian-martens.de/wp-content/uploads/2010/07/mouse-move-tracker.zip">Download mouse-move-tracker.zip (45kB) includes test html file</a></p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/07/user-mouse-tracking-website-research/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamic Resize Flash Application Container / Flash Stage ( without external JavaScript )</title>
		<link>http://blog.sebastian-martens.de/2010/06/resize-flash-application-container/</link>
		<comments>http://blog.sebastian-martens.de/2010/06/resize-flash-application-container/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 12:29:32 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[resize stage]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=459</guid>
		<description><![CDATA[[Update: Add complete Flash Builder project source files. ] If you have dynamic content within your Flash application or you have several states or &#8220;pages&#8221; implemented, which all have different content, it might be helpful to resize your flash aplication container within the html- context. For this it&#8217;s not enough to resize the application from [...]]]></description>
			<content:encoded><![CDATA[<p>[<strong>Update</strong>: Add complete Flash Builder project source files. ]<br />
If you have dynamic content within your Flash application or you have several states or &#8220;pages&#8221; implemented, which all have different content, it might be helpful to resize your flash aplication container within the html- context. For this it&#8217;s not enough to resize the application from within the flash application. You also have to resize the surrounding html container. This is the <em>object</em> tag for Mozilla browsers or the <em>embed</em> tag, if the client uses the Internet Explorer.</p>
<p>In each case you have to use the ExternalInterface. You call it from the flash application with parameters for the new height and width value of the flash container. On the other side you have to define an javascript function which do the resize operation with these values.</p>
<p>Here is an AS3 class which already includes the JavaScript part. Soyou don&#8217;t have to define an extra JS function. So you just have to import the AS3 class into your project and your ready to resize you application from Flash.<span id="more-459"></span></p>
<p>There are three methods to call:</p>
<ul>
<li><b><em>resize</em></b>:This method takes two parameters <em>height</em> and <em>width</em> to completly set the absolute height and width of the flash application.</li>
<li><b><em>addHeight</em></b>: Takes one integer parameter. The value will be added to the current height. So &#8220;50&#8243; for 50px more height or &#8220;-20&#8243; for 20px less in height.</li>
<li><b><em>addWidth</em></b>: Takes one integer parameter. The value will be added to the current width. So &#8220;50&#8243; for 50px more width or &#8220;-20&#8243; for 20px less in width.</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * resizes the flash container to needed dimensions
 * @param height - new needed height
 * @param width - new needed with
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> resize<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">height</span>:<span style="color: #0066CC;">int</span>, <span style="color: #0066CC;">width</span>:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * adds a specific value (+/-) to current height
 * @param valueHeight
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addHeight<span style="color: #66cc66;">&#40;</span> valueHeight:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * adds a specific value (+/-) to current width
 * @param valueHeight
 */</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> addWidth<span style="color: #66cc66;">&#40;</span> valueWidth:<span style="color: #0066CC;">int</span> <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></pre></div></div>

<p>To resize your application you could add an resize event handler to check specific containers for resize and do the resizing via this class in the event handler method. If you have fixed sizes per state you could of course also do it the static way.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/**
 * @author: Sebastian Martens; sebastian@sebastian-martens.de
 * @copyright: Creative Commons. Free to use &quot;as is&quot;
 *
 * Test Application
 */</span>
package<span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">nonstatics</span>.<span style="color: #006600;">swfSelfResize</span>.<span style="color: #006600;">swfSelfResize</span>;
&nbsp;
	<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;
&nbsp;
	<span style="color: #66cc66;">&#91;</span>SWF<span style="color: #66cc66;">&#40;</span>frameRate=<span style="color: #ff0000;">&quot;31&quot;</span>, <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;500&quot;</span>, <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;100&quot;</span>, <span style="color: #0066CC;">backgroundColor</span>=<span style="color: #ff0000;">&quot;0x008866&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> swfSelfResizeTest <span style="color: #0066CC;">extends</span> Sprite<span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> resize:swfSelfResize;
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * constructor
		 */</span>
		<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> swfSelfResizeTest<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #0066CC;">super</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">resize</span> = <span style="color: #000000; font-weight: bold;">new</span> swfSelfResize<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// resize to 500px height, 400px width</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">resize</span>.<span style="color: #006600;">resize</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">500</span>, <span style="color: #cc66cc;">400</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// add 50px height -&gt; 550px height</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">resize</span>.<span style="color: #006600;">addHeight</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;">50</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #808080; font-style: italic;">// remove 10px width -&gt; 390px</span>
			<span style="color: #0066CC;">this</span>.<span style="color: #006600;">resize</span>.<span style="color: #006600;">addWidth</span><span style="color: #66cc66;">&#40;</span> -<span style="color: #cc66cc;">10</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/2010/06/com1.zip">Download com.nonstatics.swfSelfResize.as (12kB)</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2010/06/bin-debug.zip">Download bin-debug (20kB)</a><br />
<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2010/06/swfSelfResize.zip">Full Flash Builder Project (131kB)</a></p>
<p>Be aware of the security model of the flash player! This won&#8217;t work on local filesystem (file://xyz). So please use it on your server (http://www.yourdomain.com) or with your locally installed testserver (http://localhost/whatever).</p>
<p>Hope this helps you.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/06/resize-flash-application-container/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Quick start with Flash ExternalInterface class</title>
		<link>http://blog.sebastian-martens.de/2010/05/quick-start-with-flash-externalinterface-class/</link>
		<comments>http://blog.sebastian-martens.de/2010/05/quick-start-with-flash-externalinterface-class/#comments</comments>
		<pubDate>Fri, 21 May 2010 08:52:45 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[ExternalInterface]]></category>
		<category><![CDATA[flash javascript bridge]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=406</guid>
		<description><![CDATA[The ExternalInterface class allows you to communicate with the Flash wrapping container, which is usually the HTML page with JavaScript capeability. It allows you to send data from ActionsScript to JavaScript and vice versa. The ExternalInterface class is implemented for nearly all current browsers. Please see the documentation for a detailed list of the supported [...]]]></description>
			<content:encoded><![CDATA[<p>The <a  href="http://livedocs.adobe.com/flash/9.0_de/ActionScriptLangRefV3/flash/external/ExternalInterface.html" rel="nofollow">ExternalInterface</a> class allows you to communicate with the Flash wrapping container, which is usually the HTML page with JavaScript capeability. It allows you to send data from ActionsScript to JavaScript and vice versa.</p>
<p>The ExternalInterface class is implemented for nearly all current browsers. Please see the documentation for a detailed list of the supported browsers <a  href="http://livedocs.adobe.com/flash/9.0_de/ActionScriptLangRefV3/flash/external/ExternalInterface.html" rel="nofollow">here</a>.</p>
<p>All five attributes and methods are static, so you don&#8217;t need an instance of this class.</p>
<h4>Make sure ExternalInterface is available</h4>
<p>When using the ExternalInterface you should make sure it&#8217;s available. So please test the boolean value <em>ExternalInterface.available</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> ExternalInterface.<span style="color: #006600;">available</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> .... <span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><span id="more-406"></span></p>
<h4>Call JavaScript from ActionScript</h4>
<p>To call a JavaScript function from ActionScript you just the the method <em>ExternalInterface.call</em>. First argument must be the function name of the JavaScript method you would like to call. All other parameters will hand over as parameters to the JavaScript method. These parameters should be primitive types like String, Number or even simple Object.</p>
<p>JavaScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> myJSFunction<span style="color: #009900;">&#40;</span> param1<span style="color: #339933;">,</span> param2<span style="color: #339933;">,</span> param3 <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> param1 <span style="color: #339933;">+</span> <span style="color: #3366CC;">': '</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span> parseInt<span style="color: #009900;">&#40;</span>param2<span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> parseInt<span style="color: #009900;">&#40;</span>param3<span style="color: #339933;">,</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #006600; font-style: italic;">// parseInt is definetly the nicer way</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>ActionScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">private</span> <span style="color: #003366; font-weight: bold;">function</span> externalInterfaceTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000066; font-weight: bold;">void</span><span style="color: #009900;">&#123;</span>
   <span style="color: #003366; font-weight: bold;">var</span> a<span style="color: #339933;">:</span>int <span style="color: #339933;">=</span> <span style="color: #CC0000;">4</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> b<span style="color: #339933;">:</span>int <span style="color: #339933;">=</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">;</span>
   <span style="color: #003366; font-weight: bold;">var</span> c<span style="color: #339933;">:</span>String <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Hello World&quot;</span><span style="color: #339933;">;</span>
&nbsp;
   ExternalInterface.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;myJSFunction&quot;</span><span style="color: #339933;">,</span> c<span style="color: #339933;">,</span> b<span style="color: #339933;">,</span> a <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This will show up an alert window with text and calculated numbers.</p>
<p>The <em>call</em> method will also handle return values of the JavaScript method. At least for this you should be aware of the security model of the flash player, otherwise you might get an <em>null</em> value instead the expected result. Therefore please set the flash parameter <em>allowScriptAccess</em> to <em>always</em> and the allowed domain within your flash application.</p>
<p>HTML:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot; /&gt;
   &lt;embed allowScriptAccess=&quot;sameDomain&quot; [...]</pre></div></div>

<p>SWFObject:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
   params.<span style="color: #660066;">allowscriptaccess</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;always&quot;</span><span style="color: #339933;">;</span>
swfobject.<span style="color: #660066;">embedSWF</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;flvplayer.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;videoPlayer&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;650&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;530&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;9.0.28&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;expressInstall.swf&quot;</span><span style="color: #339933;">,</span> flashvars<span style="color: #339933;">,</span> params<span style="color: #339933;">,</span> attributes<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Flash App:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;">flash.<span style="color: #0066CC;">system</span>.<span style="color: #006600;">Security</span>.<span style="color: #0066CC;">allowDomain</span><span style="color: #66cc66;">&#40;</span> yourDomain <span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>If you configured that way you will be able to recieve return values from your JavaScript function and use them in your ActionScript method.</p>
<p>JavaScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> myJSFunction<span style="color: #009900;">&#40;</span> val <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;JavaScripts says: &quot;</span> <span style="color: #339933;">+</span> val<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>ActionScript:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> exInterfaceTest<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: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> ExternalInterface.<span style="color: #006600;">available</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
      <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;myJSFunction&quot;</span>, <span style="color: #ff0000;">&quot;Hello World&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<h4>Call ActionScript method from JavaScript</h4>
<p>Its also possible to start the other way round, that you call an ActionScript method from an JavaScript function. Therefor you have to register an callback function within your AS code. You will connect any method name with an existing method.</p>
<p>This is done with the <em>addCallback</em> method. First argument is any function name you like. This will be the function you could call within JavaScript. The second argument is an function reference or closure which should be handle the call. All arguments will be passed to this method.</p>
<p>The JavaScript side function is an object of the flash wrapping container ( Object-Element / Embed-Element ) which should be referenced by it&#8217;s id/name. Also for this direction arguments and return values are possible.</p>
<p>HTML/JavaScript:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"> <span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;JavaScript&quot;</span><span style="color: #339933;">&gt;</span>
     <span style="color: #003366; font-weight: bold;">var</span> init <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
     <span style="color: #003366; font-weight: bold;">var</span> flashObjId <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myExInterfaceTest&quot;</span><span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #006600; font-style: italic;">// flash is initialised and AS methods could be called</span>
     <span style="color: #003366; font-weight: bold;">function</span> flashReady<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
         init <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
         callAsMethod<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
&nbsp;
     <span style="color: #003366; font-weight: bold;">function</span> callAsMethod<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #003366; font-weight: bold;">var</span> objRef<span style="color: #339933;">;</span>
&nbsp;
         <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> window<span style="color: #009900;">&#91;</span> flashObjId <span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
             <span style="color: #006600; font-style: italic;">// none microsoft</span>
             objRef <span style="color: #339933;">=</span> window<span style="color: #009900;">&#91;</span>flashObjId<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
             objRef <span style="color: #339933;">=</span> document<span style="color: #009900;">&#91;</span>flashObjId<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
         <span style="color: #009900;">&#125;</span>
&nbsp;
         <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> objRef.<span style="color: #660066;">jsCallHandler</span><span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">&quot;myArguments&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
 <span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
     <span style="color: #339933;">&lt;</span>object classid<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;</span>
             id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;myExInterfaceTest&quot;</span> width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;100&quot;</span> height<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;100&quot;</span>
             codebase<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab&quot;</span><span style="color: #339933;">&gt;</span>
         <span style="color: #339933;">&lt;</span>param <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;movie&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;test.swf&quot;</span> <span style="color: #339933;">/&gt;</span>
         <span style="color: #339933;">&lt;</span>param <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;allowScriptAccess&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;sameDomain&quot;</span> <span style="color: #339933;">/&gt;</span>
         <span style="color: #339933;">&lt;</span>embed src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;test.swf&quot;</span> quality<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;high&quot;</span>
             width<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;100&quot;</span> height<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;100&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;myExInterfaceTest&quot;</span> align<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;middle&quot;</span>
             allowScriptAccess<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;sameDomain&quot;</span> pluginspage<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://www.macromedia.com/go/getflashplayer_de&quot;</span><span style="color: #339933;">&gt;</span>
         <span style="color: #339933;">&lt;/</span>embed<span style="color: #339933;">&gt;</span>
     <span style="color: #339933;">&lt;/</span>object<span style="color: #339933;">&gt;</span>
&nbsp;
 <span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span></pre></div></div>

<p>ActionScript part:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// This method is called when initialisation is finished and application is ready</span>
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> initCompleteHandler<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: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> ExternalInterface.<span style="color: #006600;">available</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
       ExternalInterface.<span style="color: #006600;">addCallback</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;jsCallHandler&quot;</span>, javaScriptHandlerMethod <span style="color: #66cc66;">&#41;</span>;
       ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;flashReady&quot;</span> <span style="color: #66cc66;">&#41;</span>;
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> javaScriptHandlerMethod<span style="color: #66cc66;">&#40;</span> arg <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: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;ActionScript says:&quot;</span> + arg <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>For a large number of JavaScript calls from ActionScript to JavaScript i regular use the <a  href="/jscallstack">jsCallStack</a> class which implements an stack of javascript calls to handle this timed and avoid doubled calls.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/05/quick-start-with-flash-externalinterface-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preload assets with JavaScript, load-complete callback for single assets include SWF/Flash</title>
		<link>http://blog.sebastian-martens.de/2010/05/preload-assets-with-javascript-load-complete-callback-for-single-assets-include-swfflash/</link>
		<comments>http://blog.sebastian-martens.de/2010/05/preload-assets-with-javascript-load-complete-callback-for-single-assets-include-swfflash/#comments</comments>
		<pubDate>Sat, 15 May 2010 13:02:42 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[flash callback]]></category>
		<category><![CDATA[flash loaded event]]></category>
		<category><![CDATA[Preloader]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=383</guid>
		<description><![CDATA[Currently i need to know within JavaScript when a SWF-file was loaded completly. You could easily handle this with a single ExternalInterface call from within the Flash-application. This is not a very nice solution if this has to be done for each of you flash-applications. This is the neccesary way if you also have to [...]]]></description>
			<content:encoded><![CDATA[<p>Currently i need to know within JavaScript when a SWF-file was loaded completly. You could easily handle this with a single ExternalInterface call from within the Flash-application. This is not a very nice solution if this has to be done for each of you flash-applications. This is the neccesary way if you also have to access the flash-application from javascript-side. But in my case i just need to know when the flash is loaded and available in the browser cache.</p>
<p>For this i wrote the <em>swfJSPreLoader</em>. This preloader accepts an array of assets (jpg,gif,png,swf) you would like to preload. Internally it will create an flash-application which does the preloading. You could define several callback handlers. So JavaScript gets to know when all assets are loaded or each single asset is loaded including SWF-files.<span id="more-383"></span></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #003366; font-weight: bold;">var</span> swfJSPreLoaderConfig <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #3366CC;">'_swfPath'</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'./'</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// configure path to preloader SWF file</span>
&nbsp;
		<span style="color: #3366CC;">'assets'</span><span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>	<span style="color: #3366CC;">'assets/teaser.swf'</span><span style="color: #339933;">,</span>
				 	<span style="color: #3366CC;">'assets/img2.jpg'</span><span style="color: #339933;">,</span>
				 	<span style="color: #3366CC;">'--error--'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
&nbsp;
		<span style="color: #3366CC;">'assetLoaded'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> asset<span style="color: #339933;">,</span> bytes<span style="color: #339933;">,</span> <span style="color: #000066;">status</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> asset <span style="color: #339933;">+</span> <span style="color: #3366CC;">' loaded ('</span> <span style="color: #339933;">+</span> bytes <span style="color: #339933;">+</span> <span style="color: #3366CC;">')'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
		<span style="color: #3366CC;">'loadComplete'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'all assets loaded. totally loaded bytes: '</span> <span style="color: #339933;">+</span> swfJSPreLoader.<span style="color: #660066;">loadedBytes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
		<span style="color: #3366CC;">'loadError'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'load error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
		<span style="color: #3366CC;">'callback'</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			swfJSPreLoader.<span style="color: #660066;">addAsset</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'assets/teaser2.swf'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">status</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
															<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'teaser2 loaded status:'</span> <span style="color: #339933;">+</span> <span style="color: #000066;">status</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
														<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
&lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;swfJSPreLoader.js&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>To use the swfJSPreLoader you have to include three js files for swfObjects, JQuery and the swfJSPreLoader.js. You also have to define an JS variable <em>swfJSPreLoaderConfig</em> to configure the preloader. The config-variable could hold the following items:</p>
<ul>
<li><strong><em>assets</em></strong>: assets is an array of the assets which should be loaded. The asset-paths must be relative the html page. If you insert wrong asset pathes you could define an error handler. The assets array is optional. You could also add assets via method call.</li>
<li><strong><em>assetLoaded</em></strong>: assetLoaded defines the callback method for each loaded asset. So this method will be called each time an asset is loaded completly. There are three parameters. <em>asset</em> &#8211; gives the asset-path; <em>bytes</em> &#8211; gives the number of loaded bytes of the current asset; <em>status</em> &#8211; gives the loading status ( 200: Ok, 404: Loading error )</li>
<li><strong><em>loadComplete</em></strong>:The loadComplete callback method will be called after the queue of assets to load is empty. Not all assets need be loaded successfully. If not the error-callback will be fired.</li>
<li><strong><em>loadError</em></strong>:The loadError callback will be triggered if the current asset could not be loaded correctly.</li>
<li><strong><em>callback</em></strong>:With callback you could register a method which is called after the initialization of the swfJSPreLoader. After this method is called you could use the public methods of the pre loader.</li>
</ul>
<p>There are two public methods of the swfJSPreLoader. Both methods are ready after the callback method is called and the initialisation is ready ( the loader flash is instanziated ).</p>
<p><strong><em>swfJSPreLoader.addAsset</em></strong>: The <em>addAsset</em> method allows you to add a single asset to add to the loading queue. It takes to parameters. The first is the path to the asset, the second is the callback handler, which will be fired after this specific asset was loaded. The callback will also be called if the loading fails. The callback gets one argument <em>status</em> with the loading status ( 200: Ok, 404: Loading error ).</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/**
 * @public
 *
 * adds asset to loading queue
 * @param {String} assetPath - path to assets to load
 * @param {Function} callback - optional callback handler when loading is complete
 */</span>
addAsset<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> assetPath<span style="color: #339933;">,</span> callback <span style="color: #009900;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">swfJSPreLoader.<span style="color: #660066;">addAsset</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'assets/teaser2.swf'</span><span style="color: #339933;">,</span>
						<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">status</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
							<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'teaser2 loaded status:'</span> <span style="color: #339933;">+</span> <span style="color: #000066;">status</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong><em>swfJSPreLoader.loadedBytes</em></strong>: The <em>loadedBytes</em> method returns the number of <del datetime="2011-08-07T09:35:23+00:00">total loaded bytes</del> currently loaded bytes on each call.</p>
<p>Update 2011-08-07:<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2011/09/swfJSPreLoader.zip">swfJSPreLoader Flash Builder Project Sourcefiles (ZIP, 62kb)</a></p>
<p>Update 2010-05-17:<a  href="http://blog.sebastian-martens.de/wp-content/uploads/2010/05/swfJSPreLoader-Test1.zip">swfJSPreLoader-Test (ZIP, 532kb)</a></p>
<p><a name="examples"></a><br />
<b>Examples</b> (added 2010-11-07, updated 2011-08-07)</p>
<p>After this seems to be difficult here are some more working examples. All tested at FF4.0b6/OSX; Safari5/OSX; Chrome7.0/OSX;  FF3.6/WinXP; IE8/WinXP. Please not that this should be tested from an Server environment and not from local filesystem and requires an installed Flash Plugin.</p>
<p>Added an example for loading from other servers via crossdomain policy file and showing percent loading status.</p>
<p><a href='http://blog.sebastian-martens.de/wp-content/uploads/2010/05/swfJSPreLoader-Test1.zip'>download examples</a></p>
<p>I hope this is helpfull for anybody.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/05/preload-assets-with-javascript-load-complete-callback-for-single-assets-include-swfflash/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Set innerHeight also for IE</title>
		<link>http://blog.sebastian-martens.de/2009/08/set-innerheight-also-for-ie/</link>
		<comments>http://blog.sebastian-martens.de/2009/08/set-innerheight-also-for-ie/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 17:49:10 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[innerHeight]]></category>
		<category><![CDATA[innerWidth]]></category>
		<category><![CDATA[Mozilla]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=233</guid>
		<description><![CDATA[I&#8217;m really not a fan of popup windows within a website. But sometimes it really makes sense. For example for a little campaign which is more or less a microsite. But you want not to lose the website context. In this case i would &#8220;allow&#8221; to open the campaign in a popup window. The popup [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really not a fan of popup windows within a website. But sometimes it really makes sense. For example for a little campaign which is more or less a microsite. But you want not to lose the website context. In this case i would &#8220;allow&#8221; to open the campaign in a popup window.</p>
<p>The popup window should of course be as small as possible and should resize to the campaigns size. But because you never know which kind of Browsertoolbars the user have installed ( and you don&#8217;t want to disallow all tool- and browserbars ) you can&#8217;t really set the window size, because the IE does not support the innerHeight or innerWidth attribute of the window-element.<br />
<span id="more-233"></span><br />
Mozilla based browsers do support it and resize the complete window that way, that all content is fully shown. The following script checks the browsers scroll attibute to resize the IE browser window step by step. Not very nice, but it works. Please let me know if there is a better way to to this. This is the first i found.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> setInnerSize<span style="color: #009900;">&#40;</span>width<span style="color: #339933;">,</span>height<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">innerWidth</span> <span style="color: #339933;">&amp;&amp;</span> window.<span style="color: #660066;">innerWidth</span><span style="color: #339933;">!=</span><span style="color: #3366CC;">&quot;undefined&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     	window.<span style="color: #660066;">innerWidth</span> <span style="color: #339933;">=</span> width<span style="color: #339933;">;</span>
     	window.<span style="color: #660066;">innerHeight</span> <span style="color: #339933;">=</span> height<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>
     	run <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
     	runHeight <span style="color: #339933;">=</span> height<span style="color: #339933;">;</span>
     	runWidth <span style="color: #339933;">=</span> width<span style="color: #339933;">;</span>
&nbsp;
     	window.<span style="color: #660066;">resizeTo</span><span style="color: #009900;">&#40;</span> runWidth<span style="color: #339933;">,</span> runHeight <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     	<span style="color: #000066; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span> run  <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      		window.<span style="color: #660066;">scrollTo</span><span style="color: #009900;">&#40;</span> <span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      		scrollV <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">?</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollTop</span><span style="color: #339933;">:</span>document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollTop</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      		scrollH <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #339933;">?</span>document.<span style="color: #660066;">documentElement</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #339933;">:</span>document.<span style="color: #660066;">body</span>.<span style="color: #660066;">scrollLeft</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> scrollH <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> runWidth <span style="color: #339933;">=</span> runWidth<span style="color: #339933;">+</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
      		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> scrollV <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span> <span style="color: #009900;">&#41;</span> runHeight <span style="color: #339933;">=</span> runHeight<span style="color: #339933;">+</span><span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
&nbsp;
      		window.<span style="color: #660066;">resizeTo</span><span style="color: #009900;">&#40;</span> runWidth<span style="color: #339933;">,</span> runHeight <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>  <span style="color: #009900;">&#40;</span>scrollV<span style="color: #339933;">+</span>scrollH<span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #CC0000;">10</span> <span style="color: #009900;">&#41;</span> run <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span>
     	<span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/08/set-innerheight-also-for-ie/feed/</wfw:commentRss>
		<slash:comments>1</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>Rendererror on IE6 + AJAX with multiple selects</title>
		<link>http://blog.sebastian-martens.de/2009/03/rendererror-on-ie6-ajax/</link>
		<comments>http://blog.sebastian-martens.de/2009/03/rendererror-on-ie6-ajax/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 15:25:00 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[IE6]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=66</guid>
		<description><![CDATA[Who ever has to support the old IE6 and is not able to ignore or to bann users with this browser (or is part of an active resistance de:&#8221;Webmaster-Aufstand-gegen-alte-Internet-Explorer&#8221; ), has to hack around things quiet often. One big problem is that the IE6 has some render problems when you manipulate content in the DOM [...]]]></description>
			<content:encoded><![CDATA[<p>Who ever has to support the old IE6 and is not able to ignore or to bann users with this browser (or is part of an active resistance de:&#8221;<a  href="http://www.heise.de/netze/Webmaster-Aufstand-gegen-alte-Internet-Explorer--/news/meldung/133204">Webmaster-Aufstand-gegen-alte-Internet-Explorer</a>&#8221; ), has to hack around things quiet often.<br />
One big problem is that the IE6 has some render problems when you manipulate content in the DOM tree. If this happens to earlie you maybe get boxs which are cut off or your footer may have an wrong position because the IE didn&#8217;t update the box size in which you updated your content.<span id="more-66"></span></p>
<p>In my case i had an select field with the attribute &#8220;multiple&#8221;. This should haven an height of 300px set via CSS. The select-node was created via JavaScript. The first select got content via AJAX. The second should be empty as long as you don&#8217;t double click the first and copy content from left to right.  The complete construction was created and attachted on page load. The first select was displayed correctly. But the second one looks like an normal select with one line height, not 300px as expected.</p>
<p>To fix this problem you have to set an little timer which triggers an function which again manipulates the element to force the IE to rerender this section. So if your footer position is wrong after an update of any content, just update an little style attribute and reset it:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;getElementById('footerId').style.height = (footerHeight+1)+'px'; getElementById('footerId').style.height = (footerHeight-1)+'px';&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This <strong>doesn&#8217;t</strong> work with my empty multiple select when i used the select field itself. I had to create an new DIV-Container right under the select-field which i resized a bit and removed it afterwards. This then also updated the select-field.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;ieFixSelect('mySelect')&quot;</span><span style="color: #339933;">,</span><span style="color: #CC0000;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> ieFixSelect<span style="color: #009900;">&#40;</span> selectId <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> node <span style="color: #339933;">=</span> getElementById<span style="color: #009900;">&#40;</span> selectId <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003366; font-weight: bold;">var</span> fixNode <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DIV'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    node.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span> fixNode <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    fixNode.<span style="color: #660066;">style</span>.<span style="color: #660066;">height</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'1px'</span><span style="color: #339933;">;</span>
    fixNode.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span> fixNode <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2009/03/rendererror-on-ie6-ajax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

