<?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>Skybluetech</title>
	<atom:link href="http://www.skybluetech.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.skybluetech.de</link>
	<description>it´s all about coding</description>
	<lastBuildDate>Tue, 06 Sep 2011 14:56:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WP e-Commerce Custom Shipping Module</title>
		<link>http://www.skybluetech.de/2011/08/wp-e-commerce-custom-shipping-module/</link>
		<comments>http://www.skybluetech.de/2011/08/wp-e-commerce-custom-shipping-module/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 12:03:51 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[e-Commerce]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[shipping]]></category>
		<category><![CDATA[Versandmodul]]></category>
		<category><![CDATA[WP e-Commerce]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=163</guid>
		<description><![CDATA[WP e-Commerce ist ein Plugin welches aus dem Blogsystem WordPress einen vollwertigen Online-Shop macht. WP e-Commerce selbst ist kostenlos, einige Erweiterungen wie z.B. das Gold Chart Plugin kosten extra. Diese Premium Pugins liefern dafür allerdings besondere Features wie Einkäufe per Drag &#8216;n Drop, Download-Status Manager für Digitale Produkte oder schicke Produkt-Slider. Das ist für Präsentation [...]]]></description>
			<content:encoded><![CDATA[<p>WP e-Commerce ist ein Plugin welches aus dem Blogsystem WordPress einen vollwertigen Online-Shop macht. <a title="WP e-Commerce" href="http://getshopped.org" target="_blank">WP e-Commerce</a> selbst ist kostenlos, einige Erweiterungen wie z.B. das Gold Chart Plugin kosten extra. Diese Premium Pugins liefern dafür allerdings besondere Features wie Einkäufe per Drag &#8216;n Drop, Download-Status Manager für Digitale Produkte oder schicke Produkt-Slider. Das ist für Präsentation und Optik alles ganz nett, allerdings sieht es auf Seiten des Versands nicht so üppig aus. Die vorhandenen Versandmodule befriedigen zwar die Grundbedürfnisse eines Online-Shops, liefern jedoch viele zu wenige Optionen und Einstellungen.<span id="more-163"></span></p>
<p>Der initial vorhandene Flat-Rate Versand ist schön und gut, was sagen allerdings die Kunden wenn selbst Briefmarken große Produkte genauso viel Versand  kosten wie ein 30 Kilo-Sperrgut Produkt. Was ist mit Abholung vor Ort? Und wenn internationaler Versand über die Landesgrenzen realisiert werden soll? Freundlicher Weise geben die Anbieter auf getshopped.org eine Hilfestellung in Form eines <a title="Versandmodul Skelett" href="http://getshopped.org/resources/docs/get-involved/writing-a-new-shipping-module/" target="_blank">Versandmodul Skeletts</a>, das man nach eigenen Vorstellungen adaptieren kann.</p>
<p>Das fertige Versandmodul muss zur Benutzung entweder in das WordPress Plugin Verzeichnis gepackt werden oder alternativ in das Shipping Verzeichnis im  WP e-Commerce Plugin selbst: wp-content/plugins/wp-e-commerce/shipping.</p>
<p>Anschließend steht es in Einstellungen -&gt; Shop -&gt; Versand als Versandoption zur Verfügung.</p>
<p><a href="http://www.skybluetech.de/wp-content/uploads/2011/08/e-Commerce_shipping_moule.png"><img class="aligncenter size-full wp-image-166" src="http://www.skybluetech.de/wp-content/uploads/2011/08/e-Commerce_shipping_moule-e1314616716549.png" alt="" width="600" height="315" /></a><br />
Die Quelldatei für das Shipping Modul  kann hier herunter geladen werden:</p>
<p><a href="http://www.skybluetech.de/wp-content/uploads/2011/08/wp-e-commerce-sample-shipping-module.zip">wp-e-commerce-sample-shipping-module</a><br />
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2011/08/wp-e-commerce-custom-shipping-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash CS5 iPhone/iOS Exporter</title>
		<link>http://www.skybluetech.de/2011/05/flash-cs5-iphoneios-exporter/</link>
		<comments>http://www.skybluetech.de/2011/05/flash-cs5-iphoneios-exporter/#comments</comments>
		<pubDate>Thu, 26 May 2011 16:13:53 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Exporter]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=111</guid>
		<description><![CDATA[In letzter Zeit hatte ich mehrere Anfragen bezüglich der Umsetzung plattformübergreifender Spiele. Diese sollten mit Flash entwickelt werden und im Browser, unter Android sowie auf dem iPhone laufen. Gerade beim letzteren dachte ich nicht, das es jetzt besonders performant laufen sollte. Meine Erfahrungsstand vom letzten Jahr war eher negativ geprägt. Kollegen erzählten mir, Buttons ließen [...]]]></description>
			<content:encoded><![CDATA[<p>In letzter Zeit hatte ich mehrere Anfragen bezüglich der Umsetzung plattformübergreifender Spiele. Diese sollten mit Flash entwickelt werden und im Browser, unter Android sowie auf dem iPhone laufen. Gerade beim letzteren dachte ich nicht, das es jetzt besonders performant laufen sollte. Meine Erfahrungsstand vom letzten Jahr war eher negativ geprägt. Kollegen erzählten mir, Buttons ließen sich nicht richtig drücken und selbst Slider ruckelten stark. <span id="more-111"></span>Ich ließ es dabei bleiben.</p>
<p>Auf <a title="Adobe´s Update Seite" href="http://www.adobe.com/support/flash/downloads.html" target="_blank">Adobe´s Update Seite</a> stolperte ich neulich über das<em> Flash Professional CS5 Update for iOS </em>und beschloss, schon fast nur aus reiner Neugier, das Update einzuspielen und meinen alten Apple Developer Account wiederzubeleben.</p>
<p>Apple´s mobile Geräte gehören leider zu den restriktiven Geräten, was im Prinzip bedeutet, sie sind nicht Quelloffen und man kann auch nicht einfach so seine Software aufspielen. Man benötigt einen Developer Account welcher mit 79 Euro für 1 Jahr zu Buche schlägt. Damit ist es möglich über ein umständliches Zertifizierungsverfahren sein Gerät als &#8220;Entwicklergerät&#8221; zu deklarieren und kann dann via Xcode oder iTunes seine eigenen Softwareprogramme aufspielen.</p>
<p>Im Gegensatz zu meinen ersten Versuchen Ende 2009 wurde dieses Verfahren jedoch mit einen Assistenten verbessert, so das es nicht mehr so kompliziert, sondern lediglich ein wenig nervig ist sein Provisioning Profile zu erhalten. Ein klick im <a title="Apple Dev Center" href="http://developer.apple.com/" target="_blank">Apple Developer Center</a> auf <span style="color: #000000;"><em>add Certificate</em></span> öffnet ihn schon. Anschließend nur noch dem Assistenten folgen.</p>
<p style="text-align: center;"><a href="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-24-um-17.43.21.png"><img class="size-medium wp-image-113 aligncenter" src="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-24-um-17.43.21-300x190.png" alt="" width="300" height="190" /></a></p>
<p style="text-align: center;"><a href="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-24-um-17.44.18.png"><img class="size-medium wp-image-114 aligncenter" src="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-24-um-17.44.18-300x259.png" alt="" width="300" height="259" /></a></p>
<p>Der Assistent generiert dabei aus einer  Application ID und der Device ID (für das verwendete Gerät) das Provisioning Profile. Anschließend muss es auf dem Gerät installiert werden.</p>
<p>Unter MacOS geschiet dies einfach per Drag´n Drop der Datei auf das Xcode Symbol auf dem Dock. Xcode installiert das Profil dann automatisch am angeschlossenen iPhone/iPod/iPad. Alternativ geht das auch über iTunes über <span style="color: #000000;"><em>zur Mediathek hinzufügen..</em>.</span>, was dann wohl auch der Weg für Windows Nutzer wäre.</p>
<p>Um mit Flash CS5 für das iPhone &amp; Co. zu entwickeln benötigt man noch eine P12 Datei (*.p12). Diese wird aus dem Developer Zertifikat generiert, welches man von Apple bekommen hat. Am besten man folgt dabei den Step-by-Step guide auf den Adobe Help Seiten zum Thema iOS: <a href="http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-7fff.html">Converting a developer certificate into a P12 file</a></p>
<p>Nachdem der Weg nun geebnet ist kann man endlich durchstarten:</p>
<ul>
<li>Flash CS5 öffnen</li>
<li>neues <em>iPhone OS </em>Projekt erstellen</li>
<li>Anzeigeobjekte auf die Stage packen</li>
</ul>
<p><img class="size-medium wp-image-118 aligncenter" src="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-26-um-16.36.01-300x218.png" alt="" width="300" height="218" /></p>
<p><a href="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-26-um-16.36.22.png"><img class="aligncenter size-medium wp-image-121" src="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-26-um-16.36.22-208x300.png" alt="" width="208" height="300" /></a></p>
<p>Der Befehl Strg + Enter bzw. cmd +Enter zeigt wie gehabt den Film, um eine lauffähige IPA Datei (*.ipa) erstellen zu können muss man Flash CS5 in den <em>Publish Settings</em> unter den <em>Player Settings</em> (alternativ auch gleich <em>File &gt; iPhone OS Settings</em>) noch ein paar Details zum Speicherort der Zertifikate mitteilen.</p>
<p><a href="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-26-um-16.36.39.png"><img class="aligncenter size-medium wp-image-119" src="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-26-um-16.36.39-300x116.png" alt="" width="300" height="116" /></a></p>
<p>&nbsp;</p>
<p>Der Pfad zur P12 Datei und das Passwort, sowie der Pfad zum Provisioning Profile auf diesem Computer werden zwingend benötigt, ansonsten klappt der Export nicht. Die restlichen Einstellungen sind optional wie z.B. Icons für die Apps zu definieren.</p>
<p><a href="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-26-um-16.36.55.png"><img class="aligncenter size-medium wp-image-122" src="http://www.skybluetech.de/wp-content/uploads/2011/05/Bildschirmfoto-2011-05-26-um-16.36.55-300x296.png" alt="" width="300" height="296" /></a></p>
<p>Ist alles korrekt eingestellt, reicht anschließend ein Klick auf <em>Publish</em> und Flash beginnt damit die finale IPA Datei zu kompilieren. Als letzter Schritt muss die Datei via iTunes auf dem iPhone installiert werden. Dazu einfach wieder über zur Mediathek hinzufügen&#8230; oder per Drag´nDrop bei iTunes bekann machen. Anschließend iTunes mit dem iPhone Synchonisieren und geschafft ist es.</p>
<p><img class="aligncenter size-medium wp-image-123" src="http://www.skybluetech.de/wp-content/uploads/2011/05/flash2iOS-164x300.jpg" alt="" width="164" height="300" /></p>
<p>Die Flash Anwendung läuft auf dem iPhone!</p>
<p>&nbsp;</p>
<p>Zur Performance:</p>
<p>Meinen kurzen Tests nach, ist die Performance in etwa 2/3 schlechter als am Rechner. Meine Testanwendung läuft auf einem MacBook Pro mit fast exakt 24 Frames pro Sekunde. Auf dem iPhone 3GS sind es konstant 8 Frames pro Sekunde. Interessant wäre zu wissen wie die Testanwendung auf dem iPad 2 läuft&#8230;. Raum für zukünftige Feldforschung <img src='http://www.skybluetech.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p style="text-align: center;">
<object style="width:425px; height:344px;">
<param name="movie" value="http://www.youtube.com/v/Xjmf9yKzPgs?version=3" />
<param name="allowScriptAccess" value="always" />
<param name="wmode" value="window" />
<embed src="http://www.youtube.com/v/Xjmf9yKzPgs?version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" wmode="window" width="425" height="344"></object>
</p>
<p>&nbsp;</p>
<p>Hilfreich zur Erstellung dieses Artikels waren folgende Quellen:</p>
<ul>
<li><a href="http://www.republicofcode.com/tutorials/flash/iphone/">Creating a Hello World iPhone Application Using Flash CS5</a></li>
<li><a href="http://www.adobe.com/devnet/logged_in/abansod_iphone.html">Developing for iOS using Flash Professional</a></li>
<li><a href="http://help.adobe.com/en_US/as3/iphone/index.html">Adobe Flash Platform: Packager for iPhone</a></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2011/05/flash-cs5-iphoneios-exporter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails</title>
		<link>http://www.skybluetech.de/2009/07/grails/</link>
		<comments>http://www.skybluetech.de/2009/07/grails/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 06:35:46 +0000</pubDate>
		<dc:creator>David Crome</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=153</guid>
		<description><![CDATA[Ähnlich wie bei Ruby und Ruby on Rails, entstand zu Groovy (eine dynamisch typisierte Programmiersprache und Skriptsprache für die Java Virtual Machine, Wikipedia), das Webframework Grails (vorher Groovy on Rails, Wikipedia), welches ich euch wirklich ans Herz legen will, da man damit eine Webapplikation sehr einfach und schnell entwickeln kann! In 3 Ausgaben des JavaMagazins [...]]]></description>
			<content:encoded><![CDATA[<p>Ähnlich wie bei Ruby und Ruby on Rails, entstand zu Groovy (eine dynamisch typisierte Programmiersprache und Skriptsprache für die Java Virtual Machine, <a href="http://de.wikipedia.org/wiki/Groovy" target="_blank">Wikipedia</a>), das Webframework Grails (vorher Groovy on Rails, <a href="http://de.wikipedia.org/wiki/Grails" target="_blank">Wikipedia</a>), welches ich euch wirklich ans Herz legen will, da man damit eine Webapplikation sehr einfach und schnell entwickeln kann! In 3 Ausgaben des <a href="http://it-republik.de/jaxenter/java-magazin/" target="_blank">JavaMagazins</a> (04/09 &#8211; 06/09) gab es jeweils eine Tutorial, welches durch die schrittweise Entwicklung eines Blogsystems die Funktionsweise von Grails und deren Möglichkeiten näherbringen soll. Die Tutorials wurden <a href="http://www.moscon.de/grailstutorial/" target="_blank">hier</a> veröffentlicht. Angefangen bei der Installation von Grails über die Integration eines fertigen Designs bis zum Hinzufügen eines gängigen Security-Plug-Ins und dessen Nutzung, zeigt das Tutorial viele wichtige Funktionen.</p>
<p>Es gibt zwar immer noch Stolpersteine, wie z.B. die automatisch Erzeugung der Domain-Klassen und deren Anpassung an eine bestehende Datenbank oder die Suche von einem bestimmt Objekt in einer automatisch generierten Liste (vgl. <a href="http://www.sigs-datacom.de/sd/publications/js/index.htm" target="_blank">JavaSpektrum</a> 02/09, Seite 40), aber dieser Artikel zeigt auch die Möglichkeiten die in Grails stecken und außerdem ist Grails ein noch recht junges Projekt!</p>
<p>Also versucht es einfach mal aus, vielleicht wird es ja bei einem euer nächsten Projekt zu Einsatz kommen <img src='http://www.skybluetech.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<hr />
<p><strong>Dieser Blogeintrag wurde ursprünglich auf   http://wet-media.de/wetblog/ veröffentlicht, allerdings besteht dieser   Blog nicht mehr.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2009/07/grails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google AppEngine</title>
		<link>http://www.skybluetech.de/2009/06/google-appengine/</link>
		<comments>http://www.skybluetech.de/2009/06/google-appengine/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 06:31:43 +0000</pubDate>
		<dc:creator>David Crome</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=147</guid>
		<description><![CDATA[Auch wenn man oft von der Datenkrake spricht und man schon ein mulmiges Gefühl hat seine Daten auf den Servern von Google zu lagern, gibt es doch immer wieder nützliche Sachen die Google anbietet: Die Google App Engine. Vor gut einem Jahr wurde Google&#8217;s Infrastruktur als Plattform für Python Entwickler geöffnet, jetzt gilt das auch [...]]]></description>
			<content:encoded><![CDATA[<p>Auch wenn man oft von der <a href="http://www.heise.de/ct/Google-und-der-Datenschutz--/artikel/125841" target="_blank">Datenkrake</a> spricht und man schon ein mulmiges Gefühl hat seine Daten auf den Servern von Google zu lagern, gibt es doch immer wieder nützliche Sachen die Google anbietet:</p>
<p>Die <a href="http://code.google.com/intl/de-DE/appengine/" target="_blank">Google App Engine</a>. Vor gut einem Jahr wurde Google&#8217;s Infrastruktur als Plattform für Python Entwickler geöffnet, jetzt gilt das auch für Java-Entwickler. Im Endeffekt handelt es sich um eine Plattform auf der man seine Webapplikation deployen kann (<a href="http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine" target="_blank">welche das sind</a>) und u.a. folgendes auf der Plattform unterstützt:</p>
<ul>
<li>Virtual Machine Version 6</li>
<li>Jetty Servlet Container</li>
<li>Servlet-API Version 2.4</li>
<li>Deployment Descriptor (web.xml), also die für Java-WebApps typischen Konfigurationen (Servlet-Mapping, &#8230;); Einschränkungen s.u.</li>
</ul>
<p>allerdings mit ein paar Beschränkungen:</p>
<ul>
<li>In der web.xml werden folgende Elemente nicht unterstützt: load-on-startup, mime-mapping, distributable und run-at als auch die Definition von JNDI- und EJB-Ressourcen</li>
<li>Es gibt eine <a href="http://code.google.com/intl/de-DE/appengine/docs/java/jrewhitelist.html" target="_blank">JRE Class White List</a> die die unterstützten Klassen der Standard Java Bibliothek auflistet</li>
<li>Es gibt keine relationale Datenbank, weshalb die Benutzung von Hibernate ausgeschlossen ist, sondern es handelt sich um einen Datenspeicher auf Basis von <a href="http://labs.google.com/papers/bigtable.html" target="_blank">Bigtable</a>. Dafür lässt sich JDO und JPA als Java-Persistenzmechanismen einsetzen.</li>
<li>Dauer eines Requests ist auf max. 30 sekunden beschränkt</li>
<li>und noch ein paar andere, das sind aber die wichtigsten denke ich&#8230;</li>
</ul>
<p>Im aktuellen <a href="http://it-republik.de/jaxenter/java-magazin-ausgaben/Web-Application-Security-000300.html" target="_blank">JavaMagazin</a> findet ihr auch einen guten Artikel darüber.</p>
<p>Es gibt ein super <a href="http://code.google.com/intl/de-DE/eclipse/" target="_blank">Eclipse Plug-in</a> mit dem wirklich sehr einfach die Applikationen entwickeln kann.</p>
<p>Außerdem hat Google einige seiner API&#8217;s, Produkte und Projekte <a href="http://code.google.com/intl/de-DE/more/#products-products-accounts" target="_blank">hier</a> aufgelistet, auf die man z.B. mit Flash oder Flex zugreifen kann. Bestimmt ist das einigen von euch bekannt, aber vielleicht nicht allen oder man findet mal was neues <img src='http://www.skybluetech.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<hr />
<p><strong>Dieser Blogeintrag wurde ursprünglich auf   http://wet-media.de/wetblog/ veröffentlicht, allerdings besteht dieser   Blog nicht mehr.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2009/06/google-appengine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Kap Instinct</title>
		<link>http://www.skybluetech.de/2009/05/flex-kap-instinct/</link>
		<comments>http://www.skybluetech.de/2009/05/flex-kap-instinct/#comments</comments>
		<pubDate>Fri, 01 May 2009 06:27:44 +0000</pubDate>
		<dc:creator>David Crome</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=143</guid>
		<description><![CDATA[Endlich gibt es auch für Flexer ein Tool ähnlich Firebug! Einfach in das Projekt integriert kann man per Shortcut das Debug Fenster öffnen und schauen was in seiner Applikation abläuft. Kap Instinct ist eines von mehreren Flex-Komponenten des französischen Flex-Entwicklungsunternehmens Kap IT. Gefunden über den Adobe Edge Newsletter, den ich nur empfehlen kann! Dieser Blogeintrag [...]]]></description>
			<content:encoded><![CDATA[<p>Endlich gibt es auch für Flexer ein Tool ähnlich <a href="https://addons.mozilla.org/de/firefox/addon/1843" target="_blank">Firebug</a>! Einfach in das Projekt integriert kann man per Shortcut das Debug Fenster öffnen und schauen was in seiner Applikation abläuft. <a href="http://lab.kapit.fr/display/kapinspect/Kap%20Inspect" target="_blank">Kap Instinct</a> ist eines von mehreren <a href="http://lab.kapit.fr/display/kaplabhome/Home" target="_blank">Flex-Komponenten</a> des französischen Flex-Entwicklungsunternehmens <a href="http://www.kapit.fr/" target="_blank">Kap IT</a>.</p>
<p>Gefunden über den <a href="http://www.adobe.com/newsletters/edge/december2008/" target="_blank">Adobe Edge Newsletter</a>, den ich nur empfehlen kann!</p>
<hr />
<p><strong>Dieser Blogeintrag wurde ursprünglich auf  http://wet-media.de/wetblog/ veröffentlicht, allerdings besteht dieser  Blog nicht mehr.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2009/05/flex-kap-instinct/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Birdeye</title>
		<link>http://www.skybluetech.de/2009/04/flex-birdeye/</link>
		<comments>http://www.skybluetech.de/2009/04/flex-birdeye/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 06:26:16 +0000</pubDate>
		<dc:creator>David Crome</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=141</guid>
		<description><![CDATA[Auch diese Flex-Komponenten sind sehr zu empfehlen. BirdEye ist ebenfalls ein Community Projekt, beschäftigt sich allerdings mit umfangreichen Komponenten zur Visualisierung von Informationen und Analysen. Die Bibliotheken ermöglichen es dem User, multi-dimensionale &#8220;Data Visualisation Interfaces&#8221; für die Analyse und Präsentation von Informationen zu erstellen. &#160; &#160; Der Explorer der Relational Analysis Library zeigt das sehr [...]]]></description>
			<content:encoded><![CDATA[<p>Auch diese Flex-Komponenten sind sehr zu empfehlen. <a href="http://code.google.com/p/birdeye/" target="_blank">BirdEye</a> ist ebenfalls ein Community Projekt, beschäftigt sich allerdings mit umfangreichen Komponenten zur Visualisierung von Informationen und Analysen. Die Bibliotheken ermöglichen es dem User, multi-dimensionale &#8220;Data Visualisation Interfaces&#8221; für die Analyse und Präsentation von Informationen zu erstellen.</p>
<p>&nbsp;</p>
<p><a href="http://code.google.com/p/birdeye/" target="_blank"><img src="http://birdeye.googlecode.com/svn/trunk/images/BirdEyeLogoBase100.png" alt="" width="100" height="100" /></a></p>
<p>&nbsp;</p>
<p>Der <a href="http://birdeye.googlecode.com/svn/trunk/ravis/RaVisExamples/example-binaries/RaVisExplorer.html" target="_blank">Explorer</a> der Relational Analysis Library zeigt das sehr deutlich. BirdEye stellt insgesamt 5 Bibliotheken zur Verfügung. Erwähnenswert sind noch der <a href="http://birdeye.googlecode.com/svn/trunk/geovis/demo/GeoVisExplorer.html" target="_blank">GeoSpatial Analysis</a> und außerdem <a href="http://birdeye.googlecode.com/svn/trunk/qavis/examples/bin/QaVisExplorer.html" target="_blank">Quantitative Analysis</a>. Die beiden anderen sind noch in der Entwicklung wie es scheint.</p>
<hr />
<p><strong>Dieser Blogeintrag wurde ursprünglich auf http://wet-media.de/wetblog/ veröffentlicht, allerdings besteht dieser Blog nicht mehr.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2009/04/flex-birdeye/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial zum Erstellen einer Flex/Java/MySQL Applikation mit Hilfe von BlazeDS und JPA</title>
		<link>http://www.skybluetech.de/2009/03/tutorial-zum-erstellen-einer-flexjavamysql-applikation-mit-hilfe-von-blazeds-und-jpa/</link>
		<comments>http://www.skybluetech.de/2009/03/tutorial-zum-erstellen-einer-flexjavamysql-applikation-mit-hilfe-von-blazeds-und-jpa/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 07:16:42 +0000</pubDate>
		<dc:creator>David Crome</dc:creator>
				<category><![CDATA[Allgemein]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=135</guid>
		<description><![CDATA[Folgendes Tutorial soll zeigen wie einfach es ist, mit Flex über BlazeDS auf Java zu zugreifen, welches wiederrum auf die Datenbank (hier: MySql) zugreift. Der Vorgang wird Schritt für Schritt erklärt. Ich habe hier ein Projekt dazu angelegt. Um das Tutorial erfolgreich durchführen zu können benötigen wir folgende Tools: Vorraussetzungen: Eclipse 3.4 Ganymede J2EE Subclipse [...]]]></description>
			<content:encoded><![CDATA[<p>Folgendes Tutorial soll zeigen wie einfach es ist, mit Flex über BlazeDS auf Java zu zugreifen, welches wiederrum auf die Datenbank (hier: MySql) zugreift. Der Vorgang wird Schritt für Schritt erklärt. Ich habe <a href="http://code.google.com/p/flexjavablazedstutorial/" target="_blank">hier</a> ein Projekt dazu angelegt. Um das Tutorial erfolgreich durchführen zu können benötigen wir folgende Tools:<br />
<span id="more-135"></span><br />
<strong>Vorraussetzungen:</strong></p>
<ul>
<li><a href="http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR1/eclipse-jee-ganymede-SR1-win32.zip">Eclipse 3.4 Ganymede J2EE</a></li>
<li><a href="http://subclipse.tigris.org/install.html">Subclipse</a></li>
<li><a href="http://www.adobe.com/de/products/flex/">Flex 3</a> (Für Studenten: <a href="https://freeriatools.adobe.com/">hier</a>)</li>
<li><a href="http://www.flashmagazine.com/tutorials/detail/setting_up_subversion_with_adobe_flex_3/">Anleitung für Subclipse unter Flex</a></li>
<li><a href="http://download.macromedia.com/pub/opensource/blazeds/blazeds_turnkey_3-0-0-544.zip">BlazeDS Turnkey</a> &#8211; Distribution mit Tomcat, oder den<a href="http://tomcat.apache.org/index.html"> neuesten Tomcat</a></li>
<p>Die BlazeDS Turnkey-Distribution enthält einen älteren Tomcat, dafür aber ein paar Beispiele. Ihr solltet den neusten Tomcat nur runterladen wenn ihr mein Beispiel benutzt, da ihr sonst nicht die erforderlichen Dateien bekommt. (Update: Es auch möglich den aktuellen Tomcat in der Version 7 zu benutzen)</p>
<li><a href="http://www.apachefriends.org/download.php?xampplite-win32-1.6.8.exe">Xampp Lite mit MySql DB</a> (oder andere Datenbank, z.B. PostgreSQL)</li>
<li><a href="http://downloads.sourceforge.net/tortoisesvn/TortoiseSVN-1.5.4.14259-win32-svn-1.5.3.msi?download">SVN Client (Tortoise)</a> (nützlich, aber nicht notwendig)</li>
</ul>
<p><strong>1. Das Java Projekt:</strong></p>
<p>Wenn alle Tools installiert sind und alles läuft, starten wir zunächst Eclipse und legen dort ein neues Projekt an, welches wir von einem SVN-Repository auschecken:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt01-Eclipse-NewProject.jpg" alt="" width="536" height="428" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt02-Eclipse-CheckoutProjectsf.jpg" alt="" width="500" height="500" /><br />
Eine neue SVN-Repository Location anlegen:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt03-Eclipse-Select_Create_Loc.jpg" alt="" width="500" height="500" /><br />
Location angeben:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt04-Eclipse-Select_Create_Loc.jpg" alt="" width="500" height="500" /><br />
Projektordner auswählen:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt05-Eclipse-SelectFolder.jpg" alt="" width="500" height="500" /><br />
Kurz warten&#8230;</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt43-Eclipse-Gettingremoteproj.jpg" alt="" width="450" height="172" /><br />
Auschecken als Java-Projekt:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt06-Eclipse-Checkoutas.jpg" alt="" width="500" height="500" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt08-Eclipse-NewProject_Select.jpg" alt="Schritt08-Eclipse-NewProject_Select" width="500" height="500" /><br />
Als nächstes passen wir die Einstellungen für das Projekt an. Unter &#8220;Create project from existing source&#8221; <strong> &#8220;..\Tomcat 6.0\webapps\myapp\WEB-INF&#8221; </strong> angeben, da das Java Projekt im webapps Ordner des Tomcats liegen muss.</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt09-Eclipse-NewProject_Create.jpg" alt="" width="500" height="690" /><br />
Hier ist es wichtig, das &#8220;Default output folder&#8221; von <strong>&#8220;…/bin&#8221;</strong> in <strong>&#8220;…/classes&#8221;</strong> zu ändern:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt10-Eclipse-NewProject_JavaSe.jpg" alt="" width="500" height="690" /><br />
Die Frage nach dem Öffnen der Java Perspektive und die darauf folgende Frage mit Ja bestätigen (denn wir wollen ja die Daten aus dem Repository):</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt11-Eclipse-OpenAssociatedPer.jpg" alt="" width="498" height="688" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt12-Eclipse-ConfirmOverwrite.jpg" alt="" width="441" height="149" /><br />
Kurz warten…</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt13-Eclipse-SVNCheckout1.jpg" alt="" width="450" height="204" /><br />
…und warten…</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt14-Eclipse-SVNCheckout2.jpg" alt="" width="450" height="204" /><br />
Das Projekt hat nun mehrere Errors. Das hat den einfachen Grund das die Libaries, die gerade vom SVN-Repository runtergeladen wurden, nicht dem Build Path des Projektes hinzugefügt wurden.</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt15-Eclipse-Errors.jpg" alt="" width="352" height="323" /><br />
Das kann man aber ganz einfach beheben, indem man den Build Path konfiguriert, und dem Projekt die fehlenden Libraries hinzufügt durch auswählen aller jar-Dateien im lib-Ordner des &#8220;TestJava&#8221; Projektes.</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt16-Eclipse-ConfigureBuildPat.jpg" alt="" width="564" height="438" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt17-Eclipse-JavaBuildPath.jpg" alt="" width="666" height="536" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt18-Eclipse-JARSelection.jpg" alt="" width="346" height="419" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt19-Eclipse-JavaBuildPath2.jpg" alt="" width="666" height="536" /><br />
Fertig!</p>
<p><strong>2. Das Flex Projekt:</strong></p>
<p>Den Flex Builder starten und ein neues Projekt anlegen.</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt20-Flex-NewProject.jpg" alt="" width="452" height="428" /><br />
Checkout Projects from SVN, und eine neue Repository Location anlegen.</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt21-Flex-CheckoutProjectsfrom.jpg" alt="" width="500" height="500" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt22-Flex-Select_Create_Locati.jpg" alt="" width="500" height="500" /><br />
SVN-Repository Location eintragen und kurz warten:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt23-Flex-Select_Create_Locati.jpg" alt="" width="500" height="500" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt24-Flex-OperationinProgress.jpg" alt="" width="450" height="182" /></p>
<p>Dann Projekt Ordner auswählen, und wieder kurz warten:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt25-Flex-SelectFolder.jpg" alt="" width="500" height="500" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt26-Flex-Gettingremoteproject.jpg" alt="" width="450" height="182" /><br />
Danach auschecken als</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt27-Flex-CheckOutAs.jpg" alt="" width="500" height="500" /><br />
Nochmal kurz warten und dann auschecken als Flex Project:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt28-Flex-Gettingremoteproject.jpg" alt="" width="450" height="182" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt29-Flex-NewProject_SelectaWi.jpg" alt="" width="500" height="500" /><br />
Jetzt passen wir die Einstellungen an. Den Projektnamen eingeben, als Application Type &#8220;Web application&#8221; und als Server Technology &#8220;J2EE&#8221;.</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt30-Flex-NewProject_CreateANe.jpg" alt="" width="500" height="554" /><br />
WICHTIG: Die Server Location. Als Root Folder &#8220;&#8230;\Tomcat 6.0\webapps\myapp&#8221; (bzw. der WEB-INF Ordner in den ihr euer Java-Projekt gepackt habt), als Root URL &#8220;http://localhost:8080/myapp&#8221; und als Context root &#8220;/myapp&#8221;. Jetzt den Tomcat starten, sonst kann die Konfiguration nicht validiert werden. Ist der Tomcat gestartet, auf &#8220;Validate Configuration&#8221; klicken. Wenn oben steht &#8220;The web root folder and root URL are valid&#8221; habt ihr alles richtig gemacht, wenn nicht ist irgendwo ein Fehler <img src='http://www.skybluetech.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt31-Flex-NewProject_Configure.jpg" alt="" width="500" height="622" /><br />
Hier alles so lassen, Finish und danach Confirm overwrite drücken:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt32-Flex-NewProject_CreateAFl.jpg" alt="" width="500" height="664" /></p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt33-Flex-ConfirmOverwrite.jpg" alt="" width="441" height="159" /><br />
Mal wieder kurz warten…</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt34-Flex-SVNCheckout.jpg" alt="" width="450" height="191" /><br />
und fertig <img src='http://www.skybluetech.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>3. Die Datenbank:</strong></p>
<p>Damit ihr das Flex-Projekt starten könnt müsst ihr vorher folgendes beachten: Wenn ihr XAMPP richtig installiert habt, müsstet ihr unter <a href="http://localhost/xampp/">http://localhost/xampp/</a> folgendes angezeigt bekommen (Wenn ihr eine andere DB benutzt dann könnt ihr das überspringen):</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt35-XAMPP-Startseite.jpg" alt="" width="537" height="432" /><br />
Dort geht ihr auf Sicherheitscheck &#8230;</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt36-XAMPP-Sicherheitscheck.jpg" alt="" width="954" height="360" /><br />
… klickt unten auf den Link und setzt ein Passwort für root. Da ich bereits ein Passwort gesetzt habe, sieht es bei mir wahrscheinlich ein wenig anders aus, als bei euch. Dieses Passwort gut merken, da ihr es gleich benötigt!</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt37-XAMPP-Passwortsetzen.jpg" alt="" width="560" height="323" /></p>
<p>Wenn ihr ein Passwort gesetzt habt, geht ihr auf:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt38-XAMPP-PHPMyAdmin.jpg" alt="" width="597" height="419" /><br />
Und legt eine neue Datenbank an, z.B. testDB mit der folgenden Codierung:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt39-XAMPP-PHPMyAdmin_DBerstel.jpg" alt="" width="661" height="497" /><br />
Als nächstes müsst ihr das root Passwort und ggf. den DB-Namen unter Eclipse in src/META-INF/persistence.xml anpassen (Zeile 20: DB-Name; Zeile 22: Passwort):</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt40-Eclipse-persistencexmlanp.jpg" alt="" width="802" height="476" /><br />
Jetzt die DBTest.java als Java Application in Eclipse ausführen.</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt41-Eclipse-DBTestausfuehren.jpg" alt="" width="673" height="431" /><br />
Checkt unter PHPMyAdmin, ob die Daten reingeschrieben wurden:</p>
<p><img class="aligncenter" src="http://i81.photobucket.com/albums/j230/DaveAftershave/Schritt42-XAMPP-PHPMyAdmin_datenche.jpg" alt="" width="944" height="165" /><br />
WICHTIG: Bevor ihr jetzt das Flex-Projekt startet müsst ihr in der persistence.xml die Zeile 18 auskommentieren (Zeile 18 anklicken und dann Source &gt; Add Block Comment), da sonst bei der ersten Transaction mit der DB der Inhalt dieser überschrieben wird. NUR wenn ihr die Datenbank neu aufsetzen wollt müsst ihr den Comment wieder entfernen!<br />
Jetzt den Tomcat starten und unter Flex das TestFlex Projekt starten. Danach freuen das es alles klappt <img src='http://www.skybluetech.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>4. Erläuterungen:</strong></p>
<p>Java: Der im Java-Projekt enthaltene „flex“ Ordner enthält mehrere xml-Dateien, welche nötig sind damit die Übertragung zwischen Java und Flex reibungslos funktioniert. Dazu vor allem die remoting-config.xml beachten, da ich diese erweitert habe:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">          tutorial.model.service.Service
          session</pre></div></div>

<p>Ich hab ein für Flex erreichbares Ziel eingefügt. Dieses wird dann auch über die id „service“ von Flex aus angesprochen. Das Property source verweist auf die Klasse Service welche die von Flex aufzurufenden Methoden enthält. Diese Methoden können direkt von Flex aus angesprochen werden. Das Property scope kann 3 verschiedene Scopes enthalten: application, session und request. Ihr solltet hier natürlich eure Klassen angeben, welche ihr für den Austausch der Daten zwischen Flex und Java benötigt.</p>
<p>Flex: Um von Flex aus auf die Java-Methoden zugreifen zu können, müsst ihr nur ein RemoteObject instanzieren, sei es in MXML oder in ActionScript:</p>
<p>MXML:</p>
<p>gehört auch noch zur MXML-Möglichkeit; Aufruf der Methode über ActionScript in Java:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #339966; font-weight: bold;">function</span> login<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
accessmanager<span style="color: #000066; font-weight: bold;">.</span>login<span style="color: #000000;">&#40;</span>email<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">,</span> password<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>ActionScript:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> remoteLogin<span style="color: #000066; font-weight: bold;">:</span>RemoteObject = <span style="color: #0033ff; font-weight: bold;">new</span> RemoteObject<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
remoteLogin<span style="color: #000066; font-weight: bold;">.</span>destination = <span style="color: #990000;">&quot;service&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
remoteLogin<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;result&quot;</span><span style="color: #000066; font-weight: bold;">,</span> userLoginHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
remoteLogin<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;fault&quot;</span><span style="color: #000066; font-weight: bold;">,</span> faultHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">//Aufruf der Login-Methode in Java</span>
remoteLogin<span style="color: #000066; font-weight: bold;">.</span>login<span style="color: #000000;">&#40;</span>email<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000066; font-weight: bold;">,</span> password<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>Für beide Möglichkeiten (AS und MXML) gilt:<br />
Wenn die aufgerufene Methode einen Rückgabewert hat, dann kann der mithilfe des angegeben ResultHandlers aufgefangen und verwertet werden:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> userLoginHandler<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span>ResultEvent<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> yesOrNo<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">.</span>result<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>yesOrNo == <span style="color: #990000;">&quot;NO&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		Alert<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">show</span><span style="color: #000000;">&#40;</span> <span style="color: #990000;">&quot;Login fehlgeschlagen! &quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>yesOrNo == <span style="color: #990000;">&quot;YES&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		currentState = <span style="color: #990000;">'Startpage'</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Dieser ResultHandler wurde oben bei der Instantiierung angegeben. Er wurde dem RemoteObject als EventHandler übergeben.</p>
<hr />
<p><strong>Dieses Tutorial wurde ursprünglich auf http://wet-media.de/wetblog/ veröffentlicht, allerdings besteht dieser Blog nicht mehr.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2009/03/tutorial-zum-erstellen-einer-flexjavamysql-applikation-mit-hilfe-von-blazeds-und-jpa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Fragmentation Class Tutorial pt.2</title>
		<link>http://www.skybluetech.de/2009/01/as3-fragmentation-class-tutorial-pt-2/</link>
		<comments>http://www.skybluetech.de/2009/01/as3-fragmentation-class-tutorial-pt-2/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 15:48:00 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Plattform]]></category>
		<category><![CDATA[Partikelsysteme]]></category>
		<category><![CDATA[explode]]></category>
		<category><![CDATA[fragmentation]]></category>
		<category><![CDATA[particle]]></category>
		<category><![CDATA[Partikel]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=82</guid>
		<description><![CDATA[[english version] Im zweiten Teil des Turorials geht jetzt etwas mehr an Eingemachte. Da wir im ersten Teil nur eine Fläche aus grauen Kacheln erstellt haben, werden wir das ganze jetzt dahingehend verbessern, dass jede einzelne Kachel mit den entsprechenden Ausschnitt der Bilddaten einer Bilddatei gefüllt wird. Die gekachelten Sprites stellen, positioniert per for-Schleife, das [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><a title="english version" href="http://www.cityclouds.de/?p=519" target="_blank">[english version]</a></p>
<p style="text-align: center;"><a href="http://www.skybluetech.de/files/JPEG/Fragment4.png"><img class="aligncenter" title="AS3 Fragment Class A" src="http://www.skybluetech.de/files/JPEG/Fragment4.png" alt="AS3 Fragment Class A" width="674" height="472" /></a><br />
<a href="http://www.skybluetech.de/files/JPEG/Fragment5.png"><img class="aligncenter" title="AS3 Fragment Class B" src="http://www.skybluetech.de/files/JPEG/Fragment5.png" alt="AS3 Fragment Class B" width="674" height="472" /></a></p>
<p>Im zweiten Teil des Turorials geht jetzt etwas mehr an Eingemachte. Da wir im ersten Teil nur eine Fläche aus grauen Kacheln erstellt haben, werden wir das ganze jetzt dahingehend verbessern, dass jede einzelne Kachel mit den entsprechenden Ausschnitt der Bilddaten einer Bilddatei gefüllt wird. <span id="more-82"></span>Die gekachelten Sprites stellen, positioniert per for-Schleife, das Bild wieder korrekt dar. Der Unterschied zum Original ist nicht festzustellen da die Sprites nahtlos nebeneinander liegen. Aus diesen Kacheln erstellen wir als letzten Schritt ein ParticleObject um es später elegant animieren zu können.<br />
Die folgende Skizze soll diese kompakte Beschreibung ein wenig verdeutlichen:</p>
<p style="text-align: center;"><a href="http://www.skybluetech.de/files/JPEG/fragmentSketch.png"><img class=" aligncenter" title="AS3 Fragment Class thumbnail sketch" src="http://www.skybluetech.de/files/JPEG/fragmentSketch.png" alt="AS3 Fragment Class thumbnail sketch" width="674" height="472" /></a></p>
<p>Der Quellcode besteht wieder aus einer *.fla Datei die im Prinzip nur zu starten der DocumentClass (&#8216;FragmentClassDC.as&#8217;) da ist. &#8216;FragmentLayer.as&#8217; enthält den Code zum erstellen der Kacheln (jeweils als Partikel) aus einem übergebenen Bild und zur Steuerung der Animation der Kacheln. Die Klasse &#8216;ParticleObject.as&#8217; erstellt den jeweiligen Partikel der aus einem viereckigen Sprite besteht (&#8216;BitmapDataRectangle.as&#8217;), dessen BitmapData durch einem Teilausschnitt des übergebenen Bildes ersetzt wird. Die Datei &#8216;QuickLoader.as&#8217; ist nicht nur dem Namen nach nur für das laden der Bilder zuständig, sondern tut genau das.</p>
<p>Also dann mal los:<br />
Das erzeugen des FragmentLayers geschiet in der DocumentClass und ist analog zum ersten Teil, geändert haben sich nur ein paar Argumente zu denen das Container DisplayObject und die geladene Bitmap vorangestellt werden:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// define FragmentLayer arguments</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> rectSize<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>			<span style="color: #009900; font-style: italic;">// rectangle size</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> updateRate<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>  = <span style="color: #000000; font-weight:bold;">30</span><span style="color: #000066; font-weight: bold;">;</span>		<span style="color: #009900; font-style: italic;">// update rate</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> dirVector<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span>  = <span style="color: #990000;">&quot;right&quot;</span><span style="color: #000066; font-weight: bold;">;</span>	<span style="color: #009900; font-style: italic;">// animation direction (from - to)</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> dispEvent<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>		<span style="color: #009900; font-style: italic;">// dispatch event when animation has finished</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> startNow<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>		<span style="color: #009900; font-style: italic;">// start immediately</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> overlay<span style="color: #000066; font-weight: bold;">:</span>FragmentLayer<span style="color: #000066; font-weight: bold;">;</span>
overlay = <span style="color: #0033ff; font-weight: bold;">new</span> FragmentLayer <span style="color: #000000;">&#40;</span> your_container<span style="color: #000066; font-weight: bold;">,</span> your_bitmap<span style="color: #000066; font-weight: bold;">,</span> rectSize<span style="color: #000066; font-weight: bold;">,</span> updateRate<span style="color: #000066; font-weight: bold;">,</span> dirVector<span style="color: #000066; font-weight: bold;">,</span> dispEvent<span style="color: #000066; font-weight: bold;">,</span> startNow<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>Der Constructor sieht wie folgt aus:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Constructor</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> FragmentLayer <span style="color: #000000;">&#40;</span>container<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">DisplayObjectContainer</span><span style="color: #000066; font-weight: bold;">,</span> sourceBM<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Bitmap</span><span style="color: #000066; font-weight: bold;">,</span>
				rectSize<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000066; font-weight: bold;">,</span> updateRate<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">30</span><span style="color: #000066; font-weight: bold;">,</span>
				dirVector<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;right&quot;</span><span style="color: #000066; font-weight: bold;">,</span>
				dispEvent<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">,</span> startNow = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>container = container<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>sourceBM = sourceBM<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>rectSize = rectSize<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>updateRate = updateRate<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>dirVector = dirVector<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>dispEvent = dispEvent<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>startNow = startNow<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	wLen = container<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> <span style="color: #000066; font-weight: bold;">/</span> rectSize<span style="color: #000066; font-weight: bold;">;</span>
	hLen = container<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span> <span style="color: #000066; font-weight: bold;">/</span> rectSize<span style="color: #000066; font-weight: bold;">;</span>
	partArray = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// if two times &quot;true&quot; then start immediately</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span> initArea <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span> startNow <span style="color: #000000;">&#41;</span> 	startEffect<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Für den Fall das startNow = true ist wird sofort der Effekt gestartet, da die aufgerufene Methode initArea() nach Beendigung immer ein true zurückgibt. In diesem Beispiel ziehen wir aber mal den Effektstart per späterem MausClick vor.</p>
<p>Die Initialisierung der rechteckigen Fläche:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Init the rectangle area</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> initArea <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span>dirVector<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;left&quot;</span> <span style="color: #000066; font-weight: bold;">:</span>
				updateLeft<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;right&quot;</span> <span style="color: #000066; font-weight: bold;">:</span>
				updateRight<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;up&quot;</span> <span style="color: #000066; font-weight: bold;">:</span>
				updateUp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;down&quot;</span> <span style="color: #000066; font-weight: bold;">:</span>
				updateDown<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #0033ff; font-weight: bold;">default</span> <span style="color: #000066; font-weight: bold;">:</span>
				updateRight<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>	<span style="color: #009900; font-style: italic;">// call left as default</span>
				<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Wir haben rechts gewählt, also erfolgt das Erstellen der Kacheln durch updateRight(). Diese ordnet die Kacheln so an, dass sie später von rechts nach links zersplittern. Jede Kachel wird durch createRect() definiert.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// particle movement right to left</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> updateRight <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span> wLen<span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> j <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span> hLen<span style="color: #000066; font-weight: bold;">;</span> j<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> xPos<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000;">&#40;</span>i <span style="color: #000066; font-weight: bold;">*</span> rectSize<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> yPos<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000;">&#40;</span>j <span style="color: #000066; font-weight: bold;">*</span> rectSize<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			createRect <span style="color: #000000;">&#40;</span>xPos<span style="color: #000066; font-weight: bold;">,</span> yPos<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Jedes Bitmap speichert seine Bild Informationen als BitmapData. Das geladene Bild, welches wir dem Constructor übergeben haben, enthält ebenso eine BitmapData welche wir hier in die Kachel-Sprites kopieren:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Fill the fragment pieces</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createRect <span style="color: #000000;">&#40;</span>xPos<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> yPos<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// count rectangles</span>
	count<span style="color: #000066; font-weight: bold;">++;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// create rectangle with blue (default) Bitmap inside</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> cr<span style="color: #000066; font-weight: bold;">:</span>BitmapDataRectangle = <span style="color: #0033ff; font-weight: bold;">new</span> BitmapDataRectangle<span style="color: #000000;">&#40;</span>rectSize<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// target rectangle</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Rectangle</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Rectangle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> rectSize<span style="color: #000066; font-weight: bold;">,</span> rectSize<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// target section of the source image</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> pt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Point</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Point</span><span style="color: #000000;">&#40;</span>xPos<span style="color: #000066; font-weight: bold;">,</span> yPos<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = pt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = pt<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// copy BitmapData to Byte stream</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> bytes<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ByteArray</span> = sourceBM<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bitmapData</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getPixels</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">rect</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	bytes<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">position</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">//destination rectangle</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> destRect<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Rectangle</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Rectangle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> rectSize<span style="color: #000066; font-weight: bold;">,</span> rectSize<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// write Byte stream to destination rectangle</span>
	cr<span style="color: #000066; font-weight: bold;">.</span>getBmd<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setPixels</span> <span style="color: #000000;">&#40;</span>destRect<span style="color: #000066; font-weight: bold;">,</span> bytes<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// pass the CustomRectangle to the final create method</span>
	createFragmentParticle <span style="color: #000000;">&#40;</span>xPos<span style="color: #000066; font-weight: bold;">,</span> yPos<span style="color: #000066; font-weight: bold;">,</span> cr<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Die finale Methode zur Erzeugung erstellt nun aus den Kachel-Sprites einzelne PartikelObjects und speichert diese in einem Array. Die Methode randRange() liefert dabei eine Zufallszahl zurück welche die Bewegungen dynamischer macht. Ach ja, fühlt euch frei und spielt ruhig mal mit den Parametern <img src='http://www.skybluetech.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Create a fragment particle an push it onto the array</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> createFragmentParticle <span style="color: #000000;">&#40;</span>xPos<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">,</span> yPos<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">rect</span><span style="color: #000066; font-weight: bold;">:</span>BitmapDataRectangle<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// create the fragment rectangle</span>
	particle = <span style="color: #0033ff; font-weight: bold;">new</span> ParticleObject<span style="color: #000000;">&#40;</span> container<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">rect</span> <span style="color: #0033ff; font-weight: bold;">as</span> <span style="color: #004993;">Sprite</span><span style="color: #000066; font-weight: bold;">,</span> xPos<span style="color: #000066; font-weight: bold;">,</span> yPos<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">// -&amp;gt; Play with these Parameters!</span>
	<span style="color: #009900; font-style: italic;">// define velocity</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>setVel <span style="color: #000000;">&#40;</span> randRange<span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> randRange<span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">50</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// add drag</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>drag = <span style="color: #000000; font-weight:bold;">0.97</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// set gravity</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>gravity = <span style="color: #000000; font-weight:bold;">0.3</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// randomize particle size</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>clip<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleX</span> = particle<span style="color: #000066; font-weight: bold;">.</span>clip<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleY</span> = <span style="color: #000000; font-weight:bold;">1.0</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #009900; font-style: italic;">// set shrink</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>shrink = randRange <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0.5</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">1.03</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// add fade</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>fade = <span style="color: #000000; font-weight:bold;">0.01</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// particle clip starting alpha</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>clip<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">alpha</span> = <span style="color: #000000; font-weight:bold;">1.0</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">// -&amp;gt; ok stop</span>
	<span style="color: #009900; font-style: italic;">// push particle onto Array</span>
	partArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">push</span> <span style="color: #000000;">&#40;</span>particle<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Calc a random range of particle movement</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> randRange <span style="color: #000000;">&#40;</span><span style="color: #004993;">min</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">max</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// e.g.: 5 - (-5) = 10;  10 + (-5)</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> randNum<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">max</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #004993;">min</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">min</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> randNum<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Soweit ist nun die Erstellung des FragmentationLayers abgeschlossen. Der Aufruf (hier durch ein MouseClick-Event auf den Container in der DocumentClass) von startEffect() bring die Animation ins Rollen:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Start the fragmentation effect</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> startEffect <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> frameLoop<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Diese wirft, soweit die Variable &#8216;dispEvent = true&#8217; ist, ein Custom-Event wenn die Effekt-Animation zuende ist und stopt in jedem Fall das EnterFrame-Event:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Effect has finished</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> effectEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> frameLoop<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>dispEvent<span style="color: #000000;">&#41;</span>	<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Event</span><span style="color: #000000;">&#40;</span>EFFECT_DONE<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Das Custom-Event fangen wir in der DocumentClass auf und wiederholen hier im Beispiel die fragmentation der beiden geladenen Bilder:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">overlay<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span> <span style="color: #000000;">&#40;</span>FragmentLayer<span style="color: #000066; font-weight: bold;">.</span>EFFECT_DONE<span style="color: #000066; font-weight: bold;">,</span> effectDoneHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// FragmentLayer Effect Finished</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> effectDoneHandler <span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Overlay #1&quot;</span> <span style="color: #000066; font-weight: bold;">:</span>
			<span style="color: #004993;">trace</span> <span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Effect done: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #009900; font-style: italic;">// ...and again...</span>
			<span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Overlay #2&quot;</span> <span style="color: #000066; font-weight: bold;">:</span>
			<span style="color: #004993;">trace</span> <span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Effect done: &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">currentTarget</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">break</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Das eigendliche update der ParticleObjects übernimmt der frameLoop() in der FragmentLayer.as, den die vorher erwähnte startEffect() Methode auslöst.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Effect frame-loop</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> frameLoop <span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #009900; font-style: italic;">// increasing part of the array which has to be updated</span>
	part2update <span style="color: #000066; font-weight: bold;">+</span>= updateRate<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// ...if this part is too long, correct it</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>part2update <span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span> partArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		part2update = partArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">// loop through Array and update each one</span>
	<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span> part2update<span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		partArray<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span>update <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">// remove invisible particle</span>
		<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>partArray<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">.</span>invisible == <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			removeParticle <span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			part2update <span style="color: #000066; font-weight: bold;">--;</span>
			i<span style="color: #000066; font-weight: bold;">--;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Der unsichtbar gewordenen Objekte entledigen wir uns per removeParticle(), welche letztendlich auch die weiter oben beschriebene effectEnd() Funktion aufruft:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">// Destroy a particle</span>
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> removeParticle <span style="color: #000000;">&#40;</span>val<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> buffer<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = partArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">splice</span> <span style="color: #000000;">&#40;</span>val<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	particle = buffer<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">pop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	particle<span style="color: #000066; font-weight: bold;">.</span>destroy <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>partArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span> <span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		effectEnd<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Viel Spass beim Ausprobieren!</p>
<p><a href="http://www.skybluetech.de/wp-content/uploads/2011/09/AS3-Fragmentation-Class2.zip">AS3 Fragmentation Class2</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2009/01/as3-fragmentation-class-tutorial-pt-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 Fragmentation Class Tutorial pt.1</title>
		<link>http://www.skybluetech.de/2009/01/as3-fragmentation-class-tutorial-pt-1/</link>
		<comments>http://www.skybluetech.de/2009/01/as3-fragmentation-class-tutorial-pt-1/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 14:56:32 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash Plattform]]></category>
		<category><![CDATA[Partikelsysteme]]></category>
		<category><![CDATA[explode]]></category>
		<category><![CDATA[fragmentation]]></category>
		<category><![CDATA[particle]]></category>
		<category><![CDATA[Partikel]]></category>

		<guid isPermaLink="false">http://www.skybluetech.de/?p=63</guid>
		<description><![CDATA[[english version] Um hübsche Zersplitterungs-Effekte wie beispielsweise auf Andy Foulds`s Homepage hinzubekommen, habe ich eine AS3 Klasse entwickelt um deren Beschreibung es hier im ersten Teil gehen wird. Es handelt sich jetzt eher um eine Anleitung als um ein ausführliches Programming Tutorial. Der zeite Teil wird allerdings in eben diese Richtung gehen, da wir uns [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><em><a title="english version" href="http://www.cityclouds.de/?p=422" target="_blank">[english version]</a></em></p>
<p>Um hübsche Zersplitterungs-Effekte wie beispielsweise auf <a href="http://andyfoulds.co.uk/flash_design.html" target="_blank">Andy Foulds</a>`s Homepage hinzubekommen, habe ich eine AS3 Klasse entwickelt um deren Beschreibung es hier im ersten Teil gehen wird. Es handelt sich jetzt eher um eine Anleitung als um ein ausführliches Programming Tutorial. Der zeite Teil wird allerdings in eben diese Richtung gehen, da wir uns dann dem Problem stellen, wie man ein beliebiges DisplayObject (Bitmap-Bild/MovieClip/etc.) auf den Fragmentation Layer legt um dieses dann ansprechend zersplittern zu lassen.<span id="more-63"></span><br />
<img class="alignnone" src="http://www.skybluetech.de/files/JPEG/Fragment0.JPG" alt="" width="160" height="102" /><img class="alignnone" src="http://www.skybluetech.de/files/JPEG/Fragment1.JPG" alt="" width="160" height="103" /><img class="alignnone" src="http://www.skybluetech.de/files/JPEG/Fragment2.JPG" alt="" width="160" height="119" /></p>
<p>In den Sources verwende ich eine DocumentClass, die einfach von der &#8220;FragmentExample.fla&#8221; gestartet wird, also nur nicht wundern wenn in der *.fla kein Code zu finden ist.</p>
<p>Zum starten des Effektes aus Flash heraus sind ein paar notwendige Dinge anzugeben:</p>
<p><strong>1. Package importieren:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> de<span style="color: #000066; font-weight: bold;">.</span>ehrhardt<span style="color: #000066; font-weight: bold;">.</span>fragment<span style="color: #000066; font-weight: bold;">.*;</span></pre></div></div>

<p><strong>2. Einen neuen Fragmentation Layer erstellen:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> rectSize<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> updateRate<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>  = <span style="color: #000000; font-weight:bold;">30</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> fxDirection<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span>  = <span style="color: #990000;">&quot;left&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> bgColor<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = 0xCCCCCC<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">borderColor</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> = 0xCCCCCC<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> borderSize<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0.2</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> startNow<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> fragLayer<span style="color: #000066; font-weight: bold;">:</span>FragmentLayer = <span style="color: #0033ff; font-weight: bold;">new</span> FragmentLayer <span style="color: #000000;">&#40;</span>your_mc<span style="color: #000066; font-weight: bold;">,</span> rectSize<span style="color: #000066; font-weight: bold;">,</span> updateRate<span style="color: #000066; font-weight: bold;">,</span>
                               fxDirection<span style="color: #000066; font-weight: bold;">,</span> bgColor<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">borderColor</span><span style="color: #000066; font-weight: bold;">,</span> borderSize<span style="color: #000066; font-weight: bold;">,</span> startNow<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p><strong>3. RectSize definieren:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">your_mc</pre></div></div>

<p>&#8230;durch den gewünschten Instanznamen ersetzen. Es sollte darauf geachtet werden, die Dimension des DisplayObjects genau zu mappen, da ich diese Funktion hier nicht vorstelle. Als Beispiel: für einen MC mit 220&#215;110 sollte die rectSize = 10 betragen, da es sonst zu unvollständigen Überdeckungen kommt.</p>
<p><strong>4. Frame Rate setzen:</strong></p>
<p>Mehr als 25 Bilder pro Sekunde sind für eine flüssige Animation empfehlenswert. Zu finden in Flash unter &#8220;Properies&#8221; bzw. &#8220;Eigenschaften&#8221;.</p>
<p>(Optional:)<br />
<strong>5. Effekt manuell starten, z.B. nach MouseClick Event:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">your_mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> clickActionHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> clickActionHandler <span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
    fragLayer<span style="color: #000066; font-weight: bold;">.</span>startEffect<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
    e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CLICK</span><span style="color: #000066; font-weight: bold;">,</span> clickActionHandler<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Dazu noch die Variable startNow auf &#8220;false&#8221; setzen:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> startNow<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>So, fertig.<br />
Damit ist der erste Teil abgeschlossen. Wie man nun ein Bild auf den Fragmentation-Layer legt um eine nette Transition zu erzeugen, erleutere ich genauer im 2 Teil.</p>
<p><a href="http://www.skybluetech.de/wp-content/uploads/2011/09/AS3-Fragmentation-Class1.zip">AS3 Fragmentation Class1</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.skybluetech.de/2009/01/as3-fragmentation-class-tutorial-pt-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

