<?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>Schnipsel - Code Schnipsel (Snippets) zu Wordpress, PHP, HTML, CSS, jQuery &#187; Actionscript</title>
	<atom:link href="http://schnipsel.davidhellmann.com/tag/actionscript/feed" rel="self" type="application/rss+xml" />
	<link>http://schnipsel.davidhellmann.com</link>
	<description>Code Schnipsel (Snippets) zu Wordpress, PHP, HTML, CSS, jQuery</description>
	<lastBuildDate>Tue, 08 Mar 2011 00:20:33 +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>AS3 eigene Events</title>
		<link>http://schnipsel.davidhellmann.com/actionscript/as3-eigene-events/61</link>
		<comments>http://schnipsel.davidhellmann.com/actionscript/as3-eigene-events/61#comments</comments>
		<pubDate>Mon, 13 Jul 2009 19:27:34 +0000</pubDate>
		<dc:creator>Thomas Aull</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=61</guid>
		<description><![CDATA[Wenn die normalen Events von AS3 nicht ausreichen, kann man sich auch eigene schreiben. Wie das geht erkl&#228;re ich in meinem Blog, die Klasse f&#252;r eigene Events gibts auch hier: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 &#160; package &#123; // Import [...]]]></description>
			<content:encoded><![CDATA[<p>Wenn die normalen Events von AS3 nicht ausreichen, kann man sich auch eigene schreiben. Wie das geht erkl&#228;re ich in meinem <a href="http://www.thomas-aull.de/2009/07/as3-eigene-events-verwenden/">Blog</a>, die Klasse f&#252;r eigene Events gibts auch hier:</p>
<span id="more-61"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
        <span style="color: #009900; font-style: italic;">// Import der Flash Eventklasse</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MeinEvent <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">Event</span> <span style="color: #000000;">&#123;</span>
&nbsp;
                <span style="color: #009900; font-style: italic;">// Eventarten, bekanntes Beispiel: MouseEvent.CLICK</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static const MEIN_EREIGNIS<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;MEIN_EREIGNIS&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
                <span style="color: #009900; font-style: italic;">// Variable in denen wir zusätzliche Eventdaten speichern können</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
                <span style="color: #009900; font-style: italic;">// Der Konstruktor</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MeinEvent<span style="color: #000000;">&#40;</span><span style="color: #004993;">type</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">type</span><span style="color: #000000;">&#41;</span><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><span style="color: #004993;">data</span> = <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>




<p>Und anschlie&#223;end noch <b>EventListener</b> und <b>Dispatcher</b>:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">&nbsp;
<span style="color: #009900; font-style: italic;">// EventListener</span>
<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>MeinEvent<span style="color: #000066; font-weight: bold;">.</span>MEIN_EREIGNIS<span style="color: #000066; font-weight: bold;">,</span> machWas<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">// Dispatcher mit Eventdaten füttern...</span>
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">name</span> = <span style="color: #990000;">&quot;Max Mustermann&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>alter = <span style="color: #000000; font-weight:bold;">21</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">// ...und abfeuern</span>
<span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> MeinEvent<span style="color: #000000;">&#40;</span>MeinEvent<span style="color: #000066; font-weight: bold;">.</span>MEIN_EREIGNIS<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">data</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;">// Eventfunktion: Daten auslesen</span>
<span style="color: #339966; font-weight: bold;">function</span> machWas<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span>MeinEvent<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</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: #004993;">trace</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">.</span>alter<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/actionscript/as3-eigene-events/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AS3 FlashVars auslesen</title>
		<link>http://schnipsel.davidhellmann.com/actionscript/as3-flashvars-auslesen/60</link>
		<comments>http://schnipsel.davidhellmann.com/actionscript/as3-flashvars-auslesen/60#comments</comments>
		<pubDate>Sun, 14 Jun 2009 22:06:43 +0000</pubDate>
		<dc:creator>Thomas Aull</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=60</guid>
		<description><![CDATA[Beim Einbetten eines Flash-Films hat man die M&#246;glichkeit Variablen zu hinterlegen, die dann im Flashfilm weiterverwendet werden k&#246;nnen. Mit ActionScript 3 hat sich das Auslesen etwas ge&#228;ndert, an die Variablen kommt man jetzt so: 1 var pfad = root.loaderInfo.parameters.pfad;]]></description>
			<content:encoded><![CDATA[<p>Beim Einbetten eines Flash-Films hat man die M&#246;glichkeit Variablen zu hinterlegen, die dann im Flashfilm weiterverwendet werden k&#246;nnen. Mit ActionScript 3 hat sich das Auslesen etwas ge&#228;ndert, an die Variablen kommt man jetzt so:</p>
<span id="more-60"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> pfad = <span style="color: #004993;">root</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">loaderInfo</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">parameters</span><span style="color: #000066; font-weight: bold;">.</span>pfad<span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/actionscript/as3-flashvars-auslesen/60/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>AS3 MouseEvents</title>
		<link>http://schnipsel.davidhellmann.com/actionscript/as3-mouseevents/56</link>
		<comments>http://schnipsel.davidhellmann.com/actionscript/as3-mouseevents/56#comments</comments>
		<pubDate>Tue, 02 Jun 2009 09:55:42 +0000</pubDate>
		<dc:creator>Marvin</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[MouseEvents]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=56</guid>
		<description><![CDATA[Einfache MouseEvents wie CLICK haben sich im Gegensatz zu AS2 ein wenig ge&#228;ndert. Hier seht ihr die "neuen" EventListener... 1 2 3 4 5 Elementname.addEventListener&#40;MouseEvent.CLICK, Funktionsname&#41;; &#160; function Funktionsname &#40;evt:MouseEvent&#41; &#123; // Tuhe dies &#125; oder 1 2 3 4 5 Elementname.addEventListener&#40;MouseEvent.CLICK, &#160; function &#40;evt:MouseEvent&#41; &#123; // Tuhe das &#125;&#41;; Anstelle von CLICK kann man [...]]]></description>
			<content:encoded><![CDATA[<p>Einfache MouseEvents wie <code>CLICK</code> haben sich im Gegensatz zu AS2 ein wenig ge&#228;ndert. Hier seht ihr die "neuen" EventListener...</p>
<span id="more-56"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">Elementname<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> Funktionsname<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> Funktionsname <span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #009900; font-style: italic;">// Tuhe dies</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>



<p>oder</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;">Elementname<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> 
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> <span style="color: #000000;">&#40;</span>evt<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #009900; font-style: italic;">// Tuhe das</span>
<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></td></tr></table></div>



<p>Anstelle von <code>CLICK</code> kann man nat&#252;rlich auch alle anderen MouseEvents aufrufen, wie z.B. <code>ROLL_OVER</code> und <code>ROLL_OUT</code>]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/actionscript/as3-mouseevents/56/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AS3 Klassenger&#252;st</title>
		<link>http://schnipsel.davidhellmann.com/actionscript/as3-klassengeruest/39</link>
		<comments>http://schnipsel.davidhellmann.com/actionscript/as3-klassengeruest/39#comments</comments>
		<pubDate>Thu, 14 May 2009 15:17:46 +0000</pubDate>
		<dc:creator>Thomas Aull</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://schnipsel.davidhellmann.com/?p=39</guid>
		<description><![CDATA[Um innerhalb gr&#246;&#223;erer Projekte eine gewisse Konsistenz in den Klassendateien zu halten, macht es Sinn sich eine Vorlage zu basteln, die f&#252;r jede neue Klasse als Startpunkt dient. Das ist meine: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 [...]]]></description>
			<content:encoded><![CDATA[<p>Um innerhalb gr&#246;&#223;erer Projekte eine gewisse Konsistenz in den Klassendateien zu halten, macht es Sinn sich eine Vorlage zu basteln, die f&#252;r jede neue Klasse als Startpunkt dient. Das ist meine:</p>

<span id="more-39"></span>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> classes <span style="color: #000000;">&#123;</span>
 
	<span style="color: #009900; font-style: italic;">// --------------------------- //</span>
	<span style="color: #009900; font-style: italic;">//  IMPORT BENÖTIGTER KLASSEN  //</span>
	<span style="color: #009900; font-style: italic;">// --------------------------- //</span>
	<span style="color: #009900; font-style: italic;">// Flash Klassen</span>
 
	<span style="color: #009900; font-style: italic;">// 3rd Party Klassen</span>
 
	<span style="color: #009900; font-style: italic;">// Eigene Klassen</span>
 
 
 
	<span style="color: #009900; font-style: italic;">// --------------------- //</span>
	<span style="color: #009900; font-style: italic;">//  KLASSENNAME          //</span>
	<span style="color: #009900; font-style: italic;">//  Klassenbeschreibung  //</span>
	<span style="color: #009900; font-style: italic;">// --------------------- //</span>
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> MeineKLasse <span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">// ----------- //</span>
		<span style="color: #009900; font-style: italic;">//  VARIABLEN  //</span>
		<span style="color: #009900; font-style: italic;">// ----------- //</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">// Public</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">// Private</span>
&nbsp;
&nbsp;
 		
		<span style="color: #009900; font-style: italic;">// ------------- //</span>
		<span style="color: #009900; font-style: italic;">//  KONSTRUKTOR  //</span>
		<span style="color: #009900; font-style: italic;">// ------------- //		</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> MeineKlasse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>			
		<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
 
 
 
		<span style="color: #009900; font-style: italic;">// ----------------------------- //</span>
		<span style="color: #009900; font-style: italic;">//  FUNKTIONSNAME                //</span>
		<span style="color: #009900; font-style: italic;">//  kurze Funktionsbeschreibung  //</span>
		<span style="color: #009900; font-style: italic;">// ----------------------------- //		</span>
 
		<span style="color: #009900; font-style: italic;">// weitere Funktionsbeschreibungen kommen dann hierhin		</span>
 
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> meineFunktion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>			
		<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span>
 
 
 
	<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// Ende der Klasse</span>
<span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// Ende des Package</span></pre></td></tr></table></div>


]]></content:encoded>
			<wfw:commentRss>http://schnipsel.davidhellmann.com/actionscript/as3-klassengeruest/39/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

