<?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>franto.com &#187; Flash Tips &amp; Tricks</title>
	<atom:link href="http://franto.com/category/flash-tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://franto.com</link>
	<description></description>
	<lastBuildDate>Tue, 23 Aug 2011 10:29:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Problem with XML attributes in AS3.0</title>
		<link>http://franto.com/problem-with-xml-attributes-in-as3-0/</link>
		<comments>http://franto.com/problem-with-xml-attributes-in-as3-0/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 15:22:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash Tips & Tricks]]></category>
		<category><![CDATA[Flex Tips]]></category>

		<guid isPermaLink="false">http://franto.com/?p=977</guid>
		<description><![CDATA[I've found today some small problem with setting <strong>XML attribute</strong> for my current application. I'm generating HTML source code via XML, because both are tags languages and I have found this nice problem. Imagine you have DIV tag with class attribute set like this:]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for flex-tips</h3><ol><li>Problem with XML attributes in AS3.0</li><li><a href='http://franto.com/unable-to-export-swc-oem/' title='Unable to export SWC oem'>Unable to export SWC oem</a></li><li><a href='http://franto.com/numeric-sorting-of-flex-datagridcolumn/' title='Numeric sorting of Flex DataGridColumn'>Numeric sorting of Flex DataGridColumn</a></li></ol></div> <div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fproblem-with-xml-attributes-in-as3-0%2F&amp;text=Problem with XML attributes in AS3.0&amp;count=vertical&amp;lang=en"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>I&#8217;ve found today some small problem with setting <strong>XML attribute</strong> for my current application. I&#8217;m generating HTML source code via XML, because both are tags languages and I have found this nice problem. Imagine you have DIV tag with class attribute set like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;myClass&quot;&gt;test&lt;/div&gt;</pre></div></div>

<p>So in ActionScript 3 you can create it via XML in this way</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> divXML<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">XML</span> = <span style="color: #000000; font-weight: bold;">&lt;</span>div<span style="color: #000000; font-weight: bold;">&gt;</span>test<span style="color: #000000; font-weight: bold;">&lt;/</span>test<span style="color: #000000; font-weight: bold;">&gt;</span>;
divXML.@<span style="color: #9900cc; font-weight: bold;">class</span> = <span style="color: #990000;">&quot;myClass&quot;</span>;</pre></div></div>

<p>All seems ok and trivial, but Flex Builder has problem to compile second line. It seems that @class is reserved word, because I can change to other attribute name and it works. But luckily there are different ways how to set XML attribute for XML node.  I&#8217;ve fixed it in this way</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> divXML<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">XML</span> = <span style="color: #000000; font-weight: bold;">&lt;</span>div<span style="color: #000000; font-weight: bold;">&gt;</span>test<span style="color: #000000; font-weight: bold;">&lt;/</span>test<span style="color: #000000; font-weight: bold;">&gt;</span>;
divXML.@<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;class&quot;</span><span style="color: #000000;">&#93;</span> = <span style="color: #990000;">&quot;myClass&quot;</span>;</pre></div></div>

<p>What is your preffered  way to set XML attributes?</p>
 <div class='series_links'> <a href='http://franto.com/unable-to-export-swc-oem/' title='Unable to export SWC oem'>Next in series</a></div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/problem-with-xml-attributes-in-as3-0/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>AIR Tip: ContextMenuItem can crash AIR app on Windows</title>
		<link>http://franto.com/air-tip-contextmenuitem-can-crash-air-app-on-windows/</link>
		<comments>http://franto.com/air-tip-contextmenuitem-can-crash-air-app-on-windows/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 11:34:24 +0000</pubDate>
		<dc:creator>Franto</dc:creator>
				<category><![CDATA[AIR Tips]]></category>
		<category><![CDATA[Flash Tips & Tricks]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[ContextMenu]]></category>

		<guid isPermaLink="false">http://www.franto.com/?p=768</guid>
		<description><![CDATA[This is just quick tip for all AIR developers. If you are developing AIR application and you want to use ContextMenu please be aware of possible problem on Windows platform. This is not problem on Mac, and it's not problem in Flash Player (even on Windows). It is problem just in AIR on Windows]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents for air-tip</h3><ol><li><a href='http://franto.com/airtips-problem-with-appxml-in-flex-3/' title='AirTip: Problem with app.xml in Flex 3'>AirTip: Problem with app.xml in Flex 3</a></li><li><a href='http://franto.com/airtip-air-application-gained-focus/' title='AirTip: AIR application gained focus'>AirTip: AIR application gained focus</a></li><li><a href='http://franto.com/airtip-list-all-of-your-drives-in-air-application/' title='AirTip: List all of your drives in AIR application'>AirTip: List all of your drives in AIR application</a></li><li><a href='http://franto.com/adobe-air-15-available-in-flex-sdk-nightly-builds/' title='Adobe AIR 1.5 available in Flex SDK Nightly builds'>Adobe AIR 1.5 available in Flex SDK Nightly builds</a></li><li>AIR Tip: ContextMenuItem can crash AIR app on Windows</li><li><a href='http://franto.com/air-tip-flash-movie-is-not-rendered-in-air-15-html-in-fullscreen/' title='AIR Tip: Flash movie is not rendered in AIR 1.5 HTML  in Fullscreen'>AIR Tip: Flash movie is not rendered in AIR 1.5 HTML  in Fullscreen</a></li></ol></div> <div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Fair-tip-contextmenuitem-can-crash-air-app-on-windows%2F&amp;text=AIR Tip: ContextMenuItem can crash AIR app on Windows&amp;count=vertical&amp;lang=en&amp;related=AIR,AIR+Tips,ContextMenu"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>This is just quick tip for all AIR developers. If you are developing AIR application and you want to use ContextMenu please be aware of possible problem on Windows platform. This is not problem on Mac, and it&#8217;s not problem in Flash Player (even on Windows). It is problem just in AIR on Windows (at least what I have find out till now).</p>
<p>Problem is as follow:</p>
<p>You want to have ContextMenu for some of your item (right click menu). You have created ContextMenu and want to add ContextMenuItem in this way</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> myItem<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">ContextMenuItem</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ContextMenuItem</span><span style="color: #000000;">&#40;</span>myItemName<span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>if variable myItemName is initialized or at least is empty string, all is ok. But there can situations when it is null. For example when you want to support multilanguage with ResourceManager, so it&#8217;s not correctly fill up and it&#8217;s null. In that case you AIR will crash and you will not know why, because it&#8217;s works on Mac, it works in FlashPlayer (without AIR), it just doesn work in AIR on Windows platform</p>
<p>So my quick fix was create fix function, like this</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> fixEmptyString<span style="color: #000000;">&#40;</span>val<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>val == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #990000;">''</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">return</span> val;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> myItem<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">ContextMenuItem</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">ContextMenuItem</span><span style="color: #000000;">&#40;</span>fixEmptyString<span style="color: #000000;">&#40;</span>myItemName<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>This will for sure.</p>
<p>Hope this helps you.</p>
<p><strong>P.S.</strong> I will post this and another useful AIR tips in my <strong><a title="Franto.com Tips &amp; Tricks, useful Flex, AIR, Flash, ActionScript Tips &amp; Tricks" href="http://www.franto.com/frantocom-tips-tricks">Franto.com Tips &amp; Tricks</a></strong>, so do not wait and subscribe to my list, if you find AIR tip this useful&#8230;</p>
 <div class='series_links'><a href='http://franto.com/adobe-air-15-available-in-flex-sdk-nightly-builds/' title='Adobe AIR 1.5 available in Flex SDK Nightly builds'>Previous in series</a> <a href='http://franto.com/air-tip-flash-movie-is-not-rendered-in-air-15-html-in-fullscreen/' title='AIR Tip: Flash movie is not rendered in AIR 1.5 HTML  in Fullscreen'>Next in series</a></div>]]></content:encoded>
			<wfw:commentRss>http://franto.com/air-tip-contextmenuitem-can-crash-air-app-on-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Franto.com Tips &amp; Tricks</title>
		<link>http://franto.com/frantocom-tips-tricks/</link>
		<comments>http://franto.com/frantocom-tips-tricks/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 10:02:13 +0000</pubDate>
		<dc:creator>Franto</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Flash Tips & Tricks]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Newsletter]]></category>

		<guid isPermaLink="false">http://www.franto.com/?p=581</guid>
		<description><![CDATA[I've created newsletter service for useful tips &#038; tricks for Flex, AIR, Flash, ActionScript. If you are developer and using this languages and tools on your daily basis, or just want to receive different tips &#038; tricks, please <a href="http://www.franto.com/subscribe-to-the-frantocom-tips-tricks" title="Franto.com Tips &#038; Tricks"><strong>Subscribe to Franto.com Tips &#038; Tricks</strong></a>.]]></description>
			<content:encoded><![CDATA[<div class="TweetButton_button" style="float: right; margin-left: 10px;;height:20px;margin-bottom:5px;"><a href="http://twitter.com/share?url=http%3A%2F%2Ffranto.com%2Ffrantocom-tips-tricks%2F&amp;text=Franto.com Tips &amp; Tricks&amp;count=vertical&amp;lang=en&amp;related=ActionScript,AIR,Flash,Flash+Tips+%26amp%3B+Tricks,Flex,Newsletter"><img src="http://franto.com/blog2/wp-content/plugins/tweetbutton-for-wordpress/images/tweet.png" style="border:none" /></a></div>
<p>I&#8217;ve created newsletter service for useful tips &#038; tricks for Flex, AIR, Flash, ActionScript. If you are developer and using this languages and tools on your daily basis, or just want to receive different tips &#038; tricks, please <a href="http://www.franto.com/subscribe-to-the-frantocom-tips-tricks" title="Franto.com Tips &#038; Tricks"><strong>Subscribe to Franto.com Tips &#038; Tricks</strong></a>. Don&#8217;t be afraid i will fill up your inbox, I&#8217;m planning to send 1 email per week. If there will be feedback from subscirbers to post it more often it can change in future.</p>
<p>If you prefer anything what should be inside <a href="http://www.franto.com/subscribe-to-the-frantocom-tips-tricks" title="Franto.com Tips &#038; Tricks"><strong>Franto.com Tips &#038; Tricks Newsletters</strong></a>, please let me know in comments or <a href="http://www.franto.com/contact-me">Contact Me.</a></p>
<form method="post" action="http://www.aweber.com/scripts/addlead.pl">
<input type="hidden" name="meta_web_form_id" value="1387149334"/>
<input type="hidden" name="meta_split_id" value=""/>
<input type="hidden" name="unit" value="franto"/>
<input type="hidden" name="redirect" value="http://www.franto.com/thank-you-for-subscribing-to-frantocom-tips-tricks" id="redirect_5319ed79a1470ba7649ed3d4b830811b"/>
<input type="hidden" name="meta_redirect_onlist" value="http://www.franto.com/already-subscribed-to-frantocom-tips-tricks"/>
<input type="hidden" name="meta_adtracking" value="franto_tips"/>
<input type="hidden" name="meta_message" value="1"/>
<input type="hidden" name="meta_required" value="from"/>
<input type="hidden" name="meta_forward_vars" value="0"/>
<div style="padding:20px 0px 40px 0px">
<table width="100%">
<tr>
<td colspan=2>
<h1>Subscribe to Franto.com Tips &amp; Tricks</h1>
</td>
</tr>
<tr height="25">
<td colspan=2>&nbsp;</td>
</tr>
<tr>
<td><strong>Name:</strong></td>
<td>
<input type="text" name="name" value="" size="50"/></td>
</tr>
<tr>
<td><strong>Your Email:</strong></td>
<td>
<input type="text" name="from" value="" size="50"/></td>
</tr>
<tr>
<td align="left" rowspan="5"><strong>Preferred Technology:</strong></td>
<td colspan="2">
<input type="radio" name="custom Preferred Technology" value="Flex"/> Flex</td>
</tr>
<tr>
<td colspan="2">
<input type="radio" name="custom Preferred Technology" value="AIR"/> AIR</td>
</tr>
<tr>
<td colspan="2">
<input type="radio" name="custom Preferred Technology" value="Flash"/> Flash</td>
</tr>
<tr>
<td colspan="2">
<input type="radio" name="custom Preferred Technology" value="ActionScript"/> ActionScript</td>
</tr>
<tr>
<td colspan="2">
<input type="radio" name="custom Preferred Technology" value="All" checked/> All</td>
</tr>
<tr>
<td colspan=2>
<p><span></span>By submitting your Email address you are subscribing to <strong>Franto.com Tips &amp; Tricks</strong>. You will receive usefull <strong>Flex, AIR, Flash, ActionScript Tips &amp; Tricks</strong> and other usefull information from development with <strong>Adobe</strong> Tools like <strong>Flex Builder</strong>, <strong>Flash</strong>, <strong>Photoshop </strong>and others&#8230; I will try to post Tips &amp; Tricks once per week, so you will not have halted your Inbox with them.</p>
<p>&nbsp;</td>
</tr>
<tr>
<td align="center" colspan="2">
<input type="submit" name="submit" value="Subscribe to the Franto.com Tips &#038; Tricks"/></td>
</tr>
</table>
<p><center><img src="http://forms.aweber.com/form/ci/?tc=FFFFFF&#038;bg=990000&#038;d=7IwMnEycPoLqpkamTj5MbBxs" style="margin-top: 8px;"/></center>
</div>
</form>
]]></content:encoded>
			<wfw:commentRss>http://franto.com/frantocom-tips-tricks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

