<?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>FLEX{er} &#187; Bugs</title>
	<atom:link href="http://www.flexer.info/category/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flexer.info</link>
	<description>flex developers web corner</description>
	<lastBuildDate>Mon, 26 Jul 2010 17:54:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://www.flexer.info</link>
  <url>http://www.flexer.info/favicon.ico</url>
  <title>FLEX{er}</title>
</image>
		<item>
		<title>New Versions of Flash Player and AIR Available</title>
		<link>http://www.flexer.info/2009/08/03/new-versions-of-flash-player-and-air-available/</link>
		<comments>http://www.flexer.info/2009/08/03/new-versions-of-flash-player-and-air-available/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 09:20:22 +0000</pubDate>
		<dc:creator>Andrei Ionescu</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[acrobat]]></category>
		<category><![CDATA[acrobat reader]]></category>
		<category><![CDATA[platform]]></category>
		<category><![CDATA[updates]]></category>

		<guid isPermaLink="false">http://www.flexer.info/?p=1027</guid>
		<description><![CDATA[Last end of the week has been a busy time for Adobe. They released quite a few updates to Flash and AIR platforms and some security updates for Flash Player, Acrobat Reader and Acrobat.
Now the last public version of Flash Player is 10.0.32.18 and can be downloaded from http://get.adobe.com/flashplayer/. The update refers to this security [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F08%2F03%2Fnew-versions-of-flash-player-and-air-available%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F08%2F03%2Fnew-versions-of-flash-player-and-air-available%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2009/08/03/new-versions-of-flash-player-and-air-available/&title=New+Versions+of+Flash+Player+and+AIR+Available&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>Last end of the week has been a busy time for Adobe. They released quite a few updates to Flash and AIR platforms and some security updates for Flash Player, Acrobat Reader and Acrobat.</p>
<p>Now the last public version of Flash Player is 10.0.32.18 and can be downloaded from <a href="http://get.adobe.com/flashplayer/" target="_blank">http://get.adobe.com/flashplayer/</a>. The update refers to <a href="http://www.adobe.com/support/security/bulletins/apsb09-10.html" target="_blank">this security bulletin (APSB09-10)</a>.</p>
<p>Regarding AIR the update is more about <a href="http://www.adobe.com/support/documentation/en/air/1_5_2/releasenotes_developers.html#fixedbugs" target="_blank">bug fixing</a> and <a href="http://www.adobe.com/support/documentation/en/air/1_5_2/releasenotes_developers.html#api" target="_blank">changes to API</a>. Find more reading <a href="http://www.adobe.com/support/documentation/en/air/1_5_2/releasenotes_developers.html" target="_blank">Release notes for Adobe AIR developers</a> on Adobe. The new 1.5.2 version of AIR can be downloaded from <a href="http://get.adobe.com/air/" target="_blank">http://get.adobe.com/air/</a>.</p>
<p>Bellow are some related links where you can find more&#8230;</p>
<p><a href="http://blogs.adobe.com/air/2009/07/adobe_air_152_now_available.html" target="_blank">http://blogs.adobe.com/air/2009/07/adobe_air_152_now_available.html</a><br />
<a href="http://www.adobe.com/support/documentation/en/air/1_5_2/releasenotes_developers.html" target="_blank">http://www.adobe.com/support/documentation/en/air/1_5_2/releasenotes_developers.html</a><br />
<a href="http://blogs.adobe.com/psirt/2009/07/update_to_apsb09-10_security_b.html" target="_blank">http://blogs.adobe.com/psirt/2009/07/update_to_apsb09-10_security_b.html</a><br />
<a href="http://www.adobe.com/devnet/flashplayer/articles/flash_player10.0.32_security_update.html" target="_blank">http://www.adobe.com/devnet/flashplayer/articles/flash_player10.0.32_security_update.html</a><br />
<a href="http://get.adobe.com/flashplayer/" target="_blank">http://get.adobe.com/flashplayer/</a><br />
<a href="http://get.adobe.com/air/" target="_blank">http://get.adobe.com/air/</a><br />
<a href="http://www.adobe.com/support/security/bulletins/apsb09-10.html" target="_blank">http://www.adobe.com/support/security/bulletins/apsb09-10.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2009/08/03/new-versions-of-flash-player-and-air-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filters Not Applied When The Image Size is Big</title>
		<link>http://www.flexer.info/2009/02/24/filters-not-applied-when-the-image-size-is-big/</link>
		<comments>http://www.flexer.info/2009/02/24/filters-not-applied-when-the-image-size-is-big/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 19:55:07 +0000</pubDate>
		<dc:creator>Andrei Ionescu</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[filters]]></category>

		<guid isPermaLink="false">http://www.flexer.info/?p=577</guid>
		<description><![CDATA[In a current project I run on the following problem: didn&#8217;t see a blur filter applied on a background. Started debugging and even though was no error neither compile errors nor runtime. But a the Flex Builder console panel, where traces appear, a special output text warning appeared:
Warning: Filter will not render. The DisplayObject&#8217;s filtered [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F02%2F24%2Ffilters-not-applied-when-the-image-size-is-big%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F02%2F24%2Ffilters-not-applied-when-the-image-size-is-big%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2009/02/24/filters-not-applied-when-the-image-size-is-big/&title=Filters+Not+Applied+When+The+Image+Size+is+Big&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>In a current project I run on the following problem: didn&#8217;t see a blur filter applied on a background. Started debugging and even though was no error neither compile errors nor runtime. But a the Flex Builder console panel, where traces appear, a special output text warning appeared:</p>
<blockquote><p>Warning: Filter will not render. The DisplayObject&#8217;s filtered dimensions ([width], [height]) are too large to be drawn.</p></blockquote>
<p>This text appears only when you are debugging. Tried to find where it resides but ended in <strong>playerglobal.swc</strong>.</p>
<p>Then searched on the internet but didn&#8217;t find anything. But found an old bug on Adobe Jira bug base and found a bug on this issue: <a href="https://bugs.adobe.com/jira/browse/SDK-775" target="_blank">https://bugs.adobe.com/jira/browse/SDK-775</a>. It says is old and closed but I&#8217;m still having it, although now it is not appearing at 1000 pixels.</p>
<p>By trial and error I found that the maximum allowed width and height to be able to apply the filter on a display object is 2875 pixels. So the filter will be applied on display objects with widths and heights like these: <strong>2000 x 2875</strong>, <strong>100 x 2875</strong>, <strong>W x 2875</strong>. But if you&#8217;ll try <strong>W x 2876</strong> the filter will not be applied. Also applying a filter on a <strong>2875 x 2875</strong> pixels object will not work. It seams that the product of the width and height of the object must not be over an arbitrary value that depends on the filter&#8217;s parameters. </p>
<p>All these were tried using the bellow application I created especially for this problem. To use it&#8230; first create the background with different widths and heights than apply the filter on it.</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_bigimagefilterapplyproblem_1917748735"
			class="flashmovie"
			width="600"
			height="680">
	<param name="movie" value="/wp-content/uploads/2009/02/bigimagefilterapplyproblem.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/2009/02/bigimagefilterapplyproblem.swf"
			name="fm_bigimagefilterapplyproblem_1917748735"
			width="600"
			height="680">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
<p>If any of you got into this error also please comment or contact us&#8230; maybe we will find a way to overcome the problem or to set some limits that everyone will know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2009/02/24/filters-not-applied-when-the-image-size-is-big/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Deep Linking with SWFAddress and IE6 problem</title>
		<link>http://www.flexer.info/2009/02/20/deep-linking-with-swfaddress-and-ie6-problem/</link>
		<comments>http://www.flexer.info/2009/02/20/deep-linking-with-swfaddress-and-ie6-problem/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 12:19:36 +0000</pubDate>
		<dc:creator>Andrei Ionescu</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flash Player]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[deep linking]]></category>

		<guid isPermaLink="false">http://www.flexer.info/?p=568</guid>
		<description><![CDATA[This week I&#8217;ve been working on a project that uses deep linking with SWFAddress library. SWFAddress is a useful tool that lets you go to a specified part of a flash site by changing the browser&#8217;s url.
Anyway this project was in part completed but had to do some changes and fix some bugs. Most bugs [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F02%2F20%2Fdeep-linking-with-swfaddress-and-ie6-problem%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2009%2F02%2F20%2Fdeep-linking-with-swfaddress-and-ie6-problem%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2009/02/20/deep-linking-with-swfaddress-and-ie6-problem/&title=Deep+Linking+with+SWFAddress+and+IE6+problem&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>This week I&#8217;ve been working on a project that uses deep linking with <a href="http://www.asual.com/swfaddress/" target="_blank">SWFAddress</a> library. SWFAddress is a useful tool that lets you go to a specified part of a flash site by changing the browser&#8217;s url.</p>
<p>Anyway this project was in part completed but had to do some changes and fix some bugs. Most bugs were found using Internet Explorer 6. If you wonder why IE6 in the era of Firefox and IE8, because today it has 25% of the market (but going down which is a very good thing) and the client needs to be compliant with it. IE6 is not working on Vista so I had to use a Virtual PC image of XP Sp3 to test with IE6. </p>
<p>The biggest bug found was related to SWFAddress Javascript classes. The site continued to jump from one page to another without no reason. I want to mention that this bug did not appeared on Firefox or IE8 or other browser and I have the following browsers for testing: Firefox, Opera, IE8, SeaMonkey and Google Chrome.</p>
<p>I did some research on Google and I found a comment, &#8220;Left by Niklas at Thu, 2 Nov 4:07 PM&#8221; on the following page: <a href="http://www.asual.com/blog/swfaddress/swfaddress-deep-linking-for-flash.html" target="_blank">http://www.asual.com/blog/swfaddress/swfaddress-deep-linking-for-flash.html</a>. That way I found that for IE6 the <strong>swfaddress.html</strong> file must be placed in the same folder where <strong>swfaddress.js</strong> resides. That didn&#8217;t resolved it then I started to test the examples from the SWFAddress zip file. </p>
<p>I&#8217;ve seen that in adobe folder is an approach like mine: use on Flash/Flex Javascript classes with SWFAddress. Tested it on IE6 and is working. Then i started comparing with my project. The difference was that in my project I used also the Flash/Flex history Javascript class. So I removed the following line from my project:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script src=&quot;history/history.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>That fixed my bug. Two this I had to do:</p>
<ol>
<li>add <strong>swfaddress.html</strong></li>
<li>remove the Flash/Flex history Javascript libraries</li>
</ol>
<p>As far us I noticed if you used <a href="http://code.google.com/p/swfobject/" target="_blank">SWFObject</a> with <a href="http://www.asual.com/swfaddress/" target="_blank">SWFAddress</a> this problem will not occur because, I think, SWFObject do not uses history.</p>
<p>I hope, in the future, to write an entire article dedicated to deep linking, but I need time for that.</p>
<p>Some resources bellow:<br />
<a href="http://www.asual.com/blog/swfaddress/swfaddress-deep-linking-for-flash.html" target="_blank">http://www.asual.com/blog/swfaddress/swfaddress-deep-linking-for-flash.html</a><br />
<a href="http://www.asual.com/swfaddress/" target="_blank">http://www.asual.com/swfaddress/</a><br />
<a href="http://code.google.com/p/swfobject/" target="_blank">http://code.google.com/p/swfobject/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2009/02/20/deep-linking-with-swfaddress-and-ie6-problem/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Number.toString bug</title>
		<link>http://www.flexer.info/2008/11/20/numbertostring-bug/</link>
		<comments>http://www.flexer.info/2008/11/20/numbertostring-bug/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:35:16 +0000</pubDate>
		<dc:creator>Virgil Cristea</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex 2]]></category>
		<category><![CDATA[Flex Builder 3]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[toString]]></category>
		<category><![CDATA[webservice]]></category>

		<guid isPermaLink="false">http://www.flexer.info/?p=326</guid>
		<description><![CDATA[Last week I had to write a small piece of code to send to a webservice a number from a text input. All was fine for the normal test values (0,1,100). The problem appeared when I tried to send the number -9223372036854775808. Instead of receiving this number I got -9223372036854776000.  So I started to do [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F11%2F20%2Fnumbertostring-bug%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F11%2F20%2Fnumbertostring-bug%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2008/11/20/numbertostring-bug/&title=Number.toString+bug&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>Last week I had to write a small piece of code to send to a webservice a number from a text input. All was fine for the normal test values (0,1,100). The problem appeared when I tried to send the number <strong>-9223372036854775808</strong>. Instead of receiving this number I got <strong>-9223372036854776000</strong>.  So I started to do some debugging I saw that the problem was in the soap functions from the Flex SDK when they did a <strong>number.toString()</strong>.</p>
<p>I did a small test project to verify that the issue is with the toString() function. Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>?<span style="color: #0066CC;">xml</span> <span style="color: #0066CC;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>mx:Application xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> <span style="color: #0066CC;">width</span>=<span style="color: #ff0000;">&quot;160&quot;</span> <span style="color: #0066CC;">height</span>=<span style="color: #ff0000;">&quot;70&quot;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:Script<span style="color: #66cc66;">&gt;</span>
		<span style="color: #66cc66;">&lt;!</span><span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span>
			<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
			<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> stringValue:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;-9223372036854775808&quot;</span>;
			<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
			<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> numberValue:<span style="color: #0066CC;">Number</span> = <span style="color: #0066CC;">Number</span><span style="color: #66cc66;">&#40;</span>stringValue<span style="color: #66cc66;">&#41;</span>;			
&nbsp;
			<span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> testToStringIssue<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
			<span style="color: #66cc66;">&#123;</span>
				lbl.<span style="color: #0066CC;">text</span> = numberValue.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;/</span>mx:Script<span style="color: #66cc66;">&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:Label x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #0066CC;">text</span>=<span style="color: #ff0000;">&quot;{stringValue}&quot;</span> id=<span style="color: #ff0000;">&quot;lbl&quot;</span><span style="color: #66cc66;">/&gt;</span>
	<span style="color: #66cc66;">&lt;</span>mx:<span style="color: #0066CC;">Button</span> x=<span style="color: #ff0000;">&quot;10&quot;</span> y=<span style="color: #ff0000;">&quot;36&quot;</span> label=<span style="color: #ff0000;">&quot;Button&quot;</span> click=<span style="color: #ff0000;">&quot;testToStringIssue();&quot;</span><span style="color: #66cc66;">/&gt;</span>	
<span style="color: #66cc66;">&lt;/</span>mx:Application<span style="color: #66cc66;">&gt;</span></pre></div></div>

<p>As you see we first display the stringValue and that is ok. Then we do a number <strong>toString()</strong> and display that result.<br />

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_testtostringissue_1831646814"
			class="flashmovie"
			width="160"
			height="70">
	<param name="movie" value="/wp-content/uploads/2008/11/testtostringissue.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="/wp-content/uploads/2008/11/testtostringissue.swf"
			name="fm_testtostringissue_1831646814"
			width="160"
			height="70">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2008/11/20/numbertostring-bug/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flash NULL pointer exploit</title>
		<link>http://www.flexer.info/2008/04/18/flash-null-pointer-exploit/</link>
		<comments>http://www.flexer.info/2008/04/18/flash-null-pointer-exploit/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 09:52:23 +0000</pubDate>
		<dc:creator>Virgil Cristea</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex in the world]]></category>
		<category><![CDATA[Flex news]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[pointer]]></category>

		<guid isPermaLink="false">http://www.flexer.info/2008/04/18/flash-null-pointer-exploit/</guid>
		<description><![CDATA[The paper &#8220;Application-Specific Attacks: Leveraging the ActionScript Virtual Machine&#8221; written by Mark Dowd in which he describes various techniques that promise to open up a class of exploits and vulnerability research previously thought to be prohibitively difficult. While the Flash vulnerability described in the paper [pdf] has been patched by Adobe, the presentation of a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F04%2F18%2Fflash-null-pointer-exploit%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F04%2F18%2Fflash-null-pointer-exploit%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2008/04/18/flash-null-pointer-exploit/&title=Flash+NULL+pointer+exploit&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>The paper &#8220;<strong>Application-Specific Attacks: Leveraging the ActionScript Virtual Machine</strong>&#8221; written by Mark Dowd in which he describes various techniques that promise to open up a class of exploits and vulnerability research previously thought to be prohibitively difficult. While the Flash vulnerability described in the paper [<a href="http://documents.iss.net/whitepapers/IBM_X-Force_WP_final.pdf" target="_blank">pdf</a>] has been patched by Adobe, the presentation of a reliable exploit for NULL pointer dereferencing has the researchers who have read the paper fascinated. Thomas Ptacek has an <a href="http://www.matasano.com/log/1032/this-new-vulnerability-dowds-inhuman-flash-exploit/" target="_blank">explanation </a>of Dowd&#8217;s work, and Nathan McFeters at ZDNet is &#8216;<a href="http://blogs.zdnet.com/security/?p=1030" target="_blank">stunned by the technical details</a>&#8216;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2008/04/18/flash-null-pointer-exploit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>toString() vs xmlToString()</title>
		<link>http://www.flexer.info/2008/01/29/tostring-vs-xmltostring/</link>
		<comments>http://www.flexer.info/2008/01/29/tostring-vs-xmltostring/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 15:20:37 +0000</pubDate>
		<dc:creator>Andrei Ionescu</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.flexer.info/2008/01/29/tostring-vs-xmltostring/</guid>
		<description><![CDATA[I don&#8217;t know if you got in trouble when working with xmls but recently I found a bug (or a feature). Some differences when using toString() and/or xmlToString().
Take a look a the following code:

public var test1:XML = new XML&#40;&#34;
&#60;permissions&#62;&#60;/permissions&#62;
&#34;&#41;;
public var test2:XML =
&#60;permissions&#62;&#60;/permissions&#62;;
&#160;
public var test3:XML = new XML&#40;&#34;
&#60;permissions&#62;
    &#60;test1&#62;test&#60;/test1&#62;
&#60;/permissions&#62;&#34;&#41;;
public var test4:XML =
&#60;permissions&#62;
  [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F01%2F29%2Ftostring-vs-xmltostring%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F01%2F29%2Ftostring-vs-xmltostring%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2008/01/29/tostring-vs-xmltostring/&title=toString()+vs+xmlToString()&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>I don&#8217;t know if you got in trouble when working with xmls but recently I found a bug (or a feature). Some differences when using toString() and/or xmlToString().</p>
<p>Take a look a the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> test1:<span style="color: #0066CC;">XML</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">XML</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;
&lt;permissions&gt;&lt;/permissions&gt;
&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> test2:<span style="color: #0066CC;">XML</span> =
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> test3:<span style="color: #0066CC;">XML</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">XML</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;
&lt;permissions&gt;
    &lt;test1&gt;test&lt;/test1&gt;
&lt;/permissions&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> test4:<span style="color: #0066CC;">XML</span> =
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>test1<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>test1<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> test5:<span style="color: #0066CC;">XML</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">XML</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;
&lt;permissions&gt;test&lt;/permissions&gt;
&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> test6:<span style="color: #0066CC;">XML</span> =
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span>;
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> init<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span>
<span style="color: #66cc66;">&#123;</span>
    debugWin.<span style="color: #0066CC;">text</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> respTest1:<span style="color: #0066CC;">String</span> = test1.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> respTest2:<span style="color: #0066CC;">String</span> = test2.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> respTest3:<span style="color: #0066CC;">String</span> = test1.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> respTest4:<span style="color: #0066CC;">String</span> = test2.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> respTest5:<span style="color: #0066CC;">String</span> = test3.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> respTest6:<span style="color: #0066CC;">String</span> = test4.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> respTest7:<span style="color: #0066CC;">String</span> = test3.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> respTest8:<span style="color: #0066CC;">String</span> = test4.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> respTest9:<span style="color: #0066CC;">String</span> = test5.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> respTest10:<span style="color: #0066CC;">String</span> = test6.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> respTest11:<span style="color: #0066CC;">String</span> = test5.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #000000; font-weight: bold;">var</span> respTest12:<span style="color: #0066CC;">String</span> = test6.<span style="color: #006600;">toXMLString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest1+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest2+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest3+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest4+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest5+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest6+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest7+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest8+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest9+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest10+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest11+<span style="color: #ff0000;">&quot;]&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
    debugWin.<span style="color: #0066CC;">text</span> += <span style="color: #ff0000;">&quot;[&quot;</span>+respTest12+<span style="color: #ff0000;">&quot;]&quot;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>The text inside the <strong>debugWin</strong> (this is a <strong>TextArea</strong>) is the following (the square brackets to see what&#8217;s the content of the strings):</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>test1<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>test1<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>test1<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>test1<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>test1<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>test1<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>test1<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>test1<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>test<span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span>test<span style="color: #66cc66;">&#93;</span>
&nbsp;
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span>
<span style="color: #66cc66;">&lt;</span>permissions<span style="color: #66cc66;">&gt;</span>test<span style="color: #66cc66;">&lt;/</span>permissions<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#93;</span></pre></div></div>

<p>As you can see whe using <strong>toString()</strong> on an empty node the return is null but when using <strong>xmlToString()</strong> on the same empty node the return is the containing empty node. The same happen also when using content but not child nodes, but is different if the node has child nodes in it. So I don&#8217;t know if this is a bug or a feature or this is the way it should behave.</p>
<p>If you have experience with XML please share it with us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2008/01/29/tostring-vs-xmltostring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a swf RSL from a swc and how to use it</title>
		<link>http://www.flexer.info/2008/01/08/how-to-create-a-swf-rsl-from-a-swc-and-how-to-use-it/</link>
		<comments>http://www.flexer.info/2008/01/08/how-to-create-a-swf-rsl-from-a-swc-and-how-to-use-it/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 21:11:13 +0000</pubDate>
		<dc:creator>Virgil Cristea</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex 2]]></category>
		<category><![CDATA[Flex resources]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[RSL]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.flexer.info/2008/01/08/how-to-create-a-swf-rsl-from-a-swc-and-how-to-use-it/</guid>
		<description><![CDATA[ In a previous article I told you about the benefits of RSL&#8217;s. But you need also to know how to create them from a swc and how to use them.
First step is to create a new &#8220;Flex Library Project&#8221;. Write all the code you want to have in it. Then in your main application [...]]]></description>
			<content:encoded><![CDATA[<div class='series_toc'><h3>Table of contents<!-- for RSL, Smaller applications --></h3><ol><li><a href='http://www.flexer.info/2008/01/07/how-to-make-your-applications-smaller-and-reduce-the-loading-time/' title='How to make your applications smaller and reduce the loading time?'>How to make your applications smaller and reduce the loading time?</a></li><li>How to create a swf RSL from a swc and how to use it</li><li><a href='http://www.flexer.info/2008/01/08/how-to-reduce-the-size-of-any-flex-app-using-rsl/' title='How to reduce the size of any flex app using RSL'>How to reduce the size of any flex app using RSL</a></li><li><a href='http://www.flexer.info/2008/01/08/rsl-further-details/' title='RSL further details'>RSL further details</a></li></ol></div> <div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F01%2F08%2Fhow-to-create-a-swf-rsl-from-a-swc-and-how-to-use-it%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2008%2F01%2F08%2Fhow-to-create-a-swf-rsl-from-a-swc-and-how-to-use-it%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2008/01/08/how-to-create-a-swf-rsl-from-a-swc-and-how-to-use-it/&title=How+to+create+a+swf+RSL+from+a+swc+and+how+to+use+it&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p> In a previous article I told you about the benefits of RSL&#8217;s. But you need also to know how to create them from a swc and how to use them.</p>
<p>First step is to create a new &#8220;Flex Library Project&#8221;. Write all the code you want to have in it. Then in your main application (or module or where you want to use the library you created) add a reference to that swc. Use the option &#8220;Merged into code&#8221; for the first stages of development.</p>
<p>Once you are happy with your library (works ok, no more code needs to go in) you need to change how you reference your swc, you need to change the link type to &#8220;Runtime shared library (RSL)&#8221;.</p>
<p>But RSL will only work (as far as I know it) with swf and you have a swc. So you need to pack your swc as a swf.  Here is how to do it:</p>
<p><code>mxmlc.exe -o=myRSLmodule.swf -file-specs=&lt;an as file form your swc&gt; -source-path=&lt;source path&gt;</code></p>
<p>an example from one of my modules:</p>
<p><code><br />
"c:\Program Files\Adobe\Flex Builder 2\Flex SDK 2\bin\mxmlc.exe" -o=d:\work\Flex\qUtils\bin\qUtils.swf -file-specs=d:\work\Flex\qUtils\src\com\qbic\desktop\desktop.as -source-path=d:\work\Flex\qUtils\src</code></p>
<p>Now you will have 2 files the swc and the swf.</p>
<p>All you have to do is to edit the old reference to the swc:</p>
<ol>
<li>go to project properties</li>
<li>flex build path</li>
<li>library path</li>
<li>extend the node that shows your initial reference</li>
<li>double click on Link type</li>
<li>change the link type to &#8220;Resource shared library (RSL)&#8221;</li>
<li>enter the URL to your swf(yes you need to upload the swf and the swc before you get to this point <img src='http://www.flexer.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</li>
<li><strong>Un-check the &#8220;Auto extract swf to RSL URL&#8221; option</strong></li>
<li>Click on Source Attachement (not double-click)</li>
<li>click on the remove button</li>
</ol>
<p>That is it! You now have an RSL included in the project.</p>
<p>Advantages of using RSL:</p>
<ol>
<li>Code reuse</li>
<li>swf that contains the RSL code will be cached by the web-server and by the client browser</li>
<li>Smaller download size if the application uses several modules that will need some common code (the RSL code)</li>
<li>Faster download</li>
</ol>
<p>Dis-advantages:</p>
<ol>
<li>Because of the local or network sandbox in flex you will not be able to start your application from local filesystem. You will need to deploy the application</li>
<li>If you deploy the application keep in mind the security sandbox that can prevent cross-domain scripting (application hosted to a domain and the RSL to another). You can use the crossdomain.xml file to resolve this problem.</li>
<li>This method is unsupported by ADOBE. It is in fact a hack. The Adobe team is working on improving support for RSL&#8217;s in Flex Builder 3.</li>
<li>If you will host your application on a different server (even on the same server can have this problem) you are open to a man in the middle type attack. Or if someone will hack that server and replace the swf with his own.</li>
</ol>
<p>Even if there seems less advantages for using this the bandwidth you saved with this method and the smaller loading time of the application will make you choose this approach.</p>
<p>Last word: Once you have finished working on a module or the application I suggest you compile it using the &#8220;no debug&#8221; option in order to further reduce the size (and also increase the performance) of your application. And yes you can use a RSL build with &#8220;no debug&#8221; in an application that is compiled with debug turned on (development phase)</p>
<p><code>compc -debug=false ...<br />
</code></p>
 <div class='series_links'><a href='http://www.flexer.info/2008/01/07/how-to-make-your-applications-smaller-and-reduce-the-loading-time/' title='How to make your applications smaller and reduce the loading time?'>Previous in series</a> <a href='http://www.flexer.info/2008/01/08/how-to-reduce-the-size-of-any-flex-app-using-rsl/' title='How to reduce the size of any flex app using RSL'>Next in series</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2008/01/08/how-to-create-a-swf-rsl-from-a-swc-and-how-to-use-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Scroll Mask</title>
		<link>http://www.flexer.info/2007/11/30/scroll-mask/</link>
		<comments>http://www.flexer.info/2007/11/30/scroll-mask/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 07:34:08 +0000</pubDate>
		<dc:creator>Stelian Crisan</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex 2]]></category>

		<guid isPermaLink="false">http://www.flexer.info/2007/11/30/scroll-mask/</guid>
		<description><![CDATA[I was working to a flex project, I need a canvas where I have to put some elements on a big surface, so I really need to have scrollbars. That&#8217;s fine. If I move an object to the right-bottom corner it&#8217;s working great, if the object goes out of working space, will go under scrollbars, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2007%2F11%2F30%2Fscroll-mask%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2007%2F11%2F30%2Fscroll-mask%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2007/11/30/scroll-mask/&title=Scroll+Mask&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>I was working to a flex project, I need a canvas where I have to put some elements on a big surface, so I really need to have scrollbars. That&#8217;s fine. If I move an object to the right-bottom corner it&#8217;s working great, if the object goes out of working space, will go under scrollbars, and other object that are on the stage.</p>
<p>But if we drag an object to left-top corner of our working space this will move over the other elements, because the mask it&#8217;s not active until scrollbars are active. Don&#8217;t try to activate your self, it&#8217;s not working <img src='http://www.flexer.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I try to activate scrollbars when I create my canvas &#8230; and nothing <img src='http://www.flexer.info/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  &#8230; I search into manual and &#8230;. let me quote this : &#8220;The mask. This property may be undefined if no scroll bars are currently displayed or in some subclasses which have a different masking mechanism. A mask defined the viewable area of a displayable object. Thus this mask is used to hide the portions of the content that are not currently viewable. In general you do not access this property directly. Manipulation of the horizontalScrollPolicy, verticalScrollPolicy, horizontalScrollPosition, and verticalScrollPosition properties should provide sufficient control over the mask. &#8220;.</p>
<p>As a observation controlling  horizontalScrollPolicy, verticalScrollPolicy, horizontalScrollPosition, and verticalScrollPosition properties it&#8217;s not activating ScrollBase mask always.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2007/11/30/scroll-mask/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deep Object Copy</title>
		<link>http://www.flexer.info/2007/10/25/deep-object-copy/</link>
		<comments>http://www.flexer.info/2007/10/25/deep-object-copy/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 14:12:29 +0000</pubDate>
		<dc:creator>Virgil Cristea</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex 2]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.flexer.info/2007/10/25/deep-object-copy/</guid>
		<description><![CDATA[I wanted to write a few words about the deep object copying in flex (aka as making an absolute identical replica of an object no matter it&#8217;s class).
There is a function in the flex API called  ObjectUtil.copy This is a very nice function but the problem is it cannot work on all object classes. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2007%2F10%2F25%2Fdeep-object-copy%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2007%2F10%2F25%2Fdeep-object-copy%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2007/10/25/deep-object-copy/&title=Deep+Object+Copy&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>I wanted to write a few words about the deep object copying in flex (aka as making an absolute identical replica of an object no matter it&#8217;s class).</p>
<p>There is a function in the flex API called  <a href="http://livedocs.adobe.com/flex/201/langref/mx/utils/ObjectUtil.html#copy%28%29" target="_blank">ObjectUtil.copy</a> This is a very nice function but the problem is it cannot work on all object classes. How can you handle those cases? You can make your own function for deep copy but that includes you need to know all about the object structure.</p>
<p>Let&#8217;s take a quick look at how Flex copies objects:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> buffer:ByteArray = <span style="color: #000000; font-weight: bold;">new</span> ByteArray<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
buffer.<span style="color: #006600;">writeObject</span><span style="color: #66cc66;">&#40;</span>value<span style="color: #66cc66;">&#41;</span>;
buffer.<span style="color: #0066CC;">position</span> = <span style="color: #cc66cc;">0</span>;
<span style="color: #000000; font-weight: bold;">var</span> result:<span style="color: #0066CC;">Object</span> = buffer.<span style="color: #006600;">readObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">return</span> result;</pre></div></div>

<p>It looks pretty interesting, no? What it does: instead of introspection and recursively copying properties from one object to another it will serialize the object as an array of bytes and then de-serialize it.</p>
<p>Using AMF means that some strange things might happen: Casts back to the original object class may fail, and the [Transient] metadata tag can affect the output.</p>
<p>So when the object is de-serialized  it will not be created as an instance of a class (even if it has all the properties). In order to be able to have this you can inform AMF about the object class. You can do this in 2 ways:</p>
<ul>
<li>use [RemoteClass] metadata</li>
<li>use registerClassAlias()</li>
</ul>
<p>The first method although is much nicer may not work ok in all cases as it seems that the remote class information is stripped from the byte array in some cases.</p>
<p>Let&#8217;s see how to use the registerClassAlias:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// TestClass doesn't have [RemoteClass] metadata or</span>
<span style="color: #808080; font-style: italic;">// it does not work, so we need to make an association between</span>
<span style="color: #808080; font-style: italic;">//the TestClass and the full qualified name (com.qbic.tests.TestClass)</span>
registerClassAlias<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;com.qbic.tests.TestClass&quot;</span>,TestClass<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// Now we can cast the result of the copy without errors.</span>
<span style="color: #000000; font-weight: bold;">var</span> testCopy:TestClass = TestClass<span style="color: #66cc66;">&#40;</span>ObjectUtil.<span style="color: #0066CC;">copy</span><span style="color: #66cc66;">&#40;</span>test<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Even if this is a nice and very effective method it has one flaw: it does not work with BitmapData. But here is a workaround for this issue:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> copyBitmap<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span>: DisplayObject<span style="color: #66cc66;">&#41;</span> : Bitmap
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #808080; font-style: italic;">// Create the bitmap data object with the right size.</span>
  <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">data</span> : BitmapData = <span style="color: #000000; font-weight: bold;">new</span> BitmapData<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">width</span>, <span style="color: #0066CC;">target</span>.<span style="color: #0066CC;">height</span>, <span style="color: #000000; font-weight: bold;">true</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #808080; font-style: italic;">// Draw the target object into the bitmap data.</span>
  <span style="color: #0066CC;">data</span>.<span style="color: #006600;">draw</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #808080; font-style: italic;">// Create a new bitmap object associated with this data.</span>
  <span style="color: #000000; font-weight: bold;">var</span> bitmap: Bitmap = <span style="color: #000000; font-weight: bold;">new</span> Bitmap<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">data</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #b1b100;">return</span> bitmap;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Follow-up of: <a href="http://www.flexer.info/2007/10/25/transient-metadata-tag/">Transient</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2007/10/25/deep-object-copy/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Constant XML not so constant?</title>
		<link>http://www.flexer.info/2007/10/25/constant-xml-not-so-constant/</link>
		<comments>http://www.flexer.info/2007/10/25/constant-xml-not-so-constant/#comments</comments>
		<pubDate>Thu, 25 Oct 2007 12:45:22 +0000</pubDate>
		<dc:creator>Virgil Cristea</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Flex 2]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[constant]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.flexer.info/2007/10/25/constant-xml-not-so-constant/</guid>
		<description><![CDATA[It seems that the constants behave strangely in Flex.
Here is why:

public const X:String = &#34;X&#34;;
public const Y:int = 101;
public const NotSoConstant:XML = ...some random xml...

Now here comes the fun part:

var x:string = X;
x = &#34;aaa&#34;;
trace&#40;X + &#34;:&#34; + x&#41;; // X:aaa
var y:int = Y;
y = 10;
trace&#40;Y +&#34;:&#34; + y&#41;; //101:10
var constantOrNot:XML = NotSoConstant;
constantOrNot = ...another [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.flexer.info%2F2007%2F10%2F25%2Fconstant-xml-not-so-constant%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.flexer.info%2F2007%2F10%2F25%2Fconstant-xml-not-so-constant%2F" height="61" width="51" /></a></div><div style="float: right; margin-right: 10px"><a class="google_buzz"  
href="http://www.google.com/reader/link?url=http://www.flexer.info/2007/10/25/constant-xml-not-so-constant/&title=Constant+XML+not+so+constant?&srcURL=http://www.flexer.info" target="_blank" rel="nofollow"><img
src="http://www.flexer.info/wp-content/plugins/google-buzz-button-for-wordpress/images/google-buzz.png" alt="Google Buzz" /></a></div><p>It seems that the constants behave strangely in Flex.</p>
<p>Here is why:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">public</span> const X:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;X&quot;</span>;
<span style="color: #0066CC;">public</span> const Y:<span style="color: #0066CC;">int</span> = <span style="color: #cc66cc;">101</span>;
<span style="color: #0066CC;">public</span> const NotSoConstant:<span style="color: #0066CC;">XML</span> = ...<span style="color: #006600;">some</span> <span style="color: #0066CC;">random</span> <span style="color: #0066CC;">xml</span>...</pre></div></div>

<p>Now here comes the fun part:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> x:<span style="color: #0066CC;">string</span> = X;
x = <span style="color: #ff0000;">&quot;aaa&quot;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>X + <span style="color: #ff0000;">&quot;:&quot;</span> + x<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// X:aaa</span>
<span style="color: #000000; font-weight: bold;">var</span> y:<span style="color: #0066CC;">int</span> = Y;
y = <span style="color: #cc66cc;">10</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>Y +<span style="color: #ff0000;">&quot;:&quot;</span> + y<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">//101:10</span>
<span style="color: #000000; font-weight: bold;">var</span> constantOrNot:<span style="color: #0066CC;">XML</span> = NotSoConstant;
constantOrNot = ...<span style="color: #006600;">another</span> <span style="color: #0066CC;">xml</span>...</pre></div></div>

<p>Now you would think that <em>constantOrNot</em> will be different from <em>NotSoConstant</em>? You would be wrong. It seems that in the cases of XML objects the initial setup of the <em>constantOrNot</em> is done by using a reference pointer. So if you modify the <em>constantOrNot</em> it will also modify the constant it was used to set it up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexer.info/2007/10/25/constant-xml-not-so-constant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
