<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Modern addiction: ActionScript 3.0</title>
	
	<link>http://blog.flashandcoffee.com</link>
	<description>Chit chat about AS 3.0, OO concepts, and Flash in general...</description>
	<lastBuildDate>Sat, 14 Aug 2010 08:47:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<image>
  <link>http://blog.flashandcoffee.com</link>
  <url>http://www.flashandcoffee.com/favicon.gif</url>
  <title>Modern addiction: ActionScript 3.0</title>
</image>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ModernAddictionActionscript30" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="modernaddictionactionscript30" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>PropertyWatch</title>
		<link>http://blog.flashandcoffee.com/2010/08/14/propertywatch/</link>
		<comments>http://blog.flashandcoffee.com/2010/08/14/propertywatch/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 08:45:20 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=164</guid>
		<description><![CDATA[I programmed a simple class which informs you when object property value is changed. Sample above shows how coordinate information is updated when user clicks button for setting new random coordinate. Sample is included in source, along with asdoc.]]></description>
			<content:encoded><![CDATA[<p>I programmed a simple class which informs you when object property value is changed.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="370" height="400" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.flashandcoffee.com/examples/PropertyWatch/sample/PropertyWatchSample.swf" /><embed type="application/x-shockwave-flash" width="370" height="400" src="http://www.flashandcoffee.com/examples/PropertyWatch/sample/PropertyWatchSample.swf"></embed></object></p>
<p>Sample above shows how coordinate information is updated when user clicks button for setting new random coordinate. Sample is included in source, along with asdoc.</p>
<div class="wp-caption alignleft" style="width: 138px"><a href="http://www.flashandcoffee.com/examples/PropertyWatch/PropertyWatch.zip"><img title="Project source" src="http://www.flashandcoffee.com/blog_icons/download.png" alt="Project source" width="128" height="128" /></a><p class="wp-caption-text">Source</p></div>
<div class="wp-caption alignleft" style="width: 138px"><a href="http://www.flashandcoffee.com/examples/PropertyWatch/doc/"><img title="Documentation" src="http://www.flashandcoffee.com/blog_icons/doc.png" alt="Documentation" width="128" height="128" /></a><p class="wp-caption-text">Documentation</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2010/08/14/propertywatch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash security</title>
		<link>http://blog.flashandcoffee.com/2009/11/19/flash-security/</link>
		<comments>http://blog.flashandcoffee.com/2009/11/19/flash-security/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 10:34:18 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=155</guid>
		<description><![CDATA[I'm currently preparing a seminar for my college course "Internet safety", and I'm writing about Flash security in various scenarios. It is practical work, so there will be a lot of free code to look at. When I'm done with it, I'll be putting it in some small e-book for everyone to read. Stay tune.]]></description>
			<content:encoded><![CDATA[<p>I'm currently preparing a seminar for my college course "Internet safety", and I'm writing about Flash security in various scenarios. It is practical work, so there will be a lot of free code to look at.</p>
<p>When I'm done with it, I'll be putting it in some small e-book for everyone to read.</p>
<p>Stay tune. <img src='http://www.flashandcoffee.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/11/19/flash-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trouble activating Flash?</title>
		<link>http://blog.flashandcoffee.com/2009/11/19/trouble-activating-flash/</link>
		<comments>http://blog.flashandcoffee.com/2009/11/19/trouble-activating-flash/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 23:26:32 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[activating]]></category>
		<category><![CDATA[activation]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=152</guid>
		<description><![CDATA[Well, I reinstalled my Flash CS3, entered my serial number, but when it came to activating it, I couldn't. Probably because I'm in Croatia which isn't part of EU and definitely isn't in America. Anyway, solution is tied to proxies. The thing that worked for me was to set up proxy settings in my default [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I reinstalled my Flash CS3, entered my serial number, but when it came to activating it, I couldn't. Probably because I'm in Croatia which isn't part of EU and definitely isn't in America. <img src='http://www.flashandcoffee.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Anyway, solution is tied to proxies. The thing that worked for me was to set up proxy settings in my default browser (Mozilla Firefox).</p>
<p>On <a title="Proxy list" href="http://aliveproxy.com/us-proxy-list/" target="_blank">this site</a> I found proxies which I could connect to. So I went to Tools -&gt; Options -&gt; Advanced -&gt; Network tab -&gt; Settings. Choose <em>Manual proxy configuration</em>, enter proxy address and port, and check <em>Use this proxy server for all protocols</em>. Now you can close windows and test if your connection is working. Try opening your home page or any page you want. Connection will probably be slower, but it should work. If it doesn't work you either didn't input proxy settings correctly or server you wish to connect to is offline.</p>
<p>So now your connection over proxy works. Now open Flash and try doing activation (normal activation, not over proxy).</p>
<p>P.S. You can check if server is online with opening cmd, and ping it. If it responses, your connection should work.</p>
<p>Hope it helps someone, because I lost all day on figuring out activation, and I hope none else will suffer anymore. <img src='http://www.flashandcoffee.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/11/19/trouble-activating-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Version your development!</title>
		<link>http://blog.flashandcoffee.com/2009/09/18/version-your-development/</link>
		<comments>http://blog.flashandcoffee.com/2009/09/18/version-your-development/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 07:02:44 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[Best practices]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=149</guid>
		<description><![CDATA[Why? Everyone has probably heard about Subversion. It allows you to track your project (project versions) and manipulate those versions. When big project is involved, lots of companies put their code to version control. Why? Because it safeguards the code from falling apart when 2 or more developers are working on the same file (that [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Subversion Tigris.org" src="http://subversion.tigris.org/images/subversion_logo_hor-468x64.png" alt="" width="468" height="64" /></p>
<h1>Why?</h1>
<p>Everyone has probably heard about Subversion. It allows you to track your project (project versions) and manipulate those versions. When big project is involved, lots of companies put their code to version control. Why? Because it safeguards the code from falling apart when 2 or more developers are working on the same file (that is Subversions primary goal). But none of developers I know uses Subversion for developing small projects on local machine.</p>
<p>Couple of times I did some programming, and I added or changed something and my program just stopped working. Than I would click undo button like crazy but I lost my previous working version. But of course, every problem can be solved, and I solved it every time, but I lost a few hours doing so. Back then I would kill for Subversion.</p>
<h1>Time to put in some action!</h1>
<p>If you had similar problem or you want to have safer future, put your code under version control.</p>
<p>Necessary programs:<br />
1. <a href="http://www.apache.org/" target="_blank">Apache</a> (I use<a href="http://www.apachefriends.org/en/xampp.html" target="_blank"> XAMPP</a>)<br />
2. <a href="http://subversion.tigris.org/" target="_blank">Subversion</a><br />
3.<a href="http://tortoisesvn.tigris.org/" target="_blank"> TortoiseSVN</a></p>
<p>I won't explain installation of those 3 components, it would be a waste of time, because there are already references on the internet.</p>
<p>You can follow installation process from <a href="http://code.google.com/p/rpg-framework/downloads/detail?name=Tortoise%20SVN%20-%20User%20Guide.pdf&amp;can=2&amp;q=" target="_blank">TortoiseSVN user guide</a> (Chapter 3. Setting up a server).</p>
<p>When you have a new project on your hand, you only have to add new repository, and your newly created folder for your project put under control with <em>Impor</em>t to that repository and then <em>SVN </em><em>Checkout. </em>I recommend you also read Chapter 4 and 5 from guide to get you started.</p>
<p>I recommended TortoiseSVN because it is really simple to maintain your code rather than typing in command line.</p>
<h1>Review steps...</h1>
<p>1. Install Subversion, TortoiseSVN and XAMPP (or anything you'd like)<br />
2. Adjust all three to work together (read user guide)<br />
3. Create your initial repository and decide on the structure (also read guide)<br />
4. Start versioning!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/09/18/version-your-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mouse over faces of PV3D cube</title>
		<link>http://blog.flashandcoffee.com/2009/08/30/mouse-over-faces-of-pv3d-cube/</link>
		<comments>http://blog.flashandcoffee.com/2009/08/30/mouse-over-faces-of-pv3d-cube/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 06:21:15 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[cube]]></category>
		<category><![CDATA[interact]]></category>
		<category><![CDATA[listener]]></category>
		<category><![CDATA[material]]></category>
		<category><![CDATA[OBJECT_OVER]]></category>
		<category><![CDATA[papervision]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=143</guid>
		<description><![CDATA[Problem When you try to interact with cube material to determine which face has mouse over it, it is impossible to do it with adding OBJECT_OVER listener to cube. Solution Basic thing is that instead of putting listener for mouse over, we listen to mouse move. Or if we put it in perspective of listeners [...]]]></description>
			<content:encoded><![CDATA[<h1>Problem</h1>
<p>When you try to interact with cube material to determine which face has mouse over it, it is impossible to do it with adding OBJECT_OVER listener to cube.</p>
<h1>Solution</h1>
<p><object width="400" height="400" data="http://www.flashandcoffee.com/examples/CubeFaceInteraction/Main.swf" type="application/x-shockwave-flash"><param name="src" value="http://www.flashandcoffee.com/examples/CubeFaceInteraction/Main.swf" /></object></p>
<p>Basic thing is that instead of putting listener for mouse over, we listen to mouse move. Or if we put it in perspective of listeners in cube with which we are working, OBJECT_OVER listener is replaced with OBJECT_MOVE listener.</p>
<p>You will need one variable for holding current cube face on which mouse is over:</p>
<pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> currentCubeFace:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;&quot;</span>;</pre>
<p>Next, you'll need to add listener to your cube:</p>
<pre class="actionscript"><span style="color: #0066CC;">this</span>.<span style="color: #006600;">cube</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> InteractiveScene3DEvent.<span style="color: #006600;">OBJECT_MOVE</span>, cubeMoveHandler <span style="color: #66cc66;">&#41;</span>;</pre>
<p>Finally in cubeMoveHandler you will need to check if face on which mouse is over has changed. That is neccessary so that event only occur once. That way we simulate OBJECT_OVER method but which works will cube faces. Here is cubeMoveHandler method:</p>
<pre class="actionscript"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> cubeMoveHandler<span style="color: #66cc66;">&#40;</span> event:InteractiveScene3DEvent <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;">//Check if mouse is over another cube face</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">this</span>.<span style="color: #006600;">currentCubeFace</span> != <span style="color: #66cc66;">&#40;</span> event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span> + <span style="color: #ff0000;">&quot;&quot;</span> + event.<span style="color: #006600;">face3d</span>.<span style="color: #006600;">material</span>.<span style="color: #0066CC;">name</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		<span style="color: #0066CC;">this</span>.<span style="color: #006600;">currentCubeFace</span> = event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span> + <span style="color: #ff0000;">&quot;&quot;</span> + event.<span style="color: #006600;">face3d</span>.<span style="color: #006600;">material</span>.<span style="color: #0066CC;">name</span>;
		<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">textField</span>.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;Target: &quot;</span> + event.<span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">name</span> + <span style="color: #ff0000;">&quot;, face: &quot;</span> + event.<span style="color: #006600;">face3d</span>.<span style="color: #006600;">material</span>.<span style="color: #0066CC;">name</span>;
	<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p><a title="Source files" href="http://www.flashandcoffee.com/examples/CubeFaceInteraction/CubeFaceInteraction.zip" target="_blank">Get source files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/08/30/mouse-over-faces-of-pv3d-cube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New skills</title>
		<link>http://blog.flashandcoffee.com/2009/08/27/new-skills/</link>
		<comments>http://blog.flashandcoffee.com/2009/08/27/new-skills/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 06:53:35 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[3d]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[papervision]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[skills]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=138</guid>
		<description><![CDATA[Over this summer vacation I added new skills to my portfolio. Check it out! If any of it interests you, check my About page. Papervision3D Papervision3D is an open source 3D engine for the Flash platform. It is written and maintained by a small core team, and contributed to by its ever-growing community. Core team [...]]]></description>
			<content:encoded><![CDATA[<p>Over this summer vacation I added new skills to my portfolio. Check it out! If any of it interests you, check my <a title="About me" href="http://blog.flashandcoffee.com/about/" target="_self">About page</a>.</p>
<h1>Papervision3D</h1>
<p><img class="size-full wp-image-139 alignnone" title="papervision3d" src="http://www.flashandcoffee.com/wordpress/wp-content/uploads/2009/08/papervision3d.jpg" alt="papervision3d" width="357" height="195" /></p>
<p>Papervision3D is an open source 3D engine for the Flash platform. It is written and maintained by a small core team, and contributed to by its ever-growing community.</p>
<p>Core team<br />
* Carlos Ulloa<br />
* John Grden<br />
* Ralph Hauwert<br />
* Tim Knip</p>
<p>Contributors<br />
* Patrick Pietens<br />
* Ron Valstar</p>
<p><a title="Papervision3D" href="http://blog.papervision3d.org/" target="_blank">http://blog.papervision3d.org/</a></p>
<h1>Adobe AIR</h1>
<p><img class="alignnone size-full wp-image-140" title="adobe_air" src="http://www.flashandcoffee.com/wordpress/wp-content/uploads/2009/08/adobe_air.jpg" alt="adobe_air" width="400" height="211" /></p>
<p>The new Adobe® AIR™ runtime lets developers build rich applications that deploy to the desktop. AIR applications run across operating systems and are easily delivered using a single installer file. With Adobe AIR, developers can use their existing skills in Flash to build highly engaging, visually rich applications that combine the power of local resources and data with the reach of the web.</p>
<p>Adobe AIR offers an exciting new way to engage customers with innovative, branded applications, without requiring changes to existing technology, people, or processes.</p>
<p>From shopping on eBay to managing music, Adobe AIR means applications that are easier, more powerful, and more fun to use.</p>
<p><a title="Adobe AIR" href="http://www.adobe.com/products/air/" target="_blank">http://www.adobe.com/products/air/</a></p>
<h1>Flash components</h1>
<p>Flash component is collection of ActionScript classes and Flash FLA file making one graphic component simple to use and reuse. It allows developers to simply drag&amp;drop component to their project, add parameters and they are done with it. It also allows live preview of changing dimensions and changing skins to the component. The beauty is that component is reliable separated from rest of the project.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/08/27/new-skills/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AntiAliasing dynamic TextField</title>
		<link>http://blog.flashandcoffee.com/2009/08/26/antialiasing-dynamic-textfield/</link>
		<comments>http://blog.flashandcoffee.com/2009/08/26/antialiasing-dynamic-textfield/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 08:31:48 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=132</guid>
		<description><![CDATA[Problem Problem comes up when you dynamically add TextField with special font to your movie. You can create empty dynamic TextField on stage and embed fonts in it. Then you have global access to that font from TextFields through your classes. But by default you have No Bitmap antialiasing turned on. So your font looks [...]]]></description>
			<content:encoded><![CDATA[<h1 style="text-align: left;">Problem</h1>
<p style="text-align: left;">Problem comes up when you dynamically add TextField with special font to your movie. You can create empty dynamic TextField on stage and embed fonts in it. Then you have global access to that font from TextFields through your classes. But by default you have No Bitmap antialiasing turned on. So your font looks distorted.</p>
<h1 style="text-align: left;">Solution</h1>
<p style="text-align: left;">Assuming you embedded fonts which you will use, to fix this problem there is class AntiAliasType. TextField contains property antiAliasType which you will need to set.</p>
<pre style="text-align: left;" lang="actionscript">var format:TextFormat = new TextFormat( "Calibri" );

textField.text = "Some text.";
textField.embedFonts = true;
textField.antiAliasType = AntiAliasType.ADVANCED;
textField.setTextFormat( format );</pre>
<p style="text-align: left;">Don't forget importing:</p>
<pre style="text-align: left;" lang="actionscript">import flash.text.AntiAliasType;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/08/26/antialiasing-dynamic-textfield/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic XML checking…</title>
		<link>http://blog.flashandcoffee.com/2009/08/18/basic-xml-checking/</link>
		<comments>http://blog.flashandcoffee.com/2009/08/18/basic-xml-checking/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 06:59:10 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=124</guid>
		<description><![CDATA[Lots of unexpected errors can come from mistyping XML. So you have wrong data, and you load it to your program and of course it will work wrong. You can be sure to check your loaded data before doing anything. Also be sure to cast your data when assigning it to variable. In example: //Sample [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of unexpected errors can come from mistyping XML. So you have wrong data, and you load it to your program and of course it will work wrong.</p>
<p>You can be sure to check your loaded data before doing anything. Also be sure to cast your data when assigning it to variable. In example:</p>
<pre class="actionscript"><span style="color: #808080; font-style: italic;">//Sample XML</span>
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">xml</span>:<span style="color: #0066CC;">XML</span> = &lt;node attribute=<span style="color: #ff0000;">&quot;1&quot;</span>&gt;Node text&lt;/node&gt;;
&nbsp;
<span style="color: #808080; font-style: italic;">//Assign node text to txt variable</span>
<span style="color: #000000; font-weight: bold;">var</span> txt:<span style="color: #0066CC;">String</span> = <span style="color: #000000; font-weight: bold;">null</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;node&quot;</span> <span style="color: #b1b100;">in</span> <span style="color: #0066CC;">xml</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	txt = <span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">node</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;Node doesn't exist!&quot;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//Assign node attribute to num variable</span>
<span style="color: #000000; font-weight: bold;">var</span> num:uint = <span style="color: #cc66cc;">0</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;@attribute&quot;</span> <span style="color: #b1b100;">in</span> <span style="color: #0066CC;">xml</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	num = uint<span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.@attribute <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;Attribute doesn't exist!&quot;</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/08/18/basic-xml-checking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Second language: AS 3.0</title>
		<link>http://blog.flashandcoffee.com/2009/08/05/second-language-as-30/</link>
		<comments>http://blog.flashandcoffee.com/2009/08/05/second-language-as-30/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 13:07:43 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=122</guid>
		<description><![CDATA[This is not a standard post, but it's so awesome I had to put it up. Everyone should have a chance to learn to speak ActionScript, and Doug Winnie made sure you can do it. So if you're new, enjoy it: ActionScript 1:1 with Doug Winnie]]></description>
			<content:encoded><![CDATA[<p>This is not a standard post, but it's so awesome I had to put it up. Everyone should have a chance to learn to speak ActionScript, and Doug Winnie made sure you can do it.</p>
<p>So if you're new, enjoy it:<br />
<a title="AS 1.1" href="http://flashspeaksactionscript.com/actionscript-11-getting-intimate-with-actionscript-30/" target="_blank">ActionScript 1:1 with Doug Winnie</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/08/05/second-language-as-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable stage object in loaded SWF</title>
		<link>http://blog.flashandcoffee.com/2009/07/26/enable-stage-object-in-loaded-swf/</link>
		<comments>http://blog.flashandcoffee.com/2009/07/26/enable-stage-object-in-loaded-swf/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 08:22:12 +0000</pubDate>
		<dc:creator>Vjekoslav Ratkajec</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[stage]]></category>
		<category><![CDATA[SWF]]></category>

		<guid isPermaLink="false">http://blog.flashandcoffee.com/?p=119</guid>
		<description><![CDATA[Suppose you load some SWF in your main SWF, and you want it to have access to main's stage. In Document Class of loaded SWF you should add: public function LoadedSWFConstructo&#40;&#41; &#123; this.addEventListener&#40; Event.ADDED_TO_STAGE, init &#41;; &#125; &#160; public function init&#40; event:Event &#41;:void &#123; trace&#40; stage.quality &#41;; &#125; So, in loaded SWF constructor you would [...]]]></description>
			<content:encoded><![CDATA[<p>Suppose you load some SWF in your main SWF, and you want it to have access to main's stage. In Document Class of loaded SWF you should add:</p>
<pre class="actionscript"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> LoadedSWFConstructo<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
  <span style="color: #0066CC;">this</span>.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> Event.<span style="color: #006600;">ADDED_TO_STAGE</span>, init <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span> event:Event <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: #0066CC;">stage</span>.<span style="color: #0066CC;">quality</span> <span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>So, in loaded SWF constructor you would register for ADDED_TO_STAGE event, and then you can use stage object. Simple enough.</p>
<p>Why do you need this? Mostly when having your application in full browser window. When resizing occurs you would want to resize or move objects in you loaded SWF. Imagination is the limit. <img src='http://www.flashandcoffee.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.flashandcoffee.com/2009/07/26/enable-stage-object-in-loaded-swf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
