<?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>i-Ray</title>
	<atom:link href="http://www.i-ray.nl/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.i-ray.nl/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 12 Jan 2011 09:09:09 +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>as3 Hyperlink text Event</title>
		<link>http://www.i-ray.nl/blog/scripts/as3-hyperlink-text-event/</link>
		<comments>http://www.i-ray.nl/blog/scripts/as3-hyperlink-text-event/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 14:24:35 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[scripts]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[hyperlink]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[textfield]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=110</guid>
		<description><![CDATA[A new code snipped of how to use a hyperlink text event, aka fire a function with a html hyperlink:

// create textfield
var testTxt6:TextField = new TextField&#40;&#41;;  
testTxt6.x = 100;        
testTxt6.y = 220;
testTxt6.autoSize = &#34;left&#34;;
testTxt6.name = 'contentTxt';
testTxt6.border = true;
testTxt6 = testTxt6;
&#160;
// use the href event: link
testTxt6.htmlText = '&#60;a [...]]]></description>
			<content:encoded><![CDATA[<p>A new code snipped of how to use a <strong>hyperlink</strong> text event, aka fire a function with a html hyperlink:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// create textfield</span>
<span style="color: #000000; font-weight: bold;">var</span> testTxt6:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;  
testTxt6.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">100</span>;        
testTxt6.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">220</span>;
testTxt6.<span style="color: #0066CC;">autoSize</span> = <span style="color: #ff0000;">&quot;left&quot;</span>;
testTxt6.<span style="color: #0066CC;">name</span> = <span style="color: #ff0000;">'contentTxt'</span>;
testTxt6.<span style="color: #0066CC;">border</span> = <span style="color: #000000; font-weight: bold;">true</span>;
testTxt6 = testTxt6;
&nbsp;
<span style="color: #808080; font-style: italic;">// use the href event: link</span>
testTxt6.<span style="color: #0066CC;">htmlText</span> = <span style="color: #ff0000;">'&lt;a href=&quot;event:kickMe&quot;&gt;kickMe&lt;/a&gt;'</span>;
myStage.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>testTxt6<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create a listener</span>
testTxt6.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TextEvent.<span style="color: #006600;">LINK</span>, onHyperLinkEvent<span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> onHyperLinkEvent<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:TextEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
 <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">text</span> == <span style="color: #ff0000;">&quot;kickMe&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;hey that hurts&quot;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;ty your nice&quot;</span><span style="color: #66cc66;">&#41;</span>;
 <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/scripts/as3-hyperlink-text-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alternative for Key.isDown() in actionscript 3.0</title>
		<link>http://www.i-ray.nl/blog/scripts/key_isdown_as3/</link>
		<comments>http://www.i-ray.nl/blog/scripts/key_isdown_as3/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 21:42:39 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[scripts]]></category>
		<category><![CDATA[actionscript 3.0]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[listener]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=96</guid>
		<description><![CDATA[As 3.0 can be a pain sometimes if your used to as 2.0. Just like the case when you wanna use the easy Key.isDown function from the old actionscript 2.0
Here&#8217;s a little script to get the key.IsDown() effect with actionscript 3.0:

// create keyboard listeners
addEventListener&#40;KeyboardEvent.KEY_DOWN, keyPressed&#41;;
addEventListener&#40;KeyboardEvent.KEY_UP, keyReleased&#41;;
&#160;
// create an object to check witch key is down
var [...]]]></description>
			<content:encoded><![CDATA[<p>As 3.0 can be a pain sometimes if your used to as 2.0. Just like the case when you wanna use the easy Key.isDown function from the old actionscript 2.0</p>
<p>Here&#8217;s a little script to get the <strong>key.IsDown()</strong> effect with actionscript 3.0:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// create keyboard listeners</span>
addEventListener<span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_DOWN</span>, keyPressed<span style="color: #66cc66;">&#41;</span>;
addEventListener<span style="color: #66cc66;">&#40;</span>KeyboardEvent.<span style="color: #006600;">KEY_UP</span>, keyReleased<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create an object to check witch key is down</span>
<span style="color: #000000; font-weight: bold;">var</span> keyIsDown:<span style="color: #0066CC;">Object</span>;
keyIsDown = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Object</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> keyPressed<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:KeyboardEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">//I wanna check for the a and the ctr key / keyCodes: ctrl = 17, a = 65</span>
    keyIsDown<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">keyCode</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">true</span>;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>keyIsDown<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">17</span><span style="color: #66cc66;">&#93;</span>==<span style="color: #000000; font-weight: bold;">true</span> <span style="color: #66cc66;">&amp;&amp;</span> keyIsDown<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">65</span><span style="color: #66cc66;">&#93;</span>==<span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Acces granted'</span><span style="color: #66cc66;">&#41;</span>;
   <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> keyReleased<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:KeyboardEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
    keyIsDown<span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">e</span>.<span style="color: #006600;">keyCode</span><span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">false</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/scripts/key_isdown_as3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embed font in Flash cs3 / cs4 with As 3.0</title>
		<link>http://www.i-ray.nl/blog/tutorials/embed-font-in-flash-cs3-cs4-with-as-3-0/</link>
		<comments>http://www.i-ray.nl/blog/tutorials/embed-font-in-flash-cs3-cs4-with-as-3-0/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 16:16:32 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[addChild]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[htmlText]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[textfield]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=78</guid>
		<description><![CDATA[In this tutorial I&#8217;ll show you how to embed a font in your flash with Flash cs3 / cs4 and actionscript 3.0
Well there multiple tutials to find on the net on how to do this. But some of them don&#8217;t seem to work with flash cs3. So here I&#8217;ll show you the way how to [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I&#8217;ll show you how to embed a font in your flash with Flash cs3 / cs4 and actionscript 3.0</p>
<p>Well there multiple tutials to find on the net on how to do this. But some of them don&#8217;t seem to work with flash cs3. So here I&#8217;ll show you the way how to get it to work.</p>
<p>In the library press the marked aerea and press new font.</p>
<div id="attachment_79" class="wp-caption alignnone" style="width: 533px"><img class="size-full wp-image-79" title="library button" src="http://www.i-ray.nl/blog/wp-content/uploads/2009/12/library-button.jpg" alt="Library button" width="523" height="258" /><p class="wp-caption-text">Library button</p></div>
<p>Choose the you font from the list and enter a size &amp; name it.</p>
<div id="attachment_81" class="wp-caption alignnone" style="width: 438px"><img class="size-full wp-image-81" title="properties_font2" src="http://www.i-ray.nl/blog/wp-content/uploads/2009/12/properties_font2.jpg" alt="font properties window" width="428" height="158" /><p class="wp-caption-text">font properties window</p></div>
<p>now rightclick the font and press linkage and check &#8220;export for actionscript&#8221;, make up some name and press ok.</p>
<div id="attachment_83" class="wp-caption alignnone" style="width: 264px"><img class="size-full wp-image-83" title="linkage3" src="http://www.i-ray.nl/blog/wp-content/uploads/2009/12/linkage3.jpg" alt="properties menu from the library" width="254" height="226" /><p class="wp-caption-text">properties menu from the library</p></div>
<div id="attachment_82" class="wp-caption alignnone" style="width: 471px"><img class="size-full wp-image-82" title="linkage scherm4" src="http://www.i-ray.nl/blog/wp-content/uploads/2009/12/linkage-scherm4.jpg" alt="linkage options" width="461" height="244" /><p class="wp-caption-text">linkage options</p></div>
<p>Now we can create a textfield in our actionscript and embed the font to it, so we can use the antiAliasType settings and ofcourse everyone will be able to see our embedded font.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> ArialFont:<span style="color: #0066CC;">Font</span> = <span style="color: #000000; font-weight: bold;">new</span> myFont<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> myFormat:<span style="color: #0066CC;">TextFormat</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextFormat</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
myFormat.<span style="color: #0066CC;">font</span> = ArialFont.<span style="color: #006600;">fontName</span>;
<span style="color: #808080; font-style: italic;">//myFormat.font = ArialFont.fontName, ArialFontBold.fontName; // you can also add multiple embedded fonts like this</span>
myFormat.<span style="color: #0066CC;">size</span> = <span style="color: #cc66cc;">12</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create the textfield with the defaultTextformat property</span>
<span style="color: #808080; font-style: italic;">// It's also importand that the default TextFormat is defined before you add your text content</span>
<span style="color: #000000; font-weight: bold;">var</span> myTxt:<span style="color: #0066CC;">TextField</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">TextField</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
myTxt.<span style="color: #006600;">defaultTextFormat</span> = myFormat;
myTxt.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">300</span>;
myTxt.<span style="color: #006600;">antiAliasType</span> = AntiAliasType.<span style="color: #006600;">ADVANCED</span>;
myTxt.<span style="color: #0066CC;">embedFonts</span> = <span style="color: #000000; font-weight: bold;">true</span>;
myTxt.<span style="color: #0066CC;">border</span> = <span style="color: #000000; font-weight: bold;">true</span>;
myTxt.<span style="color: #0066CC;">background</span> = <span style="color: #000000; font-weight: bold;">true</span>;
myTxt.<span style="color: #0066CC;">htmlText</span> = <span style="color: #ff0000;">&quot;your content text&quot;</span>;
addChild<span style="color: #66cc66;">&#40;</span>myTxt<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>The source files can be downloaded <a href="http://www.i-ray.nl/tutorials/embedFont.fla"><u>here</u></a>:</p>
]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/tutorials/embed-font-in-flash-cs3-cs4-with-as-3-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Crossfading images tutorial actionscript 3.0</title>
		<link>http://www.i-ray.nl/blog/tutorials/crossfading-images-tutorial-actionscript-3-0/</link>
		<comments>http://www.i-ray.nl/blog/tutorials/crossfading-images-tutorial-actionscript-3-0/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 08:07:38 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[actionscript 3.0]]></category>
		<category><![CDATA[crossfade]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=51</guid>
		<description><![CDATA[This is a tutorial to show you an idea how to create  neat crossfadinging images in flash actionscript 3.0. It may not be the best, or only way to create this effect but it should get you started.
You can download the source files here.
First thing you have to do is create 2 empty movieclips that [...]]]></description>
			<content:encoded><![CDATA[<p>This is a tutorial to show you an idea how to create  neat crossfadinging images in flash actionscript 3.0. It may not be the best, or only way to create this effect but it should get you started.</p>
<p>You can <strong><u><a href="http://www.i-ray.nl/tutorials/crossfade_tut.zip">download</a></u></strong> the source files here.</p>
<p>First thing you have to do is create 2 empty movieclips that are gonna act as our movieclip loading instance, I called them mc_<strong>empty1 </strong>&amp; mc_<strong>empty2</strong>.  Then create some simple buttons to load the different images, their called <strong>nextBtn1</strong>, <strong>nextBtn2 </strong>&amp; <strong>nextBtn3 </strong>in my file. And optional is the very simple movieclip I used as a loader. It contains a textfield and a loading bar that will show the loading status.</p>
<p>We gonna put the actionscript 3.0 for the fade on frame 1 of the main timeline. Or you can <a href="http://www.i-ray.nl/tutorials/crossfade_tut.zip">download</a> the .fla file that I used.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">//using flash it's own tween, you could also use greensock tweenlight</span>
<span style="color: #808080; font-style: italic;">//or some homeMade class or even a movieclip</span>
<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">transitions</span>.<span style="color: #006600;">Tween</span>;
<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">transitions</span>.<span style="color: #006600;">easing</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">transitions</span>.<span style="color: #006600;">TweenEvent</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create some vars that check if witch movieclip is on</span>
<span style="color: #000000; font-weight: bold;">var</span> img1Aan:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
<span style="color: #000000; font-weight: bold;">var</span> img2Aan:<span style="color: #0066CC;">Boolean</span> = <span style="color: #000000; font-weight: bold;">false</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// create 2 loaders for the 2 movieclips</span>
<span style="color: #000000; font-weight: bold;">var</span> picLdr1:Loader;
<span style="color: #000000; font-weight: bold;">var</span> picLdr2:Loader;
&nbsp;
<span style="color: #808080; font-style: italic;">// I'm only using the alpha of mc_emty2 to fade in &amp;amp; out.</span>
mc_empty2.<span style="color: #006600;">alpha</span> = <span style="color: #cc66cc;">0</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// button functionstuff</span>
nextBtn1.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, loadImg<span style="color: #66cc66;">&#41;</span>;
nextBtn2.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, loadImg<span style="color: #66cc66;">&#41;</span>;
nextBtn3.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>MouseEvent.<span style="color: #006600;">MOUSE_UP</span>, loadImg<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// check the target buttons name and use it's image.</span>
<span style="color: #000000; font-weight: bold;">function</span> loadImg<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:MouseEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span> == <span style="color: #ff0000;">&quot;nextBtn1&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> imgPath:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;images/1.jpg&quot;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span> == <span style="color: #ff0000;">&quot;nextBtn2&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        imgPath = <span style="color: #ff0000;">&quot;images/2.jpg&quot;</span>;
    <span style="color: #66cc66;">&#125;</span><span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span> == <span style="color: #ff0000;">&quot;nextBtn3&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
        imgPath = <span style="color: #ff0000;">&quot;images/3.jpg&quot;</span>;
    <span style="color: #66cc66;">&#125;</span>
    imgLoader<span style="color: #66cc66;">&#40;</span>imgPath<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// the button function activates this loading function</span>
<span style="color: #000000; font-weight: bold;">function</span> imgLoader<span style="color: #66cc66;">&#40;</span>imgPath<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #808080; font-style: italic;">// this will keep the images switching movieclip</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> img1Aan == <span style="color: #000000; font-weight: bold;">false</span> <span style="color: #66cc66;">&amp;</span>amp;<span style="color: #66cc66;">&amp;</span>amp; img2Aan == <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">// first time</span>
        picLdr1 = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        picLdr1.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>imgPath<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        mc_empty1.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>picLdr1<span style="color: #66cc66;">&#41;</span>;
        picLdr1.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span>, img_loading<span style="color: #66cc66;">&#41;</span>;
        picLdr1.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, img1_loaded<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> img1Aan == <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">// load img2</span>
        picLdr2 = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        picLdr2.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>imgPath<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        mc_empty2.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>picLdr2<span style="color: #66cc66;">&#41;</span>;
        picLdr2.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span>, img_loading<span style="color: #66cc66;">&#41;</span>;
        picLdr2.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, img2_loaded<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span><span style="color: #66cc66;">&#123;</span> <span style="color: #808080; font-style: italic;">// img2Aan == true ... load img1</span>
        picLdr1 = <span style="color: #000000; font-weight: bold;">new</span> Loader<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        picLdr1.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #66cc66;">&#40;</span>imgPath<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
        mc_empty1.<span style="color: #006600;">addChild</span><span style="color: #66cc66;">&#40;</span>picLdr1<span style="color: #66cc66;">&#41;</span>;
        picLdr1.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>ProgressEvent.<span style="color: #006600;">PROGRESS</span>, img_loading<span style="color: #66cc66;">&#41;</span>;
        picLdr1.<span style="color: #006600;">contentLoaderInfo</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>Event.<span style="color: #006600;">COMPLETE</span>, img1_loaded<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> img_loading<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> npercent = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">round</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">bytesLoaded</span> <span style="color: #66cc66;">/</span> <span style="color: #0066CC;">e</span>.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">bytesTotal</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;    <span style="color: #808080; font-style: italic;">// get your loaded percentage from the loader</span>
    mc_loader.<span style="color: #006600;">loaderTxt</span>.<span style="color: #0066CC;">text</span> = npercent+<span style="color: #ff0000;">&quot;%&quot;</span>;
    mc_loader.<span style="color: #006600;">mc_loadingBar</span>.<span style="color: #0066CC;">width</span> = npercent;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> img1_loaded<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
    img1Aan=<span style="color: #000000; font-weight: bold;">true</span>;
    img2Aan=<span style="color: #000000; font-weight: bold;">false</span>;
    <span style="color: #000000; font-weight: bold;">var</span> myTweenAlpha:Tween = <span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #66cc66;">&#40;</span>mc_empty2, <span style="color: #ff0000;">&quot;alpha&quot;</span>, Strong.<span style="color: #006600;">easeOut</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">3</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> img2_loaded<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">e</span>:Event<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span><span style="color: #66cc66;">&#123;</span>
    img1Aan=<span style="color: #000000; font-weight: bold;">false</span>;
    img2Aan=<span style="color: #000000; font-weight: bold;">true</span>;
    <span style="color: #000000; font-weight: bold;">var</span> myTweenAlpha:Tween = <span style="color: #000000; font-weight: bold;">new</span> Tween<span style="color: #66cc66;">&#40;</span>mc_empty2, <span style="color: #ff0000;">&quot;alpha&quot;</span>, Strong.<span style="color: #006600;">easeOut</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">3</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">stop</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>have Fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/tutorials/crossfading-images-tutorial-actionscript-3-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Use global variables in Actionscript 3.0</title>
		<link>http://www.i-ray.nl/blog/tutorials/use-global-variables-in-actionscript-3-0/</link>
		<comments>http://www.i-ray.nl/blog/tutorials/use-global-variables-in-actionscript-3-0/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 07:19:11 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[actionscript 2]]></category>
		<category><![CDATA[actionscript 3.0]]></category>
		<category><![CDATA[as2]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[globals]]></category>
		<category><![CDATA[variabelen]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[vars]]></category>
		<category><![CDATA[_root]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=44</guid>
		<description><![CDATA[I guess this is some of the things a lot of people who used actionscript 2.0 really miss in actionscript 3.0, the use of global vars (_root.var). It might not completely OOP proof, but it sure can be a timesaver in some cases!
This is a step by step explenation of how to create something like [...]]]></description>
			<content:encoded><![CDATA[<p>I guess this is some of the things a lot of people who used actionscript 2.0 really miss in actionscript 3.0, the use of global vars (_root.var). It might not completely OOP proof, but it sure can be a timesaver in some cases!</p>
<p>This is a step by step explenation of how to create something like global vars in actionscript 3.0</p>
<p>First u need to create a new *.as file, I will call this globals.as &#038; place it in the folder  nl/globalVars/globals in this you create a new package like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;">package nl.<span style="color: #006600;">globalVars</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> globals<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">data</span>:<span style="color: #0066CC;">Object</span> = <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>;
&nbsp;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>you can import &#038; use this &#8220;global&#8221; class now in your Document class, or anywhere else in your flash movie like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// to import the global vars class.....</span>
 <span style="color: #0066CC;">import</span> nl.<span style="color: #006600;">globalVars</span>.<span style="color: #006600;">globals</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// add some values just like you would to any other variable</span>
globals.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">myVar1</span>=<span style="color: #ff0000;">&quot;hello&quot;</span>;
globals.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">myVar2</span>=<span style="color: #ff0000;">&quot;world&quot;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// now use them anywhere you like, just like as2 global vars </span>
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>globals.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">myVar1</span>+<span style="color: #ff0000;">&quot; &quot;</span>+globals.<span style="color: #0066CC;">data</span>.<span style="color: #006600;">myVar2</span><span style="color: #66cc66;">&#41;</span>;</pre></td></tr></table></div>

<p>If you not wanna place your *.as file in a folder but in the root of your *.fla file you can strip the nl.globalVars from the package { line in the *.as file &#038; from the import where you wanna use your global Vars.</p>
<p>Hope I helped someone out with this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/tutorials/use-global-variables-in-actionscript-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loop trough globals $_POST &amp; $_GET</title>
		<link>http://www.i-ray.nl/blog/scripts/37/</link>
		<comments>http://www.i-ray.nl/blog/scripts/37/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 21:01:51 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[scripts]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[globals]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[variabelen]]></category>
		<category><![CDATA[variable]]></category>
		<category><![CDATA[vars]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=37</guid>
		<description><![CDATA[This are some script snippets for fast replacement POST or GET to normal values. It&#8217;ll saves the time of converting them by hand.

// change all the POST vars
foreach &#40;$_POST as $key =&#62; $value&#41; &#123; // loop trough all post vars
        $&#123;$key&#125;=$value; //make $var = value from $_POST['var'] = [...]]]></description>
			<content:encoded><![CDATA[<p>This are some script snippets for fast replacement POST or GET to normal values. It&#8217;ll saves the time of converting them by hand.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// change all the POST vars</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// loop trough all post vars</span>
        $<span style="color: #009900;">&#123;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">=</span><span style="color: #000088;">$value</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//make $var = value from $_POST['var'] = value</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// display the list of varables from post</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// same as the above post only then with get</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        $<span style="color: #009900;">&#123;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">=</span><span style="color: #000088;">$value</span><span style="color: #339933;">;</span> 
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$$key</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/scripts/37/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timer Event Function</title>
		<link>http://www.i-ray.nl/blog/scripts/timer-event-function-actionscript-3-0/</link>
		<comments>http://www.i-ray.nl/blog/scripts/timer-event-function-actionscript-3-0/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 08:37:14 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[scripts]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[timer]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=29</guid>
		<description><![CDATA[A simple example of a timer event function in actionscript 3.0

// if your not working from the timeline you should also use these imports. 
// if your as is on the timeline you can skip it
import flash.events.TimerEvent;
import flash.utils.Timer;
&#160;
var myTimer:Timer = new Timer&#40;1500, 1&#41;; // 1.5 second &#38; repeates only 1 time
myTimer.addEventListener&#40;TimerEvent.TIMER, myaction&#41;;
myTimer.start&#40;&#41;;
&#160;
function myaction&#40;event:TimerEvent&#41;:void &#123;
	trace&#40;&#34;myaction() traces [...]]]></description>
			<content:encoded><![CDATA[<p>A simple example of a timer event function in actionscript 3.0</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// if your not working from the timeline you should also use these imports. </span>
<span style="color: #808080; font-style: italic;">// if your as is on the timeline you can skip it</span>
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">TimerEvent</span>;
<span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Timer</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> myTimer:Timer = <span style="color: #000000; font-weight: bold;">new</span> Timer<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1500</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// 1.5 second &amp; repeates only 1 time</span>
myTimer.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>TimerEvent.<span style="color: #006600;">TIMER</span>, myaction<span style="color: #66cc66;">&#41;</span>;
myTimer.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> myaction<span style="color: #66cc66;">&#40;</span>event:TimerEvent<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;myaction() traces this msg @ &quot;</span> + <span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">&quot; ms&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/scripts/timer-event-function-actionscript-3-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>addChild from library Flash cs3 / cs4</title>
		<link>http://www.i-ray.nl/blog/tutorials/test3/</link>
		<comments>http://www.i-ray.nl/blog/tutorials/test3/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 18:06:05 +0000</pubDate>
		<dc:creator>Ray</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[addChild]]></category>
		<category><![CDATA[as3]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[library]]></category>

		<guid isPermaLink="false">http://www.i-ray.nl/blog/?p=11</guid>
		<description><![CDATA[This tutorial will show you how to addChild a movieclip with actionscript 3.0 from your library in flash cs3 / cs4.
To start you need to get to the properties of a movieclip, you can get here by selecting a new symbol &#38; press F8. Or by pressing on the &#8220;New&#8221; button in the bottom of [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to addChild a movieclip with actionscript 3.0 from your library in flash cs3 / cs4.</p>
<p>To start you need to get to the properties of a movieclip, you can get here by selecting a new symbol &amp; press F8. Or by pressing on the &#8220;New&#8221; button in the bottom of the library screen.</p>
<p>If you alreay have a movieclip in your library you can acces the screen by rightclickin it &amp; select properties.</p>
<p>It&#8217;s important now to give an unique name in the texfield Class, on the screen below  &#8220;my_mc&#8221;</p>
<p><a href="http://www.i-ray.nl/blog/wp-content/uploads/mc_properties_screen.jpg"><img class="alignnone size-full wp-image-14" title="mc_properties_screen" src="http://www.i-ray.nl/blog/wp-content/uploads/mc_properties_screen.jpg" alt="mc_properties_screen" width="425" height="555" /></a></p>
<p>When you press enter you will get this window, you can press ok here to continue</p>
<p><img class="alignnone size-full wp-image-15" title="popup" src="http://www.i-ray.nl/blog/wp-content/uploads/popup.jpg" alt="popup" width="425" height="555" /></p>
<p>Now on frame 1 you can enter these lines in you actionscript, you can call the new movieclip anything you want I just will call it new_mc for now.</p>
<p>It will allways be placed @ the top left of the movieclip you used the addChild in.</p>
<p><img src="file:///C:/Users/Rayna/AppData/Local/Temp/moz-screenshot-3.jpg" alt="" /></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> new_mc:my_mc = <span style="color: #000000; font-weight: bold;">new</span> my_mc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//new_mc  is ... the new movieclip</span>
addChild<span style="color: #66cc66;">&#40;</span>new_mc<span style="color: #66cc66;">&#41;</span>;  <span style="color: #808080; font-style: italic;">// addChild will place the new_mc on stage</span></pre></div></div>

<p>You can also give some new properties to your newly placed movieclip by adressing the new name. For instance:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> new_mc:my_mc = <span style="color: #000000; font-weight: bold;">new</span> my_mc<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//new_mc is ... the new movieclip</span>
addChild<span style="color: #66cc66;">&#40;</span>new_mc<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// addChild will place the new_mc on stage</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// some properties</span>
new_mc.<span style="color: #006600;">x</span> = <span style="color: #cc66cc;">10</span>;
new_mc.<span style="color: #006600;">y</span> = <span style="color: #cc66cc;">15</span>;
new_mc.<span style="color: #006600;">alpha</span> = <span style="color: #cc66cc;">0.7</span>;
new_mc.<span style="color: #0066CC;">width</span> = <span style="color: #cc66cc;">250</span>;</pre></div></div>

<p>Hope this tutorial was usefull to you.</p>
<p>You can download the .fla source files <a href="http://www.i-ray.nl/blog/wp-content/uploads/addChildFromLibrary.fla">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.i-ray.nl/blog/tutorials/test3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

