<?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>crusy.net &#187; AS3</title>
	<atom:link href="http://blog.crusy.net/tag/as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.crusy.net</link>
	<description>- Established 1979 -</description>
	<lastBuildDate>Thu, 09 Feb 2012 10:55:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>AS3: Eingebettete XML</title>
		<link>http://blog.crusy.net/2011/11/10/as3-eingebettete-xml/</link>
		<comments>http://blog.crusy.net/2011/11/10/as3-eingebettete-xml/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 11:25:14 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Einbinden]]></category>
		<category><![CDATA[eingebunden]]></category>
		<category><![CDATA[Embed]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1700</guid>
		<description><![CDATA[Wer Fehler a la identifier vor xmltagstartend erforderlich. oder anderen kryptischen Kram bekommt, sollte die XML so einbinden: [Embed(source="assets/myXml.xml", mimeType="application/octet-stream")] private var EmbeddedXml : Class; private var _myXml : XML; // ... var ba : ByteArray = (new EmbeddedXml()) as ByteArray; var s : String = ba.readUTFBytes( ba.length ); _myXml = new XML( s ); [...]]]></description>
			<content:encoded><![CDATA[<p>Wer Fehler a la</p>
<blockquote><p>identifier vor xmltagstartend erforderlich.</p></blockquote>
<p>oder anderen kryptischen Kram bekommt, sollte die XML so einbinden:</p>
<pre>[Embed(source="assets/myXml.xml", mimeType="application/octet-stream")]
private var EmbeddedXml : Class;
private var _myXml : XML;
// ...
var ba : ByteArray = (new EmbeddedXml()) as ByteArray;
var s : String = ba.readUTFBytes( ba.length );
_myXml = new XML( s );
_myXml.ignoreWhitespace = true;</pre>
<p>Also: mimeType beachten, und dass die eingebettete Klasse nicht direkt auf XML gecastet wird. Außerdem ignoreWhiteSpace, das&#8217; ja klar <img src='http://blog.crusy.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/11/10/as3-eingebettete-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIR Native Extensions mit FDT</title>
		<link>http://blog.crusy.net/2011/10/28/air-native-extensions-mit-fdt/</link>
		<comments>http://blog.crusy.net/2011/10/28/air-native-extensions-mit-fdt/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 10:20:14 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[ANE]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Extension]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Native Extension]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1693</guid>
		<description><![CDATA[AIR Native Extensions (ANE) erlauben das Verwenden von System-spezifischen Funktionen – hier das Gyroscope. Mit FDT 4.5 verwendet man sie wie folgt: Die .ane-Datei kopieren, und die Kopie in .swc umbenennen. Die .swc wie gewohnt in den Classpath einbinden. In den Projekteigenschaften -&#62; &#8220;FDT Build Path&#8221; -&#62; &#8220;Build Order&#8221; die SWC auswählen, und einen Haken [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Native extensions for Adobe AIR" href="http://www.adobe.com/devnet/air/native-extensions-for-air.html" target="_blank">AIR Native Extensions</a> (ANE) erlauben das Verwenden von System-spezifischen Funktionen – hier <a title="Gyroscope native extension sample" href="http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/gyroscope.html" target="_blank">das Gyroscope</a>. Mit FDT 4.5 verwendet man sie wie folgt:</p>
<ol>
<li>Die .ane-Datei kopieren, und die Kopie in .swc umbenennen.</li>
<li>Die .swc wie gewohnt in den Classpath einbinden.</li>
<li>In den Projekteigenschaften -&gt; &#8220;FDT Build Path&#8221; -&gt; &#8220;Build Order&#8221; die SWC auswählen, und einen Haken bei &#8220;Use as Runtime Shared Code&#8221; setzen.</li>
<li>Die Extension im Description-XML deklarieren: Entgegen der Vorlage der Powerflasher heißt der Knoten nicht &lt;extension&gt;, sondern &lt;extensions&gt;, und sieht für dieses Beispiel wie folgt aus:<br />
&lt;extensions&gt;&lt;extensionID&gt;com.adobe.gyroscope&lt;/extensionID&gt;&lt;/extensions&gt;</li>
<li>Die .ane-Datei im Projekt ablegen, beispielsweise unter /bin/ane/</li>
<li>Im Build-XML (das mit dem ADT-Compiler) folgende Zeilen hinzufügen:<br />
&lt;arg value=&#8221;-extdir&#8221; /&gt;<br />
&lt;arg value=&#8221;../bin/ane&#8221; /&gt;</li>
<li>Kompilieren <img src='http://blog.crusy.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ol>
<p><a title="@flibbi" href="https://twitter.com/#!/flibbi/status/129489733347848193" target="_blank">Tipp</a>, <a title="Using Flash Builder 4.5.1 to compile an AIR App that uses a native extension" href="http://blogs.adobe.com/actionscriptdocs/2011/10/using-flash-builder-4-5-1-to-compile-an-air-app-that-uses-a-native-extension.html" target="_blank">Quelle 1</a>, <a title="Building ADOBE AIR Applications" href="http://help.adobe.com/en_US/air/build/air_buildingapps.pdf" target="_blank">Quelle 2 (PDF)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/10/28/air-native-extensions-mit-fdt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash auf dem iPhone: Eine AIR-Videoplayer-App in FDT 4.5</title>
		<link>http://blog.crusy.net/2011/10/26/flash-auf-dem-iphone-eine-air-videoplayer-app-in-fdt-4-5/</link>
		<comments>http://blog.crusy.net/2011/10/26/flash-auf-dem-iphone-eine-air-videoplayer-app-in-fdt-4-5/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 07:50:36 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[FDT]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Stage3D]]></category>
		<category><![CDATA[StageVideo]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1683</guid>
		<description><![CDATA[Neulich stand ein entsprechendes Projekt auf dem Plan. Meine erste iPhone-App, und meine erste umfangreichere AIR-Anwendung. Hier meine Anmerkungen zum Workflow: Zum Aufsetzen des Projektes in FDT 4.5: Achtung: Der Updater der FDT-Standalone aktualisiert nicht die darunterliegende Eclipse-Version! Ich musste Eclipse 3.6 von Hand installieren, und dann FDT als Plugin drüber Dummer Fehler, hat mich [...]]]></description>
			<content:encoded><![CDATA[<p>Neulich stand ein entsprechendes Projekt auf dem Plan. Meine erste iPhone-App, und meine erste umfangreichere AIR-Anwendung. Hier meine Anmerkungen zum Workflow:</p>
<p>Zum Aufsetzen des Projektes in <a title="www.fdt.powerflasher.com" href="http://www.fdt.powerflasher.com/" target="_blank">FDT</a> 4.5:</p>
<ul>
<li>Achtung: <a title="FDT Blog Archive" href="http://fdt.powerflasher.com/blog/2011/06/today-we-released-another-fdt-4-update-for-free/#comments" target="_blank">Der Updater der FDT-Standalone aktualisiert nicht die darunterliegende Eclipse-Version</a>! Ich musste Eclipse 3.6 von Hand installieren, und dann FDT als Plugin drüber</li>
<li>Dummer Fehler, hat mich aus Gewohnheit aber einige Zeit gekostet: Nicht die Ant-Skripte benutzen, sondern die Launcher unter .settings/launch</li>
</ul>
<p>Zu AIR auf dem iPhone:</p>
<ul>
<li>Evt. muss der Compiler-Parameter -swf-version=11 gesetzt sein. Ohne hatte ich einen 1014 Class not found (<a title="Adobe Forums" href="http://adobe.hosted.jivesoftware.com/message/3339844" target="_blank">Quelle</a>). Damit das übernommen wird, muss ggf. USE_PROJECT_COMPILER_ARGUMENTS auf false stehen</li>
<li>Für mehr Performance: <a title="Setting Up FDT For Air 3 and Flash Player 11" href="http://fdt.powerflasher.com/blog/2011/08/setting-up-fdt-for-air-3-and-flash-player-11/" target="_blank">AIR 3 verwenden</a> (Danke, <a title="Björn Scholl" href="http://www.bscholl.de/" target="_blank">Björn</a>!); wobei ich die playerglobal.swc direkt unter <a title="www.adobe.com/support/flashplayer/downloads.htm" href="http://www.adobe.com/support/flashplayer/downloads.html" target="_blank">www.adobe.com/support/flashplayer/downloads.html</a> gefunden habe</li>
<li>Einen Splashscreen (&#8220;Default.png&#8221;) fügt man im jeweiligen Ant-Script unter &#8220;Files to Package&#8221; unter der SWF ein: &lt;arg value=&#8221;Default.png&#8221; /&gt;<br />
(Damit erklärt sich von selbst, wo man weitere ADT-Parameter hinzufügt). Bei mir liegt das Default.png parallel zur SWF in /bin/</li>
<li>In dem Zusammenhang: Wenn ich die App-Icons in /bin/icons/* liegen habe, dann füge ich die <strong>relativ zu /bin/</strong> im Build-Skript (&lt;arg value=&#8221;icons/icon512.png&#8221; /&gt;) <strong>und</strong> im Descriptorfile (&lt;image512x512&gt;icons/icon512.png&lt;/image512x512&gt;) hinzu</li>
<li>Um die App bei Rückkehr zum Homescreen zu beenden, muss man in der ADL-Decriptor-XML unter iPhone.InfoAdditions &#8220;&lt;key&gt;UIApplicationExitsOnSuspend&lt;/key&gt;&lt;true/&gt;&#8221; hinzufügen (<a title="Adobe Forums: How to quit/exit an iOS app?" href="http://forums.adobe.com/message/3770694" target="_blank">Quelle</a>)</li>
<li>Wer das iPhone 3 und 4 verwenden will, muss unbedingt die unterschiedlichen Auflösungen im Auge behalten! Ich habe es nicht geschafft, einfach die höher aufgelöste SWF auf den kleineren Screen runterzuskalieren, sondern musste im Code darauf reagieren.</li>
</ul>
<p>Zu Video (hier: <a title="LiveDocs" href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageVideo.html" target="_blank">StageVideo</a>) auf dem iPhone:</p>
<ul>
<li>Ein gutes Tutorial (inkl. Sourcen) von <a title="www.bytearray.org" href="http://www.bytearray.org/" target="_blank">Thibault Imbert</a> für StageVideo gibt es <a title="Getting started with stage video" href="http://www.adobe.com/devnet/flashplayer/articles/stage_video.html" target="_blank">hier</a>.</li>
<li>Für StageVideo-Wiedergabe muss der renderMode (siehe Descriptor-XML) auf &#8220;gpu&#8221; oder &#8220;direct&#8221; stehen – &#8220;auto&#8221; genügt nicht. &#8220;gpu&#8221; verringert aber die Performance der restlichen Anwendung; &#8220;direct&#8221; scheint OK zu sein. (PS: &#8220;direct&#8221; wird im XML-Kommentar nicht erwähnt; <a title="AIR 3 enables hardware decoding of H.264 video in iOS apps" href="http://www.randytroppmann.com/2011/10/07/air-3-enables-hardware-decoding-of-h-264-video-in-ios-apps/" target="_blank">Quelle</a>)</li>
</ul>
<p>Fazit und offene Fragen:</p>
<ul>
<li>Die Performance ist schlechter als nativ, aber absolut OK. Man muss ein wenig darauf achten, wie viel man parallel macht, aber wenn man das weiß, ist AIR eine echte Alternative.</li>
<li>Wenn ich sage &#8220;die Performance ist OK&#8221;, dann meine ich Code, der (abgesehen von StageVideo) nicht optimiert ist! Die Performance ist sicherlich noch besser, wenn man z.B. <a title="LiveDocs" href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage3D.html" target="_blank">Stage3D</a> verwendet</li>
<li>Sweet: Bis zum Verpacken in einer IPA hat man ein SWF, was Abstimmungen extrem einfach macht.</li>
<li>Ich habe es nicht geschafft, das StageVideo um 90° zu drehen, was laut verschiedener Quellen möglich ist. Wer einen Tipp hat, immer her damit!</li>
<li>Die gleiche Anwendung müsste auch auf Android exportierbar sein, das habe ich aber noch nicht ausprobiert</li>
</ul>
<p>HTH,</p>
<p>Lennart</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/10/26/flash-auf-dem-iphone-eine-air-videoplayer-app-in-fdt-4-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Animierte Tag-Cloud in Flash</title>
		<link>http://blog.crusy.net/2011/09/15/animierte-tag-cloud-in-flash/</link>
		<comments>http://blog.crusy.net/2011/09/15/animierte-tag-cloud-in-flash/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 13:16:26 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Tag Cloud]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1652</guid>
		<description><![CDATA[Gibt es hier (bzw. hier); die Sourcen liegen hier. Sind auch ganz gut anzupassen, auf dass sie nicht nur mit WP funktionieren]]></description>
			<content:encoded><![CDATA[<p>Gibt es <a title="WP-Cumulus Flash based tag cloud" href="http://www.roytanck.com/2008/03/06/wordpress-plugin-wp-cumulus-flash-based-tag-cloud/" target="_blank">hier</a> (bzw. <a title="How to repurpose my tag cloud Flash movie" href="http://www.roytanck.com/2008/05/19/how-to-repurpose-my-tag-cloud-flash-movie/" target="_blank">hier</a>); die Sourcen liegen <a title="plugins.svn.wordpress.org" href="http://plugins.svn.wordpress.org/wp-cumulus/" target="_blank">hier</a>. Sind auch ganz gut anzupassen, auf dass sie nicht nur mit WP funktionieren</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/09/15/animierte-tag-cloud-in-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3: Webcam-Zugriff verweigern</title>
		<link>http://blog.crusy.net/2011/08/11/as3-webcam-zugriff-verweigern/</link>
		<comments>http://blog.crusy.net/2011/08/11/as3-webcam-zugriff-verweigern/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 12:35:05 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Dialog]]></category>
		<category><![CDATA[Microphone]]></category>
		<category><![CDATA[Mikrofon]]></category>
		<category><![CDATA[Popup]]></category>
		<category><![CDATA[Webcam]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1555</guid>
		<description><![CDATA[Wer im Auswahl-Dialog den Zugriff auf die Webcam verweigert, bekommt ein StatusEvent mit dem Code &#8220;Camera.muted&#8221;: private var _camera : Camera; // ... _camera.addEventListener( StatusEvent.STATUS, _onCameraStatus ); // ... private function _onCameraStatus( event : StatusEvent ) : void { if( event.code == 'Camera.Muted' ) { // do stuff } } Konstanten dafür habe ich übrigens [...]]]></description>
			<content:encoded><![CDATA[<p>Wer <a title="Webcam- und Mikrofon-Zugriff mit Flash" href="http://blog.crusy.net/2010/04/07/webcam-und-mikrofon-zugriff-mit-flash/">im Auswahl-Dialog</a> den Zugriff auf die Webcam verweigert, bekommt ein <a title="LiveDocs" href="http://livedocs.adobe.com/flash/9.0_de/ActionScriptLangRefV3/flash/events/StatusEvent.html" target="_blank">StatusEvent</a> mit dem <a title="LiveDocs" href="http://livedocs.adobe.com/flash/9.0_de/ActionScriptLangRefV3/flash/events/StatusEvent.html#code" target="_blank">Code</a> &#8220;Camera.muted&#8221;:</p>
<pre>private var _camera : Camera;

// ...

_camera.addEventListener( StatusEvent.STATUS, _onCameraStatus );

// ...

private function _onCameraStatus( event : StatusEvent ) : void
{
	if( event.code == 'Camera.Muted' )
	{
		// do stuff
	}
}</pre>
<p>Konstanten dafür habe ich übrigens nicht gefunden, da bin ich für jeden Hinweis dankbar.</p>
<p>Achtung: Ist der Zugriff einmal abgewiesen worden, wird der <a title="Popupfenster zum Zugriffsschutz" href="http://www.macromedia.com/support/documentation/de/flashplayer/help/help05.html#117135" target="_blank">Dialog nicht erneut angezeigt</a>! Das muss man sich also selber merken, damit man im zweiten Versuch kein Camera-Objekt ohne Bild hat <img src='http://blog.crusy.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/08/11/as3-webcam-zugriff-verweigern/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AS3: CamelCase an beliebigen Trennzeichen</title>
		<link>http://blog.crusy.net/2011/06/23/as3-camelcase-an-beliebigen-trennzeichen/</link>
		<comments>http://blog.crusy.net/2011/06/23/as3-camelcase-an-beliebigen-trennzeichen/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 14:53:27 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[capitalize]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[toUpperCase]]></category>
		<category><![CDATA[uppercase]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1439</guid>
		<description><![CDATA[Tag, wer ein einzelnes Wort camelCasen möchte, kann dies zum Beispiel so tun: public static function capitalize( input : String, ignoreAllButFirstLetter : Boolean = false ) : String { if( input ) { if( ignoreAllButFirstLetter ) { return input.substr( 0, 1 ).toUpperCase() + input.substr( 1, input.length ); } else { return input.substr( 0, 1 ).toUpperCase() [...]]]></description>
			<content:encoded><![CDATA[<p>Tag,</p>
<p>wer ein einzelnes Wort <a title="http://de.wikipedia.org/wiki/Camelcase" href="http://de.wikipedia.org/wiki/Camelcase#Verwendung_in_Programmiersprachen" target="_blank">camelCasen</a> möchte, kann dies zum Beispiel so tun:</p>
<pre>public static function capitalize( input : String, ignoreAllButFirstLetter : Boolean = false ) : String
{
  if( input )
  {
    if( ignoreAllButFirstLetter )
    {
      return input.substr( 0, 1 ).toUpperCase() + input.substr( 1, input.length );
    }
    else
    {
      return input.substr( 0, 1 ).toUpperCase() + input.substr( 1, input.length ).toLowerCase();
    }
  }
  return '';
}</pre>
<p>Der zweite Parameter ist hilfreich, wenn man einen String an beliebigen Trennzeichen camelCasen möchte &#8211; etwa einen Namen an Leerzeichen <strong>und</strong> Bindestrichen:</p>
<pre>public static function capitalizeWords( str : String, delimiter : Array ) : String
{
  var capitalized : String = str;

  if( capitalized &amp;&amp; capitalized.length &gt; 0 )
  {
    capitalized = capitalized.toLowerCase();

    var d : *;
    var word : String;
    var words : Array;
    var tmp : String;

    for each( d in delimiter )
    {
      tmp = '';
      words = capitalized.split( d );
      for each( word in words )
      {
        tmp = tmp + capitalize( word, true ) + d;
      }

      // remove trailing delimiter:
      capitalized = tmp.substr( 0, tmp.length - 1 );
    }
  }

  return capitalized;
}</pre>
<p>Aufruf dann z.B. so:</p>
<pre>name = capitalizeWords( name, [ ' ', '-' ] );</pre>
<p>HTH</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/06/23/as3-camelcase-an-beliebigen-trennzeichen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Actionscript: Automatisch erzeugte Versionsnummer im Kontextmenü</title>
		<link>http://blog.crusy.net/2011/06/01/actionscript-automatisch-erzeugte-versionsnummer-im-kontextmenu/</link>
		<comments>http://blog.crusy.net/2011/06/01/actionscript-automatisch-erzeugte-versionsnummer-im-kontextmenu/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 14:43:25 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Build]]></category>
		<category><![CDATA[Buildnumber]]></category>
		<category><![CDATA[Buildnummer]]></category>
		<category><![CDATA[Version]]></category>
		<category><![CDATA[Versionsnummer]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1424</guid>
		<description><![CDATA[Für ein Projekt wollte ich irgendeine Möglichkeit haben, einer SWF ihre genaue Versionsnummer &#8220;anzusehen&#8221;. Dies sollte unbedingt automatisiert geschehen. Ich glaube mich dunkel zu erinnern, dass man mit Ant auch direkt in die AS-Klassen schreiben kann, finde das aber gerade nicht wieder&#8230; was ich aber gefunden habe basiert ebenfalls auf Ant, genauer gesagt: Auf dem [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.crusy.net/wp-content/uploads/2011/06/buildNumber.png"><img class="alignnone size-full wp-image-1428" title="buildNumber" src="http://blog.crusy.net/wp-content/uploads/2011/06/buildNumber.png" alt="" width="341" height="311" /></a></p>
<p>Für ein Projekt wollte ich irgendeine Möglichkeit haben, einer SWF ihre genaue Versionsnummer &#8220;anzusehen&#8221;. Dies sollte unbedingt automatisiert geschehen. Ich glaube mich dunkel zu erinnern, dass man mit <a title="http://en.wikipedia.org/wiki/Apache_Ant" href="http://en.wikipedia.org/wiki/Apache_Ant" target="_blank">Ant</a> auch direkt in die AS-Klassen schreiben kann, finde das aber gerade nicht wieder&#8230; <a title="Embedding text files in a Flex Application" href="http://techrays.wordpress.com/2007/09/19/embedding-text-files-in-a-flex-application/" target="_blank">was ich aber gefunden habe</a> basiert ebenfalls auf Ant, genauer gesagt: Auf dem <a title="http://ant.apache.org/manual/Tasks/buildnumber.html" href="http://ant.apache.org/manual/Tasks/buildnumber.html" target="_blank">&#8220;BuildNumber&#8221;-Task</a>.</p>
<p>Damit liest man eine Nummer aus einer Datei (default: build.number), erhöht sie um 1, und schreibt das Ergebnis zurück. Soweit, so gut. Aber wie bekommt man das in die SWF? Mit einer Klasse, die in etwa so aussieht (ich habe es auch mit einer internal class probiert, aber nicht hinbekommen &#8211; Tipps sind willkommen!):</p>
<pre>package test
{
    import flash.utils.ByteArray;
    [Embed(source="../script/build.number", mimeType="application/octet-stream")]
    public class BuildNumber extends ByteArray{}
}</pre>
<p>Diese Klasse kann man nun instantiieren und auslesen:</p>
<pre>var obj:BuildNumber = new BuildNumber();
trace( obj.toString() );</pre>
<p>Eleganter: Man schreibt den Inhalt in&#8217;s <a title="flash.ui.ContextMenu" href="http://help.adobe.com/de_DE/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html?filter_flex=4.1&amp;filter_flashplayer=10.2&amp;filter_air=2.6" target="_blank">Kontextmenü</a>:</p>
<pre>var buildNr : ContextMenuItem = new ContextMenuItem( 'Build: ' + obj.toString() );
buildNr.enabled = false;
var myMenu : ContextMenu = new ContextMenu();
myMenu.customItems.push( buildNr );
contextMenu = myMenu;</pre>
<p>HTH</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/06/01/actionscript-automatisch-erzeugte-versionsnummer-im-kontextmenu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Effizienter Zugriff auf Singletons</title>
		<link>http://blog.crusy.net/2011/04/15/effizienter-zugriff-auf-singletons/</link>
		<comments>http://blog.crusy.net/2011/04/15/effizienter-zugriff-auf-singletons/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 07:23:00 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Entwurfsmuster]]></category>
		<category><![CDATA[internal]]></category>
		<category><![CDATA[Pattern]]></category>
		<category><![CDATA[Singleton]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1388</guid>
		<description><![CDATA[Häufig sieht der Zugriff auf Singletons so aus: MySingleton.getInstance().doStuff(); Effizienter finde ich aber MySingleton.doStuff(); Siehe Bild. getInstance() ist dabei &#8220;internal static&#8221; PS: &#8220;internal&#8221; ist vielleicht nicht nötig, aber &#8220;protected&#8221; ging irgendwann mal nicht, deswegen&#8230; sicher ist sicher^^]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.crusy.net/wp-content/uploads/2011/04/singleton.png"><img class="alignnone size-full wp-image-1389" style="border: 1px solid black;" title="singleton" src="http://blog.crusy.net/wp-content/uploads/2011/04/singleton.png" alt="" width="450" height="475" /></a></p>
<p>Häufig sieht der Zugriff auf <a title="Wikipedia" href="http://de.wikipedia.org/wiki/Singleton_%28Entwurfsmuster%29" target="_blank">Singletons</a> so aus:</p>
<blockquote><p>MySingleton.getInstance().doStuff();</p></blockquote>
<p>Effizienter finde ich aber</p>
<blockquote><p>MySingleton.doStuff();</p></blockquote>
<p>Siehe Bild. getInstance() ist dabei &#8220;internal static&#8221;</p>
<p>PS: &#8220;<a title="greenethumb.com" href="http://greenethumb.com/article/27/public-private-protected-internal-access-modifiers-in-as3" target="_blank">internal</a>&#8221; ist vielleicht nicht nötig, aber &#8220;protected&#8221; ging irgendwann mal nicht, deswegen&#8230; sicher ist sicher^^</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/04/15/effizienter-zugriff-auf-singletons/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Robotlegs: Injection funktioniert nicht</title>
		<link>http://blog.crusy.net/2011/03/15/robotlegs-injection-funktioniert-nicht/</link>
		<comments>http://blog.crusy.net/2011/03/15/robotlegs-injection-funktioniert-nicht/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 08:53:36 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[DI]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Robotlegs]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1304</guid>
		<description><![CDATA[Tag, wer das Problem hat, dass Robotlegs nicht injected, der möge folgende Compiler-Option probieren: -keep-as3-metadata=Inject,PostConstruct HTH, Lennart]]></description>
			<content:encoded><![CDATA[<p>Tag,</p>
<p>wer das Problem hat, dass <a title="www.robotlegs.org" href="http://www.robotlegs.org/" target="_blank">Robotlegs</a> nicht <a title="Dependency injection" href="http://en.wikipedia.org/wiki/Dependency_injection" target="_blank">injected</a>, der möge folgende Compiler-Option probieren:</p>
<blockquote><p><code>-keep-as3-metadata=Inject,PostConstruct</code></p></blockquote>
<p>HTH,</p>
<p>Lennart</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/03/15/robotlegs-injection-funktioniert-nicht/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash: Blendmode &#8220;LAYER&#8221;</title>
		<link>http://blog.crusy.net/2011/03/10/flash-blendmode-layer/</link>
		<comments>http://blog.crusy.net/2011/03/10/flash-blendmode-layer/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 14:56:57 +0000</pubDate>
		<dc:creator>crusy</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[BlendMode]]></category>
		<category><![CDATA[Füllmethode]]></category>
		<category><![CDATA[layermode]]></category>

		<guid isPermaLink="false">http://blog.crusy.net/?p=1275</guid>
		<description><![CDATA[Wenn man mehrere Elemente in einen MovieClip packt, und diesen Clip fadet, dann hat man unschöne Effekte, da die einzelnen Elemente sich unterschiedlich verhalten. Will man den Clip als Ganzes faden, dann sollte man seinen BlendMode auf LAYER stellen&#8230; ist quasi so eine Art visuelles MouseChildren=false]]></description>
			<content:encoded><![CDATA[<p>Wenn man mehrere Elemente in einen MovieClip packt, und diesen Clip fadet, dann hat man unschöne Effekte, da die einzelnen Elemente sich unterschiedlich verhalten. Will man den Clip als Ganzes faden, dann sollte man seinen BlendMode auf LAYER stellen&#8230; ist quasi so eine Art visuelles MouseChildren=false <img src='http://blog.crusy.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.crusy.net/2011/03/10/flash-blendmode-layer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

