<?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>kodal.de</title>
	<atom:link href="http://kodal.de/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://kodal.de</link>
	<description>it´s all about music, design and coding</description>
	<lastBuildDate>Fri, 06 Aug 2010 09:35:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash AS3 : Hand-Maus Cursor über dynamischen Textfeldern</title>
		<link>http://kodal.de/?p=151</link>
		<comments>http://kodal.de/?p=151#comments</comments>
		<pubDate>Fri, 06 Aug 2010 09:27:30 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[flash/flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cursor]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[hand]]></category>
		<category><![CDATA[mouseevent]]></category>
		<category><![CDATA[textfield]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=151</guid>
		<description><![CDATA[Das Problem:
Wenn ein dynamisches Textfeld auf der obersten Ebene einer Schaltfläche liegt, erscheint beim Darüberfahren mit der Maus nicht wie beim Rest der Schaltfläche der Hand-Cursor, sondern der normale Mauszeiger, auch wenn die akive Fläche des Buttons weiterhin bestehen bleibt. 
Im Klartext: Ein Button mit oben aufliegendem dynamischen Textfeld bleibt klickbar, aber der Mauszeiger wechselt [...]]]></description>
			<content:encoded><![CDATA[<p>Das Problem:<br />
Wenn ein dynamisches Textfeld auf der obersten Ebene einer Schaltfläche liegt, erscheint beim Darüberfahren mit der Maus nicht wie beim Rest der Schaltfläche der Hand-Cursor, sondern der normale Mauszeiger, auch wenn die akive Fläche des Buttons weiterhin bestehen bleibt. </p>
<p>Im Klartext: Ein Button mit oben aufliegendem dynamischen Textfeld bleibt klickbar, aber der Mauszeiger wechselt über der betreffenden Textfläche nicht wie gewünscht zum Hand-Cursor.</p>
<p>Abhilfe:<br />
Unter ActionScript 2 beheben wir dieses Phänomen, indem wir das &#8220;selectable&#8221;-Attribut des betreffenden Textfeldes auf false setzen. Die Möglichkeit, den Inhalt eines Textfeldes auszuwählen, steht nämlich bei AS2 in Konkurrenz zu den MouseEvents, die bei auswählbaren Textfeldern unter AS2 nicht an die dahinter liegende aktive Fläche eines Buttons weitergereicht (und somit ausgewertet) werden können.</p>
<p>Unter AS2 hilft uns diese Anweisung, um den Mauszeigerwechsel auch über Textfeldern zu bewirken:</p>
<p>Textfeld.selectable = false;</p>
<p>Dies hilft uns allerdings unter ActionScript3 nicht weiter. Auch wenn ein Textfeld nicht auswählbar ist, fängt es trotzdem etwaige MouseEvents ab, die dann nicht mehr für darunterliegende Schaltflächen zur Verfügung stehen. </p>
<p>Wir schaffen für dieses Problem Abhilfe, indem wir das &#8220;mouseEnabled&#8221;-Attribut heranziehen, das seit AS3 auch für alle Textfelder bereitsteht. Wenn wir mit Hilfe von</p>
<p>Textfeld.mouseEnabled = false;</p>
<p>verhindern, dass das Textfeld selbst auf Mausevents reagiert, halten wir so gleichzeitig auch den &#8220;Luftraum&#8221; über der aktiven Schaltfläche frei. Anschließend wird nicht mehr das Textfeld, sondern wie gewünscht die dahinterliegende Schaltfläche für MouseEvents empfänglich..</p>
<img src="http://kodal.de/?ak_action=api_record_view&id=151&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=151</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Label Autopflegeprodukt: Car-Love</title>
		<link>http://kodal.de/?p=136</link>
		<comments>http://kodal.de/?p=136#comments</comments>
		<pubDate>Thu, 17 Jun 2010 10:00:48 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Car]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Franz Billich]]></category>
		<category><![CDATA[Illustrator]]></category>
		<category><![CDATA[Polish]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=136</guid>
		<description><![CDATA[Im Zuge des Relaunches mehrerer Produktserien aus dem Bereich Autopflege und Polituren erfolgte im Auftrag der Firma Franz Billich die Umsetzung eines Logo- und Labeldesigns für das Autopflegeprodukt &#8220;Car Love&#8221;.



Erstellt und umgesetzt mit Illustrator. Logo-Entwicklung und Illustration: Timor Kodal
]]></description>
			<content:encoded><![CDATA[<p>Im Zuge des Relaunches mehrerer Produktserien aus dem Bereich Autopflege und Polituren erfolgte im Auftrag der Firma Franz Billich die Umsetzung eines Logo- und Labeldesigns für das Autopflegeprodukt &#8220;Car Love&#8221;.<br />
<br />
<a href="http://iovano.de"><img alt="CarLove" src="http://iovano.de/var/media/kunden/franzbillich/CarLove.jpg" title="CarLove Flipside" class="alignleft" width="150" height="401" /></a><a href="http://iovano.de"><img alt="CarLove High Finish Polish" src="http://iovano.de/var/media/kunden/franzbillich/CarLove-flip.jpg" title="CarLove" width="150" height="401" /></a><br />
<br clear="left" /></p>
<p>Erstellt und umgesetzt mit Illustrator. Logo-Entwicklung und Illustration: Timor Kodal</p>
<img src="http://kodal.de/?ak_action=api_record_view&id=136&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=136</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barfuss Sommerlandung 2010</title>
		<link>http://kodal.de/?p=131</link>
		<comments>http://kodal.de/?p=131#comments</comments>
		<pubDate>Fri, 28 May 2010 13:08:32 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Festival]]></category>
		<category><![CDATA[house]]></category>
		<category><![CDATA[kiekebusch]]></category>
		<category><![CDATA[Openair]]></category>
		<category><![CDATA[pulsar]]></category>
		<category><![CDATA[rave]]></category>
		<category><![CDATA[schönefeld]]></category>
		<category><![CDATA[see]]></category>
		<category><![CDATA[sommerlandung]]></category>
		<category><![CDATA[sonne]]></category>
		<category><![CDATA[sonnenwind]]></category>
		<category><![CDATA[Techhouse]]></category>
		<category><![CDATA[techno]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=131</guid>
		<description><![CDATA[Im Zuge der Organisation eines Festivals vor den Toren Berlins habe ich einen doppelseitigen 4/4 &#8211; Flyer erstellt.
Weitere Infos zur Veranstaltung findet man unter http://sommerlandung.pulsar.cc


Erstellt und umgesetzt mit Illustrator. Illustration: Timor Kodal
]]></description>
			<content:encoded><![CDATA[<p>Im Zuge der Organisation eines Festivals vor den Toren Berlins habe ich einen doppelseitigen 4/4 &#8211; Flyer erstellt.</p>
<p>Weitere Infos zur Veranstaltung findet man unter <a href="http://sommerlandung.pulsar.cc">http://sommerlandung.pulsar.cc</a></p>
<p><a href="http://sommerlandung.pulsar.cc"><img alt="Barfuss Sommerlandung 2010" src="http://pulsar.cc/pix/sommerlandung/2010/sommerlandung10_400.jpg" title="Barfuss Sommerlandung 2010" class="alignleft" width="400" height="400" /></a></p>
<p><a href="http://sommerlandung.pulsar.cc"><img alt="Barfuss Sommerlandung 2010" src="http://pulsar.cc/pix/sommerlandung/2010/sommerlandung10_400_FLIP.jpg" title="Barfuss Sommerlandung 2010" width="400" height="400" /></a></p>
<p>Erstellt und umgesetzt mit Illustrator. Illustration: Timor Kodal</p>
<img src="http://kodal.de/?ak_action=api_record_view&id=131&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=131</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seminarreihe &#8220;Urban Sounds&#8221; an der FH Potsdam</title>
		<link>http://kodal.de/?p=129</link>
		<comments>http://kodal.de/?p=129#comments</comments>
		<pubDate>Fri, 28 May 2010 13:04:09 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ableton live]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[adobe flash]]></category>
		<category><![CDATA[apple logic]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[blockseminar]]></category>
		<category><![CDATA[fh potsdam]]></category>
		<category><![CDATA[fieldrecordings]]></category>
		<category><![CDATA[pulsar]]></category>
		<category><![CDATA[seminar]]></category>
		<category><![CDATA[sound]]></category>
		<category><![CDATA[soundmapping]]></category>
		<category><![CDATA[stadtakustik]]></category>
		<category><![CDATA[urban sounds]]></category>
		<category><![CDATA[vorlesung]]></category>
		<category><![CDATA[vortrag]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=129</guid>
		<description><![CDATA[Seit 21. Mai läuft in der FH Potsdam die Seminarreihe &#8220;Urban Sounds&#8221;, im Rahmen derer ich eine kleine Einführung in die Grundlagen der Anwendung von Apple Logic und Ableton Live (beides Programme zum Aufnehmen, Arrangieren und (Post)Produzieren von Sound und Musik) geben werde. Zwischen den Terminen sind die teilnehmenden Studenten im Rahmen einer Projektarbeit zum [...]]]></description>
			<content:encoded><![CDATA[<p>Seit 21. Mai läuft in der FH Potsdam die Seminarreihe &#8220;Urban Sounds&#8221;, im Rahmen derer ich eine kleine Einführung in die Grundlagen der Anwendung von Apple Logic und Ableton Live (beides Programme zum Aufnehmen, Arrangieren und (Post)Produzieren von Sound und Musik) geben werde. Zwischen den Terminen sind die teilnehmenden Studenten im Rahmen einer Projektarbeit zum Thema &#8220;Berlin Wall of Sound&#8221; aufgerufen, eigene Fieldrecordings zu erstellen und diese zum nächsten Seminartermin mitzubringen.</p>
<p>Dann werden die gesammelten Audiodaten gemeinsam bearbeitet und stehen für eine weitere kreative Verwendung zur Verfügung.</p>
<p>So wird im Verlauf des zweiten Blockseminar-Termins mit Hilfe von Flash eine rudimentäre Visualisierung der Audiofiles während der Wiedergabe realisiert und den Studenten die hierfür erforderlichen Kenntnisse von &#8220;Adobe Flash&#8221; vermittelt.</p>
<p>Die Ergebnisse des Seminars werden am 21. Juni im Rahmen eines Vortrags im Fachbereich &#8220;Kulturarbeit&#8221; der FH vorgestellt und weitere Anwendungsmöglichkeiten dieses Themenkomplexes diskutiert.</p>
<p>Eine das Seminar begleitende Website ist unter dieser URL abrufbar:</p>
<p><a href="http://stadtakustik.kodal.de">stadtakustik.kodal.de</a></p>
<img src="http://kodal.de/?ak_action=api_record_view&id=129&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=129</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mod_Rewrite erfolgreich bei Subdomains mit Umlauten einsetzen</title>
		<link>http://kodal.de/?p=123</link>
		<comments>http://kodal.de/?p=123#comments</comments>
		<pubDate>Fri, 12 Feb 2010 11:23:11 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[sobdomains]]></category>
		<category><![CDATA[umlaut]]></category>
		<category><![CDATA[umlaute]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=123</guid>
		<description><![CDATA[
RewriteCond %{HTTP_HOST} (gewerberaumboerse&#124;gewerberaumbörse)\.(wgb24&#124;dwgb)\.(net&#124;de) [NC]
RewriteRule (.*) http://%2.%3/%1?%{QUERY_STRING}

RewriteRule (xn--gewerberaumbrse-ktb) gewerberaumbörse [R=301]

Das vorliegende Beispiel zeigt eine mögliche (generische) Verwendung des Mod_Rewrite-Moduls von Apache beim Umgang mit Subdomains, die Umlaute im Namen tragen.
Die ersten beiden Zeilen bewirken, dass die Domains "gewerberaumboerse" und "gewerberaumbörse" auf die Domain "wgb24.net" umgeleitet werden, und der Name der Subdomain dem URI_REQUEST als Pfad angehängt [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php;">
RewriteCond %{HTTP_HOST} (gewerberaumboerse|gewerberaumbörse)\.(wgb24|dwgb)\.(net|de) [NC]
RewriteRule (.*) http://%2.%3/%1?%{QUERY_STRING}

RewriteRule (xn--gewerberaumbrse-ktb) gewerberaumbörse [R=301]
</pre>
<p>Das vorliegende Beispiel zeigt eine mögliche (generische) Verwendung des Mod_Rewrite-Moduls von Apache beim Umgang mit Subdomains, die Umlaute im Namen tragen.</pre>
<p>Die ersten beiden Zeilen bewirken, dass die Domains "gewerberaumboerse" und "gewerberaumbörse" auf die Domain "wgb24.net" umgeleitet werden, und der Name der Subdomain dem URI_REQUEST als Pfad angehängt werden. So soll erreicht werden, dass "gewerberaumbörse.wgb24.net" zu "wgb24.net/gewerberaumbörse" umgewandelt wird.</p>
<pre class="brush: php;">
RewriteCond %{HTTP_HOST} (gewerberaumboerse|wohnraumboerse)\.(wgb24)\.(net) [NC]
RewriteRule (.*) http://wgb24.net/%1?%{QUERY_STRING}
</pre>
<p>Das %1 in der zweiten Zeile wird als "backreference" bezeichnet, und bewirkt, dass wir beim Umschreiben der URL den Namensbestandteil der Subdomain, den wir in der RewriteCond abgefragt haben, auch noch zur Verfügung haben. Ansonsten würde sich die RewriteRule nur auf den REQUEST_URI-Teil der Anfrage beziehen. Die Information, welche Subdomain abgefragt wird, stünde uns sonst somit nicht zur Verfügung. Die Referenzen sind hier farblich hervorgehoben:</p>
<p>RewriteCond %{HTTP_HOST} <strong><span style="color: #ff9900;">(gewerberaumboerse|wohnraumboerse)</span></strong>\.<strong><span style="color: #ff6600;">(wgb24)</span></strong>\.<strong><span style="color: #ff0000;">(net)</span></strong> [NC]<br />
RewriteRule<span style="color: #99cc00;"> <strong><span style="color: #339966;">(.*)</span></strong> </span>http://<strong><span style="color: #ff6600;">%2</span></strong>.<strong><span style="color: #ff0000;">%3</span></strong>/<strong><span style="color: #ff9900;">%1</span></strong>/<strong><span style="color: #339966;">$1</span></strong>?%{QUERY_STRING}</p>
<p>Bis hierhin funktioniert das Beispiel für "gewerberaumboerse" problemlos. Als nächstes nutzen wir das mod_rewrite-Modul, um das Finetuning für die URL zu erreichen, damit auch die Umlaut-Variante richtig umgeschrieben wird:</p>
<pre class="brush: php;">
RewriteRule (xn--gewerberaumbrse-ktb) gewerberaumbörse [R=301]
</pre>
<p>Beim Umschreiben der Subdomain sind uns nämlich die Umlaute abhanden gekommen. Daher müssen wir den etwas "verstümmelten" Namen des Pfades wieder rekonstruieren..</p>
<img src="http://kodal.de/?ak_action=api_record_view&id=123&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=123</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smarty &#8211; Tips</title>
		<link>http://kodal.de/?p=115</link>
		<comments>http://kodal.de/?p=115#comments</comments>
		<pubDate>Wed, 10 Feb 2010 21:34:20 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[Smarty]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[arrays]]></category>
		<category><![CDATA[smarty template engine]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=115</guid>
		<description><![CDATA[Find some tricks on how to use Smarty effectively here.
Array handling in Smarty
Arrays are a bit tricky to handle in Smarty. But only at first glance! If you know your way around, it´s pretty easy to cope with them. Note that you can use virtually every native php-function by using modifiers, which allow you to [...]]]></description>
			<content:encoded><![CDATA[<p>Find some tricks on how to use Smarty effectively here.</p>
<h1>Array handling in Smarty</h1>
<p>Arrays are a bit tricky to handle in Smarty. But only at first glance! If you know your way around, it´s pretty easy to cope with them. Note that you can use virtually every native php-function by using modifiers, which allow you to use smarty as a smart wrapper for all php-functions:</p>
<h2>array_push</h2>
<p>let´s say you want to push the value &#8220;new&#8221; to an existing array named $offers. You can simply do so by using this term:</p>
<pre class="brush: jscript;">
{$offers|@array_push:&quot;new&quot;}
</pre>
<p>Note the @-identifier, which makes smarty process the given array as a whole, rather than iterating through each element of the array.</p>
<p>This approach has a disadvantage, though. After having executed array_push, the returning result will be piped to smarty and therefore we have an unwanted output of the function´s result.</p>
<p>We can simply avoid this by following this approach:</p>
<pre class="brush: jscript;">
{assign var=&quot;void&quot; value=$offers|@array_push:&quot;new&quot;}
</pre>
<p>By doing so, we are assigning the return value from array_push to a variable (named &#8220;void&#8221;). As a result, the return-value is being stored in a variable rather than leading to an unwanted output of the latter.</p>
<h2>in_array</h2>
<p>if you want to check whether a the given value &#8220;new&#8221; exists within a given $offers, try this:</p>
<pre class="brush: jscript;">
{&quot;new&quot;|in_array:$offers}
</pre>
<img src="http://kodal.de/?ak_action=api_record_view&id=115&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=115</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Springbreaks am 5. März im RAW</title>
		<link>http://kodal.de/?p=109</link>
		<comments>http://kodal.de/?p=109#comments</comments>
		<pubDate>Wed, 10 Feb 2010 16:38:56 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[Clubbing]]></category>
		<category><![CDATA[Flyer]]></category>
		<category><![CDATA[Indoor]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Club]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[Frühling]]></category>
		<category><![CDATA[Minimal]]></category>
		<category><![CDATA[Party]]></category>
		<category><![CDATA[Springbreaks]]></category>
		<category><![CDATA[Techhouse]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=109</guid>
		<description><![CDATA[
Flyer-Entwurf Springbreaks (A6 halb, 4/4)
]]></description>
			<content:encoded><![CDATA[<p><a href="http://pulsar.cc/dates/909"><img alt="" src="http://pulsar.cc/pix/springbreaks/springbreaks_3_animated.gif" title="Springbreaks on March 5th at RAW" class="aligncenter" width="400" height="150" /></a></p>
<p>Flyer-Entwurf Springbreaks (A6 halb, 4/4)</p>
<img src="http://kodal.de/?ak_action=api_record_view&id=109&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=109</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash AS3 Widget for Flowcharts / Graphs</title>
		<link>http://kodal.de/?p=90</link>
		<comments>http://kodal.de/?p=90#comments</comments>
		<pubDate>Sat, 30 Jan 2010 17:18:55 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[flash/flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[draw]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flowchart]]></category>
		<category><![CDATA[gradient]]></category>
		<category><![CDATA[object-oriented]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=90</guid>
		<description><![CDATA[I am willing to grant you a first little insight into my actionscript (AS3) poison cabinet today.  

/* ----------------------------------------------------- */
/* coding: timor kodal [pulsar-network]					 */
/* copyright by: (c) 2010 timor kodal				     */
/* ----------------------------------------------------- */
/* contact: [http://pulsar.cc &#124; timor [at] kodal.de      */
/* ----------------------------------------------------- */
/* to see [...]]]></description>
			<content:encoded><![CDATA[<p>I am willing to grant you a first little insight into my actionscript (AS3) poison cabinet today. <img src='http://kodal.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre class="brush: jscript;">
/* ----------------------------------------------------- */
/* coding: timor kodal [pulsar-network]					 */
/* copyright by: (c) 2010 timor kodal				     */
/* ----------------------------------------------------- */
/* contact: [http://pulsar.cc | timor [at] kodal.de      */
/* ----------------------------------------------------- */
/* to see this and other scripts in action, please visit */
/* http://pulsar.cc										 */
/* ----------------------------------------------------- */
/* you are free to use my scripts 					     */
/* according to the creative commons licence cc-nc-by    */
/* ----------------------------------------------------- */
/* more information: http://creativecommons.org          */
/* ----------------------------------------------------- */

package pflash.widget
{
	import flash.display.*;
	import flash.events.Event;
	import flash.geom.*;
	import flash.text.TextField;
	import flash.text.TextFormat;

	public class Flowchart extends MovieClip {

		public var data : Object;
		public var graph : Array;
		public var range : Object;
		public var colors : Array;

		public var captionDuration = 400;
		public var captionPosition : String = &quot;final&quot;;

		public var mcGrid : MovieClip;
		public var mcStats : MovieClip;

		public var w : Number = 200;
		public var h : Number = 80;

		public var invertX : Boolean = false;
		public var invertY : Boolean = true;

		public var dateX : Boolean = false;
		public var dateY : Boolean = false;

		public var intervalX : Number = 5;
		public var intervalY : Number = 5;
		public var highlightX : Number = 4;
		public var highlightY : Number = 4;
		public var meterX : Number = 1;
		public var meterY : Number = 1;

		public var textFormat : TextFormat = null;

		/* CONSTRUCTOR */
		public function Flowchart (data = false) {
			this.data = new Object();
			this.graph = new Array();
			this.range = new Object();
			this.colors = new Array();
			this.colors['default'] = [uint(0xff8888),uint(0x44ff44)];
			this.colors['gridX'] = uint(0x888888);
			this.colors['gridY'] = uint(0x888888);
			this.colors['meterX'] = uint(0x444444);
			this.colors['meterY'] = uint(0x444444);

			if (data)
				this.importArray(data);
		}
		public function createGradient(colors,alphas:Array = null,ratios:Array = null):Object {
			var gradient = new Object();
			gradient.colors = colors;
			if (alphas)
				gradient.alphas = alphas;
			else
				gradient.alphas = [0.6,0.2];
			if (ratios)
				gradient.ratios = ratios;
			else
				gradient.ratios = [0x00,0xff];
			return gradient;
		}

		private function drawStats (): Sprite {
			var stats = new Sprite();
			var dots = new Sprite();
			stats.addChild(dots);
			var realx;
			var point:Point;
			var nextPoint:Point;
			var color;
			var x1,x2,y1,y2: Number;
			var first = new Array();
			var last = new Array();
			var typecount = 0;
			var that = this;
			for (var type in this.graph) {
				if (this.colors[type]) {
					color = this.colors[type];
				} else if (typeof this.colors['default']==&quot;number&quot;) {
					color = this.colors['default'];
				} else if (this.colors['default'][typecount%this.colors['default'].length]) {
					color = this.colors['default'][typecount%this.colors['default'].length];
				}
				var label = new MovieClip();
				if (typeof(color)==&quot;object&quot;) {
					stats.graphics.lineStyle(2,color.colors[0],0.8);
					dots.graphics.lineStyle(2,color.colors[0],1);
					label.graphics.beginFill(this.colors[type].colors[0]);
					if (!color.matrix) {
						color.matrix = new Matrix();
						color.matrix.createGradientBox(this.h,80,Math.PI / 2,10,0);
					}
					stats.graphics.beginGradientFill(GradientType.LINEAR, color.colors, color.alphas, color.ratios, color.matrix, SpreadMethod.PAD);
				} else {
					stats.graphics.lineStyle(2,color,0.8);
					dots.graphics.lineStyle(2,color,1);
	 			    stats.graphics.beginFill(color,0.4);
					label.graphics.beginFill(color,0.8);
				}
				for (var x in this.graph[type]) {
					point = this.graph[type][x];
					x1 = (point.x-this.range.minx)/(this.range.maxx-this.range.minx)*this.w;
					if (this.invertX)
						x1 = this.w-x1;
					y1 = (point.y-this.range.miny)/(this.range.maxy-this.range.miny)*this.h;
					if (this.invertY)
						y1 = this.h-y1;
					if (!first[type]) {
						first[type] = new Point(x1,y1);
						stats.graphics.moveTo(x1,y1);
					}
					stats.graphics.lineTo(x1,y1);
					dots.graphics.drawCircle(x1,y1,1);
					if (this.graph[type][x+1]) {
						nextPoint = this.graph[type][x+1];
						trace(Math.floor(x1)+&quot;x&quot;+Math.floor(y1)+&quot;:&quot;+Math.floor(x2)+&quot;x&quot;+Math.floor(y2));
					} else {
						nextPoint = new Point(point.x,this.range.miny);

						if (that.captionDuration!==&quot;permanent&quot;) {
							label.addEventListener(Event.ENTER_FRAME,labelView);
							var count = 0;
							function labelView(e: Event) {
								count++;
								if (count&gt;that.captionDuration)
									e.target.alpha/=1.1;
							}
						}

						var textfield = new TextField();
						textfield.htmlText = &quot;&lt;font face='Helvetica,Verdana,Arial' color='#000000' size='7px'&gt;&quot;+type+&quot;&lt;/font&gt;&quot;;
						textfield.selectable = false;

						label.graphics.drawRect(0, 2, textfield.textWidth+3,textfield.textHeight);
						label.graphics.endFill();

						if (this.captionPosition==&quot;final&quot;) {
							label.y=y1-5;
							label.x=x1+5;
						} else {
							label.y=0+typecount*(textfield.textHeight+1);
							label.x=this.w+5;
						}

						if (label.x+textfield.textWidth&gt;this.w-10)
							label.x-=textfield.textWidth+12;

						label.addChild(textfield);

						label.alpha=0.8;
						stats.addChild(label);

					}
					x2 = (nextPoint.x-this.range.minx)/(this.range.maxx-this.range.minx)*this.w;
					if (this.invertX)
						x2 = this.w-x2;
					y2 = (nextPoint.y-this.range.miny)/(this.range.maxy-this.range.miny)*this.h;
					if (this.invertY)
						y2 = this.h-y2;
					stats.graphics.lineTo(x2,y2);
					last[type]=new Point(x2,y2);
				}
				stats.graphics.lineTo(last[type].x,this.h);
				stats.graphics.lineTo(first[type].x,this.h);
				stats.graphics.endFill();
				typecount++;
			}
			return stats;
		}
		private function drawGrid (data = false): Sprite {
			if (data)
				this.importArray(data);
			var grid = new Sprite();
			var labels = new MovieClip();
			if (this.intervalX&lt;2)
				this.intervalX=2;
			if (this.intervalY&lt;2)
				this.intervalY=2;
			var realx;
			var realy;
			for (var x=0;x&lt;=this.w;x+=this.intervalX) {
				realx = x;
				if (!this.invertX)
					realx = this.w-x;
				if (realx/this.intervalX%this.highlightX==0) {
					grid.graphics.lineStyle(1,this.colors['gridX']);

					var num = Math.floor((this.w-x)/this.w*(this.range.maxx-this.range.minx)+this.range.minx);
					var tfcontainer = new MovieClip();
					var textfield = new TextField();

					if (this.dateX) {
						var d = new Date(num*1000);
					 	num = Number(d.getMonth()+1)+&quot; &quot;+d.getFullYear();
					}

					if (this.textFormat) {
						textfield.defaultTextFormat = this.textFormat;
						textfield.embedFonts = true;
						textfield.text = num;
						textfield.rotation=90;
					} else {
						textfield.htmlText = &quot;&lt;font family='Helvetica, Verdana, Arial' size='7px' color='#ffffff'&gt;&quot;+num+&quot;&lt;/font&gt;&quot;;
					}

					//textfield.text = num;
					textfield.selectable = false;
					tfcontainer.addChild(textfield);
					tfcontainer.y=this.h;
					tfcontainer.x=realx+textfield.textHeight/2+2;

					labels.addChild(tfcontainer);
				} else
					grid.graphics.lineStyle(1,this.colors['gridX'],0.5);
				grid.graphics.moveTo(realx,0);
				grid.graphics.lineTo(realx,this.h);
			}
			for (var y=0;y&lt;=this.h;y+=this.intervalY) {
				realy = y;
				if (this.invertY)
					realy = this.h-y;
				if (realy/this.intervalY%this.highlightY==0) {
					grid.graphics.lineStyle(1,this.colors['gridY']);

					var num = Math.floor(y/this.h*(this.range.maxy-this.range.miny)+this.range.miny);
					var textfield = new TextField();

					if (this.dateY) {
						var d = new Date(num*1000);
					 	num = Number(d.getMonth()+1)+&quot; &quot;+d.getFullYear();
					}

					if (this.textFormat) {
						textfield.defaultTextFormat = this.textFormat;
						textfield.embedFonts = true;
						textfield.text = num;
					} else {
						textfield.htmlText = &quot;&lt;font face='Arial' family='Helvetica, Verdana, Arial' size='7px' color='#ffffff'&gt;&quot;+num+&quot;&lt;/font&gt;&quot;;
					}

					textfield.selectable = false;
					textfield.y=realy-textfield.textHeight/2-2;
					textfield.x=this.w+2;

					labels.addChild(textfield);
				} else
					grid.graphics.lineStyle(1,this.colors['gridY'],0.5);

				grid.graphics.moveTo(0,realy);
				grid.graphics.lineTo(this.w,realy);
			}
			grid.addChild(labels);
			grid.alpha=0.5;
			return grid;
		}
		public function draw (data = false) {
			if (data)
				this.importArray(data);

			var mc = new MovieClip();
			mc.addChild(this.drawGrid());
			mc.addChild(this.drawStats());

			mc.x=0;
			mc.y=0;

			this.addChild(mc);
		}
		public function importArray (data) {
			this.data = data;
			this.graph = new Array();
			var buf;
			var y; /* y-value */
			var x; /* x-value */
			var t; /* type */
			var point:Point;

			for(var t in this.data) {
				if (!this.graph[t])
					this.graph[t] = new Array();

				var keys : Array = [];
				for( var key : String in this.data[t] ) keys.push( key );
				keys.sort();

				for(var key in keys) {
					x=keys[key];
					y=this.data[t][x];
					this.graph[t].push(new Point(x,y));
					if (!this.range.hasOwnProperty('minx') || x&lt;this.range['minx'])
						this.range.minx=Number(x);
					if (!this.range.hasOwnProperty('maxx') || x&gt;this.range['maxx'])
						this.range.maxx=Number(x);
					if (!this.range.hasOwnProperty('miny') || y&lt;this.range['miny'])
						this.range.miny=Number(y);
					if (!this.range.hasOwnProperty('maxy') || y&gt;this.range['maxy'])
						this.range.maxy=Number(y);
					trace(&quot;statistics (&quot;+this.graph[t].length+&quot;): &quot;+t+&quot; :&quot;+x+&quot;/&quot;+y);

				}
			}
			trace(this.range.minx+&quot; &quot;+this.range.maxx+&quot;/&quot;+this.range.miny+&quot; &quot;+this.range.maxy);

		}

		public function importObjects (data) {
			this.data = data;
			this.graph = new Array();
			var buf;
			var y; /* y-value */
			var x; /* x-value */
			var t; /* type */
			var point:Point;

			for(var t in this.data) {
				if (!this.graph[t])
					this.graph[t] = new Array();

				for(var key in this.data[t]) {
					x=this.data[t][key].x;
					y=this.data[t][key].y;
					this.graph[t].push(new Point(x,y));
					if (!this.range.hasOwnProperty('minx') || x&lt;this.range['minx'])
						this.range.minx=Number(x);
					if (!this.range.hasOwnProperty('maxx') || x&gt;this.range['maxx'])
						this.range.maxx=Number(x);
					if (!this.range.hasOwnProperty('miny') || y&lt;this.range['miny'])
						this.range.miny=Number(y);
					if (!this.range.hasOwnProperty('maxy') || y&gt;this.range['maxy'])
						this.range.maxy=Number(y);
					trace(&quot;statistics (&quot;+this.graph[t].length+&quot;): &quot;+t+&quot; :&quot;+x+&quot;/&quot;+y);

				}
			}
			trace(this.range.minx+&quot; &quot;+this.range.maxx+&quot;/&quot;+this.range.miny+&quot; &quot;+this.range.maxy);

		}

	}

}
</pre>
<p>Example:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" id="flowChart[0]" width="480" height="200" align="middle"><br />
<PARAM NAME=wmode VALUE=transparent><param name="allowScriptAccess" value="always" /><param wmode=transparent name="movie" value="http://pulsar.cc/swf/flowChart.swf?channel=total_interactions" /><param name="quality" value="high" /><embed src="http://pulsar.cc/swf/flowChart.swf?channel=total_interactions" quality="high"  wmode="transparent" width="480" height="200" swLiveConnect=true id="flowChart[0]" name="flowChart[0]" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer_de" /><br />
</object></p>
<p>feel free to <a href='http://kodal.de/wp-content/uploads/code/Flowchart.as'>download the flowchart-widget</a></p>
<img src="http://kodal.de/?ak_action=api_record_view&id=90&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=90</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pulsar proudly presents an Mp3-Player</title>
		<link>http://kodal.de/?p=40</link>
		<comments>http://kodal.de/?p=40#comments</comments>
		<pubDate>Sat, 30 Jan 2010 14:31:42 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[flash/flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[electronic]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[Netaudio]]></category>
		<category><![CDATA[techno]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=40</guid>
		<description><![CDATA[Seit dem Jahreswechsel ist auf der non-kommerziellen Netaudioplattform Pulsar ( http://pulsar.cc ) ein selbstentwickelter (Netaudio)Mp3-Player integriert, der auf ActionScript3 basiert, und nach langer Flash-Abstinenz auch gleichzeitig meine erste Flash-Entwicklung nach fast 5 Jahren darstellt.
Since New Year´s, you can find an embedded (netaudio)-mp3-player on my netlabel Pulsar ( http://pulsar.cc ). After more than 5 years pause [...]]]></description>
			<content:encoded><![CDATA[<p>Seit dem Jahreswechsel ist auf der non-kommerziellen Netaudioplattform Pulsar ( http://pulsar.cc ) ein selbstentwickelter (Netaudio)Mp3-Player integriert, der auf ActionScript3 basiert, und nach langer Flash-Abstinenz auch gleichzeitig meine erste Flash-Entwicklung nach fast 5 Jahren darstellt.</p>
<p>Since New Year´s, you can find an embedded (netaudio)-mp3-player on my netlabel Pulsar ( http://pulsar.cc ). After more than 5 years pause from developing flash-projects, this is also my first actionscript3-tool I have built.</p>
<p><iframe src='http://pulsar.cc/mp3player.php?artist=1' width='500' height='300' style='border: 0px;'></iframe></p>
<img src="http://kodal.de/?ak_action=api_record_view&id=40&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=40</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using PHP for shell-scripting</title>
		<link>http://kodal.de/?p=41</link>
		<comments>http://kodal.de/?p=41#comments</comments>
		<pubDate>Sat, 30 Jan 2010 12:08:27 +0000</pubDate>
		<dc:creator>teamore</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[argc]]></category>
		<category><![CDATA[argument]]></category>
		<category><![CDATA[argv]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[parseArguments]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://kodal.de/?p=41</guid>
		<description><![CDATA[This class is a first step to a comprehensive, and yet handy little collection of helper-functions, which can ease your way along while using php for shell-scripts.
Whereas most of you probably use php as a scripting-language for websites, it´s also a very good alternative to other shell-scripting languages like perl or python. In fact, I [...]]]></description>
			<content:encoded><![CDATA[<p>This class is a first step to a comprehensive, and yet handy little collection of helper-functions, which can ease your way along while using php for shell-scripts.</p>
<p>Whereas most of you probably use php as a scripting-language for websites, it´s also a very good alternative to other shell-scripting languages like perl or python. In fact, I find it a lot more useful than regular shell-scripts.</p>
<p>This little class can be used both as a static collection of shell-methods, but you can also create instances of it.</p>
<p>So far, it automatically parses any userparams coming from the commandline, and stores them in a publicly available array named self::$arguments.</p>
<p>More features are to be added soon <img src='http://kodal.de/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: php;">
&lt;?
	/* ----------------------------------------------------- */
	/* coding: timor kodal [pulsar-network]					 */
	/* copyright by: (c) 2010 timor kodal				     */
	/* ----------------------------------------------------- */
	/* contact: [http://pulsar.cc | timor [at] kodal.de      */
	/* ----------------------------------------------------- */
	/* to see this and other scripts in action, please visit */
	/* http://pulsar.cc										 */
	/* ----------------------------------------------------- */
	/* you are free to use my scripts 					     */
	/* according to the creative commons licence cc-nc-by    */
	/* ----------------------------------------------------- */
	/* more information: http://creativecommons.org          */
	/* ----------------------------------------------------- */

     class shell {
		public $arguments;
		public $defaults;
		public $aliases;
		function __construct (Array $args = NULL,Array $aliases = NULL,Array $defaults = NULL) {
			$this-&gt;aliases = $aliases;
			$this-&gt;defaults = $defaults;
			$this-&gt;arguments = self::parseArguments($args,$aliases,$defaults);
		}
		public function getArgs(Array $defaults = NULL) {
			$args = $this-&gt;arguments;
			if ($defaults) {
				foreach ($defaults as $k=&gt;$v) {
					if (!isset($args[$k]))
						$args[$k]=$v;
					if (!isset($args[$this-&gt;aliases[$k]]) &amp;&amp; $this-&gt;aliases[$k])
						$args[$this-&gt;aliases[$k]]=$v;
				}
			}
			return $args;
		}
		public static function parseArguments (Array $args = NULL, Array $aliases = NULL,Array $defaults = NULL) {
			global $argv;
			if (!$aliases)
				$aliases = Array (&quot;u&quot;=&gt;&quot;user&quot;);
			if (!$args)
				$args=$argv;

			$arguments = Array();
			$count = 0;

			// -u=1
			// -u test
			// --user=1
			if (is_array($defaults)) {
				foreach ($defaults as $k=&gt;$v) {
					$arguments[$k]=$v;
					if ($aliases[$k])
						$arguments[$aliases[$k]]=$v;
				}
			}

			foreach ($args as $k=&gt;$v) {
				$pattern = &quot;/\-{1,2}([a-z]+)=(.*)/&quot;;
				preg_match($pattern,$v,$matches);
				if ($matches[0]) {
					$arguments[$matches[1]]=$matches[2];
					if ($aliases[$matches[1]])
						$arguments[$aliases[$matches[1]]]=$matches[2];
				} else
					$arguments[]=$v;
			}
			return $arguments;
		}
	}

?&gt;
</pre>
<p>download <a href='http://kodal.de/wp-content/uploads/code/class.shell.php'>class.shell.php</a></p>
<p>Example:</p>
<pre class="brush: php;">&lt;?
 require_once(&quot;class.shell.php&quot;);
 $aliases = Array(&quot;u&quot;=&gt;&quot;uid&quot;,&quot;d&quot;=&gt;&quot;default&quot;);

 $shell = new shell(NULL,$aliases,Array(&quot;u&quot;=&gt;&quot;root&quot;));

 print_r($shell-&gt;getArgs(Array(&quot;d&quot;=&gt;&quot;yes&quot;)));

// php5 example.shell.php -user=teamore

// output:

// Array
// (
// [u] =&gt; root
// [uid] =&gt; root
// [0] =&gt; initprocmail.php
// [user] =&gt; teamore
// [d] =&gt; yes
// [default] =&gt; yes
// )

?&gt;</pre>
<p>download <a href='http://kodal.de/wp-content/uploads/code/example.shell.php'>example.shell.php</pre>
<img src="http://kodal.de/?ak_action=api_record_view&id=41&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://kodal.de/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
