<?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/category/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>Adobe MAX 2011 &#8211; L.A.</title>
		<link>http://blog.sebastian-martens.de/2011/10/adobe-max-2011-l-a/</link>
		<comments>http://blog.sebastian-martens.de/2011/10/adobe-max-2011-l-a/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 21:25:55 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[Apps]]></category>
		<category><![CDATA[L.A.]]></category>
		<category><![CDATA[MAX]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Technologie]]></category>
		<category><![CDATA[Touch]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=722</guid>
		<description><![CDATA[Hallo und Humppa! nach Deutschland, vorweg einmal vielen Dank an Adobe, dass ich dieses Jahr die Eintrittskarte zur Adobe MAX für mich kostenlos gab. Auch wenn es in diesem Jahr nicht so einen großen Hype um neue Ankündigungen zur MAX im Vorwege gab wie im letzten Jahr, sollte es doch zumindest eine Reise nach L.A. [...]]]></description>
			<content:encoded><![CDATA[<p>Hallo und Humppa! nach Deutschland,</p>
<p>vorweg einmal vielen Dank an Adobe, dass ich dieses Jahr die Eintrittskarte zur Adobe MAX für mich kostenlos gab. </p>
<p>Auch wenn es in diesem Jahr nicht so einen großen Hype um neue Ankündigungen zur MAX im Vorwege gab wie im letzten Jahr, sollte es doch zumindest eine Reise nach L.A. Wert sein. Zumindest das Opening der ersten Keynote auch rein von der Show her sehr überzeugt. Mit 48 HD Beamern wurde hier eine große Show auf eine riesiege Leinwand im Nokia-Theater gebracht:</p>
<p><iframe width="455" height="255" src="http://www.youtube.com/embed/8o_KCHdjWGM" frameborder="0" allowfullscreen></iframe><span id="more-722"></span></p>
<p>Der Sonntag startete mit dem Community Summit. Für die User Group Manager gab es ein gemeinsames Treffen mit vielen Infos rund um die Community Arbeit bei Adobe. Wer macht was, was ist neu, sowie eine Open-Mic-Session für die vertretenen User Groups. Aber auch für nicht User Group Manager gab es eine vielzahl an Präsentationen, Vorträge und Preconference Labs.</p>
<p>An Annehmlichkeiten wurde von Adobe nicht gespart. Selbst an der Eingangstür gab es drei Herren, deren Job es war, die Leute willkommen zu heißen &#8211; sonst nichts. Auch das Essen hätte schlechter sein können, schließlich wollen hier mehr als 5000 Personen gleichzeitig versorgt werden.</p>
<p>Der erste Tag der Kernkonferenz begann mit der Keynote von Adobe CEO Kevin Lynch im Nokia Theater an. Wirkliche technische Neuerung gabe es eigentliche keine zu bewundern. Die wesentlichen Neuerungen waren eher die neuen Ausrichtungen des Konzernz. Zum einen die mobilen Anwendungen präsentiert in Form der Touch Apps. Sowie die dahinter stehende Cloud Landschaft die die bisherigen Adobe Formate versteht und für die mobilen Endgeräte entsprechend zugänglich macht. Ebenfalls neu sind die Abomodelle der klassischen Software in Verbindung mit der Adobe Cloud. So wird man sich nicht mehr die klassischen Create Suite Pakete kaufen müssen, sondern kann, zu Anfang einen begrenzten Umfang an Software, auch je nach Gebrauch über eine Abo-Modell beziehen (SaaS).</p>
<p>In wie Weit die Touchvarianten für den Alltagsgebrauch sinnvoll einsetzen lassen wird sich zeigen wenn die Software Anfang 2012 für den Endkunden verfügbar sein wird.</p>
<p>Auch musste man sowohl in der Keynote am ersten wie am zweiten Tag auf das Thema Flashj Plattform warten. Adobe präsentierte sich ganz klar als HTML5 Company. Dies heißt natürlich nicht, dass die Flash Plattform fallen gelassen wird, allerdings wird der Focus öffentlichkeitswirksam eher auf das Thema HTML + JavaScript gelegt.</p>
<p>Leider waren die meisten der Vorträge die ich besucht habe häufig sehr oberflächlich und nur sehr selten tiefgreifend ( amerikanisch ?! ). </p>
<p>Was dagegen richtig gelungen war, waren wie gesagt die Eröffnungspräsentation und die MAX Bash, die Party nach dem zweiten Konferenztag. Buffet über mindestens 150m, 10 Imbisswagen mit verschiedensten Köstlichkeiten, Performance-Künstlern, Nerd-Spielen und die Band Weezer als Abendhighlight &#8211; eben richtig Hollywood.</p>
<p>Schlussendlich also eine super Show, aber leider inhaltlich wenig Neues und auch leider nicht die reichlichen Geschenke wie im vergangenen Jahr.</p>
<p>cheers.<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2011/10/adobe-max-2011-l-a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Obfuscate/ hide JavaScript code by including into Flash file</title>
		<link>http://blog.sebastian-martens.de/2011/06/obfuscate-hide-javascript-code-by-including-into-flash-file/</link>
		<comments>http://blog.sebastian-martens.de/2011/06/obfuscate-hide-javascript-code-by-including-into-flash-file/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 22:01:43 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=629</guid>
		<description><![CDATA[Why / Pro / Con Of course there will be a lot people who might say that it&#8217;s bullshit to include JavaScript into a Flash file (.swf) to obfuscate the JavaScript code &#8211; and your right. This is just one thing you can do which has some advantages and also some disadvantages. In case you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Why / Pro / Con</strong></p>
<p>Of course there will be a lot people who might say that it&#8217;s bullshit to include JavaScript into a Flash file (.swf) to obfuscate the JavaScript code &#8211; and your right. This is just one thing you can do which has some advantages and also some disadvantages.</p>
<p>In case you want to hide your JavaScript source code not to be seen by other people because it takes you so much time or even money to develop this code &#8211; sorry to say, but this will not finally work. There are a lot websites out their which &#8220;encrypt&#8221; your JavaScript code and make it less readable for humans. But there are as well sites which do the opposit and make it really well readable again. So it will always be possible to have a look at your source code. Also hiding the JavaScript in a flash file will just makes it more difficult, but not impossible, because you could also decompile the flash file.<br />
<span id="more-629"></span><br />
The worst disadvantage of executing the JavaScript code from within an flash file is of course that this requires flash support at the client side. So this is applicable if you already use flash on your site or at least for all JavaScript parts that are directly related to the flash application. This also encapsulates all application parts in one file ( and reduced the number of loaded files ).</p>
<p><strong>Do it</strong></p>
<p>The first thing you should do ist to compact your JavaScript to keep it small. You could use the JavaScript Compressor by Dean Edwards ( <a  href="http://javascriptcompressor.com/">http://javascriptcompressor.com/</a> ), the Google Closure Compiler (<a  href="http://closure-compiler.appspot.com/home"> http://closure-compiler.appspot.com/home</a> ) or other tools. Here is a little tool uses different compressors and shows the compared results: <a  href="http://compressorrater.thruhere.net/">http://compressorrater.thruhere.net/</a>. Be sure you have a clean JS code before you compress it ( <a  href="http://www.jslint.com/">JSlint</a> &#8211; it might hurt your feelings ), otherwise the compacted JS might not work. You will end up in a single line string of compressed JavaScript code.</p>
<p>Here is a simple JavaScript example, which creates an new div-Container as child of an existing container. The id of the existing container is &#8216;myCurrentNodeID&#8217;. This should be changed dynamically. Therefore this will be replaced by an more abstract placeholder which will be replaced by an regular expression.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> myJSMethod<span style="color: #009900;">&#40;</span> nodeId <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> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span> nodeId <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  newNode<span style="color: #339933;">;</span>
&nbsp;
  newNode <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>
  node.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span> newNode <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span> nodeId <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
myJSMethod<span style="color: #009900;">&#40;</span> <span style="color: #3366CC;">'myCurrentNodeID'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Compressed and with replaced node id this looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> myJSMethod<span style="color: #009900;">&#40;</span>nodeId<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>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>nodeId<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>newNode<span style="color: #339933;">;</span>newNode<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>node.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>newNode<span style="color: #009900;">&#41;</span> <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>nodeId<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>myJSMethod<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'###'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In our final implementation we will have one variable or const with the JavaScript code. In your final project you should create and ANT task for the JS processing. To include all JavaScript into one file, compress the file and paste the JS String into the ActionScript class.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> myClass <span style="color: #0066CC;">extends</span> Sprite<span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;">// this JavaScript code will be injected first into the page</span>
		<span style="color: #0066CC;">private</span> const JS_CODE:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;function myJSMethod(nodeId){var node=document.getElementById(nodeId),newNode;newNode=document.createElement('DIV');node.appendChild(newNode) alert(nodeId)}myJSMethod('###');&quot;</span>;
		<span style="color: #0066CC;">private</span> const JS_PATTERN:RegExp = <span style="color: #66cc66;">/</span><span style="color: #808080; font-style: italic;">###/g;</span>
		<span style="color: #808080; font-style: italic;">// node id given dynamical to the class</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> nodeId:<span style="color: #0066CC;">String</span>;
&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> myClass<span style="color: #66cc66;">&#40;</span> nodeid <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
                        <span style="color: #0066CC;">this</span>.<span style="color: #006600;">nodeId</span> = nodeid;
			<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">available</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
				<span style="color: #808080; font-style: italic;">// injekt js code</span>
				ExternalInterface.<span style="color: #0066CC;">call</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;eval&quot;</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">getJSCode</span><span style="color: #66cc66;">&#40;</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>
&nbsp;
		<span style="color: #808080; font-style: italic;">/**
		 * replaces a strings by pattern within the javascript code snipped
		 * @return replaced javascript code
		 */</span>
		<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> getJSCode<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">JS_CODE</span>.<span style="color: #006600;">replace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">JS_PATTERN</span>, <span style="color: #0066CC;">this</span>.<span style="color: #006600;">nodeId</span> <span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
&nbsp;
                <span style="color: #808080; font-style: italic;">// do your stuff</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>In the class constructor the JavaScript will be executed the an eval statement via the External Interface. This will make the JavaScipt code available in the browser context. Even the JavaScript function &#8220;eval&#8221; ist evil, this will only be executed once. Be sure you don&#8217;t make to much use of it in your own code.</p>
<p>You can find full working demo code here &#8211; its used for my self resize class: <a  href="http://blog.sebastian-martens.de/2010/06/resize-flash-application-container/">http://blog.sebastian-martens.de/2010/06/resize-flash-application-container/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2011/06/obfuscate-hide-javascript-code-by-including-into-flash-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>Google Developer Day 2010</title>
		<link>http://blog.sebastian-martens.de/2010/11/google-developer-day-2010/</link>
		<comments>http://blog.sebastian-martens.de/2010/11/google-developer-day-2010/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 12:47:39 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[Conference]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[gdd2010]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Developer Day]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=584</guid>
		<description><![CDATA[Dieses Jahr habe ich es endlich mal wieder geschafft zu den Google Developer Days zu kommen. Veranstaltungsort dieses Mal in München. Die größte Enttäuschung gabs es gleich am Eingang &#8211; ein Massenevent, ohne repräsentatives T-Shirt für jeden Teilnehmer &#8211; welche Veranstaltung kommt heute noch ohne T-Shirt aus ? Die Agenda ( http://www.google.com/events/developerday/2010/munich/agenda.html ) lässt einem [...]]]></description>
			<content:encoded><![CDATA[<p>Dieses Jahr habe ich es endlich mal wieder geschafft zu den Google Developer Days zu kommen. Veranstaltungsort dieses Mal in München. Die größte Enttäuschung gabs es gleich am Eingang &#8211; ein Massenevent, ohne repräsentatives T-Shirt für jeden Teilnehmer &#8211; welche Veranstaltung kommt heute noch ohne T-Shirt aus ?</p>
<p>Die Agenda ( <a  href="http://www.google.com/events/developerday/2010/munich/agenda.html">http://www.google.com/events/developerday/2010/munich/agenda.html</a> ) lässt einem natürlich wieder die Qual der Wahl. Auch wenn ich zur Keynot nicht rechtzeitig gekommen bin, soll es wohl stark Android lastig gewesen sein &#8211; wer kann es Google verübeln.<br />
<span id="more-584"></span><br />
Programming the Web with Native Client ( <a  href="http://www.google.com/events/developerday/2010/slides/programming-web-with-native-client.pdf">Slides</a> ) &#8230;<br />
war ein sehr interessanter Vortrag, wenn man &#8211; wie ich &#8211; sich mit dem Thema noch nicht befasst hat. Klasse vorgestellt von High Level bis hin zu Code. Toll zu sehen wie schnell Anwendungen laufen können wenn sie native Unterstützung bekommen. Leider so derzeit nur in Chrome.</p>
<p>Google Chrome Extensions &#8230;<br />
wie der Titel schon sagt: Chrome Extensions. Klasse Einstieg. Das wars dann aber auch schon.</p>
<p>Practical HTML5 ( <a  href="http://jeremy-html5.appspot.com/#slide1">Slides</a> )<br />
Wenn man derzeit nur &#8220;HTML5&#8243; in den Titel schreibt, bedeutet das natürlich sofort, dass der Raum auch voll ist. Hier wurde die bekannte HTML5 slides Demo ( <a  href="http://slides.html5rocks.com/#landing-slide">http://slides.html5rocks.com/#landing-slide</a> ) nochmal Anwenderfreundlich aufbereitet mit praktischen Tipps und Real-World Nutzen. Klasse präsentiert.</p>
<p>Real World Website Performance Optimization<br />
sollte eigentlich jeder gesehen haben der irgendwie mit Webseiten arbeitet. &#8220;Performance Optimization&#8221; ist kein Thema für High End Anwendungen um die letzte Millisekunde an Ladezeiten herauszuholen. Spätestens seit dem von Google auch die Auslieferungsgeschwindigkeit mit in die Suchergebnisse einfließen soll, kann man das Thema schon fats im Bereich SEO ansiedeln. Natürlich ist das keine Rocketscience. Einfache Tipps wie &#8220;fassen Sie verschieden JS-Files zu einem zusammen, um möglichst wenig Requests zu haben&#8221; sind eigentlich bekannnt und leicht umsetzen, helfen aber auch sehr viel.</p>
<p>What&#8217;s New in Google Geo: Maps API V3 and Fusion Tables ( <a  href="http://www.google.com/events/developerday/2010/slides/whats-new-in-google-geo.pdf">Slides</a> )<br />
alles neu macht V3 stimmt natürlich nicht. Aber einen Überblick von Google direkt zu bekommen lässt einen manchmal Funktionen erkennen nach denen man nicht aktiv gesucht hätte, aber doch Ihren nutzen haben können, gerade wenn es mal kleine und schnell gehen muss: So die Google Fusion Tables. Das Excel für Google Maps. Ein Blick lohnt sich.</p>
<p>Den letzten Block habe ich leider nicht mehr sehen können, weil der Flieger ging. Aber nächstes Jahr gerne wieder.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/11/google-developer-day-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Added Preloader Examples</title>
		<link>http://blog.sebastian-martens.de/2010/11/preloader-examples/</link>
		<comments>http://blog.sebastian-martens.de/2010/11/preloader-examples/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 21:51:43 +0000</pubDate>
		<dc:creator>Sebastian.Martens</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.sebastian-martens.de/?p=576</guid>
		<description><![CDATA[Added some example files for the swfJSPreloader: http://blog.sebastian-martens.de/swfJSPreLoader#examples. cheers, Sebastian]]></description>
			<content:encoded><![CDATA[<p>Added some example files for the swfJSPreloader: <a  href="http://blog.sebastian-martens.de/swfJSPreLoader#examples">http://blog.sebastian-martens.de/swfJSPreLoader#examples</a>.</p>
<p>cheers,<br />
Sebastian</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sebastian-martens.de/2010/11/preloader-examples/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>
	</channel>
</rss>

