<?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; as3</title>
	<atom:link href="http://schnipsel.davidhellmann.com/tag/as3/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>
	</channel>
</rss>

