<?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>DoNotYet.com &#187; Flex</title>
	<atom:link href="http://www.donotyet.com/category/adobe-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.donotyet.com</link>
	<description>Freebie Resources for Tech Users, AIR, Flex, Flash Developers and Photoshop, web Designers</description>
	<lastBuildDate>Wed, 07 Dec 2011 06:35:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ASZip: A Very Useful ActionScript 3 library to Generate ZIP file with Simple Interface</title>
		<link>http://www.donotyet.com/2009/09/27/aszip-a-very-useful-actionscript-3-library-to-generate-zip-file-with-simple-interface/</link>
		<comments>http://www.donotyet.com/2009/09/27/aszip-a-very-useful-actionscript-3-library-to-generate-zip-file-with-simple-interface/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 13:49:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[ASZip]]></category>
		<category><![CDATA[ZIP]]></category>

		<guid isPermaLink="false">http://www.donotyet.com/2009/09/27/aszip-a-very-useful-actionscript-3-library-to-generate-zip-file-with-simple-interface/</guid>
		<description><![CDATA[Because a zip file permits a number of compression algorithms so a ZIP file contains one or more files. FZip is a cute little Actionscript 3 class library, it parses ZIP archives progressively, allowing access to contained files while the archive is loading(@see Actionscript 3 class zip library&#8211;FZip).
Now we will introduce an other actionscript zip [...]]]></description>
			<content:encoded><![CDATA[<p>Because a zip file permits a number of compression algorithms so a ZIP file contains one or more files. FZip is a cute little Actionscript 3 class library, it parses ZIP archives progressively, allowing access to contained files while the archive is loading(@see <a href="http://ntt.cc/2008/01/19/actionscript-class-library-fzip.html">Actionscript 3 class zip library&#8211;FZip</a>).</p>
<p>Now we will introduce an other actionscript zip library: ASZip.&#160; You can generate ZIP files from ActionScript 3 with ASZip. ASZip uses the native gzip (Deflate) compression from the flash.utils.Bytearray.compress() method. More compression algorithms will be added in the future. ASZip has simple interface to add different types of files and directories.</p>
<div style="margin: 0px 0px 0px 0px;"><script type="text/javascript"><!--
google_ad_client = "pub-7859640280892154";
/* DoNotYet-Article-336-280-01 */
google_ad_slot = "0432827541";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p><span id="more-320"></span>  </p>
<p><a href="http://www.donotyet.com/wp-content/uploads/2009/09/WindowsLiveWritercee7efc5f127_14221ASZip-ActionScript-3-library_2.jpg"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="ASZip-ActionScript-3-library" src="http://www.donotyet.com/wp-content/uploads/2009/09/WindowsLiveWritercee7efc5f127_14221ASZip-ActionScript-3-library_thumb.jpg" width="500" height="500" /></a> </p>
<p>The following is a simple sample to generate a text file and PNG file to a zip file:</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: #ffa500;">// create the Zip file, first param : compression method</span></li>
<li><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">myZip</span><span style="color: Gray;">:</span><span style="color: Blue;">ASZip</span><span style="color: Gray;"> = </span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Blue;">ASZip</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Blue;">CompressionMethod</span><span style="color: Gray;">.</span><span style="color: Blue;">GZIP</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// create a flash.display.BitmapData</span></li>
<li><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">myStevie</span><span style="color: Gray;">:</span><span style="color: Blue;">Stevie</span><span style="color: Gray;"> = </span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Blue;">Stevie</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Maroon;">0</span><span style="color: Gray;">, </span><span style="color: Maroon;">0</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// encode it as a PNG</span></li>
<li><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">bytes</span><span style="color: Gray;">:</span><span style="color: Blue;">ByteArray</span><span style="color: Gray;"> = </span><span style="color: Blue;">PNGEnc</span><span style="color: Gray;">.</span><span style="color: Blue;">encode</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Blue;">myStevie</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// create a text stream</span></li>
<li><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">txt</span><span style="color: Gray;">:</span><span style="color: Blue;">ByteArray</span><span style="color: Gray;"> = </span><span style="color: Green;">new</span><span style="color: Gray;"> </span><span style="color: Blue;">ByteArray</span><span style="color: Olive;">()</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// write some text into it</span></li>
<li><span style="color: Blue;">txt</span><span style="color: Gray;">.</span><span style="color: Blue;">writeUTFBytes</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">Hello there !!</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// add a pics folder</span></li>
<li><span style="color: Blue;">myZip</span><span style="color: Gray;">.</span><span style="color: Blue;">addDirectory</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">pics/</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// then a text folder</span></li>
<li><span style="color: Blue;">myZip</span><span style="color: Gray;">.</span><span style="color: Blue;">addDirectory</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">text/</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// pass the PNG stream and specify a file name and location</span></li>
<li><span style="color: Blue;">myZip</span><span style="color: Gray;">.</span><span style="color: Blue;">addFile</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: Blue;">bytes</span><span style="color: Gray;">, </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">pics/stevie.png</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// pass the text stream and specify a file name and location</span></li>
<li><span style="color: Blue;">myZip</span><span style="color: Gray;">.</span><span style="color: Blue;">addFile</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: Blue;">txt</span><span style="color: Gray;">, </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">text/story.txt</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// add a comment</span></li>
<li><span style="color: Blue;">myZip</span><span style="color: Gray;">.</span><span style="color: Blue;">addComment</span><span style="color: Gray;">&nbsp;</span><span style="color: Olive;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">A comment !</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li>
<li><span style="color: #ffa500;">// generate final Zip file</span></li>
<li><span style="color: Green;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: Blue;">myZipFile</span><span style="color: Gray;">:</span><span style="color: Blue;">ByteArray</span><span style="color: Gray;"> = </span><span style="color: Blue;">myZip</span><span style="color: Gray;">.</span><span style="color: Blue;">saveZIP</span><span style="color: Gray;"> </span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Blue;">Method</span><span style="color: Gray;">.</span><span style="color: Blue;">LOCAL</span><span style="color: Gray;"> </span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li></ol></div>
<p>You can download the source from: <a title="http://code.google.com/p/aszip/downloads/list" href="http://code.google.com/p/aszip/downloads/list">http://code.google.com/p/aszip/downloads/list</a></p>
<p><a title="http://ntt.cc/2008/01/19/actionscript-class-library-fzip.html" href="http://ntt.cc/2008/01/19/actionscript-class-library-fzip.html">&#160;</a></p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.donotyet.com/2010/01/14/7-actionscript-class-let-you-using-xml-easily/" title="7+ ActionScript Class Let You Using XML Easily">7+ ActionScript Class Let You Using XML Easily</a></li>
<li><a href="http://www.donotyet.com/2009/08/28/how-to-wait-or-sleep-in-flex-actionscript/" title="How to Wait or Sleep in Flex/ActionScript">How to Wait or Sleep in Flex/ActionScript</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.donotyet.com/2009/09/27/aszip-a-very-useful-actionscript-3-library-to-generate-zip-file-with-simple-interface/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Wait or Sleep in Flex/ActionScript</title>
		<link>http://www.donotyet.com/2009/08/28/how-to-wait-or-sleep-in-flex-actionscript/</link>
		<comments>http://www.donotyet.com/2009/08/28/how-to-wait-or-sleep-in-flex-actionscript/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 14:52:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Sleep]]></category>

		<guid isPermaLink="false">http://www.donotyet.com/2009/08/28/how-to-wait-or-sleep-in-flex-actionscript/</guid>
		<description><![CDATA[If you want to upload a big file to server or do a long time action in Flex/ActionScript like HTTPService to communicate with an external server that hosts the database, a time delay function like Sleep() will be needed. 
So, is there a sleep function in flex 2 ? Run multi-thread, one sleep and wait [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to upload a big file to server or do a long time action in Flex/ActionScript like HTTPService to communicate with an external server that hosts the database, a time delay function like Sleep() will be needed. </p>
<p>So, is there a sleep function in flex 2 ? Run multi-thread, one sleep and wait the result of this thread and the other will be continue.</p>
<p>Unfortunatly, because the flash player, from our perspective, is single threaded so we can not do that.</p>
<div style="margin: 0px 0px 0px 0px;"><script type="text/javascript"><!--
google_ad_client = "pub-7859640280892154";
/* DoNotYet-Article-336-280-01 */
google_ad_slot = "0432827541";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p><span id="more-145"></span>  </p>
<p><a href="http://www.donotyet.com/wp-content/uploads/2009/08/WindowsLiveWriterHowtoWaitorSleepinFlexActionScript_14F96Sleep-and-wait-in-Flex_2.png"><img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="Sleep-and-wait-in-Flex" src="http://www.donotyet.com/wp-content/uploads/2009/08/WindowsLiveWriterHowtoWaitorSleepinFlexActionScript_14F96Sleep-and-wait-in-Flex_thumb.png" width="504" height="372" /></a> </p>
<p>But we can flash.utils.Timer to get the same effect:</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Blue;">setTimout</span><span style="color: Olive;">(</span><span style="color: Gray;"> </span><span style="color: Blue;">yourFunction</span><span style="color: Gray;"> ,</span><span style="color: Maroon;">200</span><span style="color: Olive;">)</span><span style="color: Gray;">;</span></li></ol></div>
<p>This function will call yourFunction after waiting 200 milliseconds.
<p>The explanation of setTimeout() function:</p>
<blockquote><p>Runs a specified function after a specified delay (in milliseconds). </p>
<p>Instead of using this method, consider creating a Timer object, with the specified interval, using 1 as the <code>repeatCount</code> parameter (which sets the timer to run only once).</p>
<p>If you intend to use the <code>clearTimeout()</code> method to cancel the <code>setTimeout()</code> call, be sure to assign the <code>setTimeout()</code> call to a variable (which the <code>clearTimeout()</code> function will later reference). If you do not call the <code>clearTimeout()</code> function to cancel the <code>setTimeout()</code> call, the object containing the set timeout closure function will not be garbage collected. </p>
<p> setTimeout():</p>
<p>Runs a specified function after a specified delay (in milliseconds). </p>
<p>Instead of using this method, consider creating a Timer object, with the specified interval, using 1 as the <code>repeatCount</code> parameter (which sets the timer to run only once).</p>
<p>If you intend to use the <code>clearTimeout()</code> method to cancel the <code>setTimeout()</code> call, be sure to assign the <code>setTimeout()</code> call to a variable (which the <code>clearTimeout()</code> function will later reference). If you do not call the <code>clearTimeout()</code> function to cancel the <code>setTimeout()</code> call, the object containing the set timeout closure function will not be garbage collected. </p>
</blockquote>
<p>Here is the list of functions for timing code execution: <a title="http://livedocs.adobe.com/flex/3/langref/flash/utils/package.html" href="http://livedocs.adobe.com/flex/3/langref/flash/utils/package.html">http://livedocs.adobe.com/flex/3/langref/flash/utils/package.html</a></p>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.donotyet.com/2010/01/14/7-actionscript-class-let-you-using-xml-easily/" title="7+ ActionScript Class Let You Using XML Easily">7+ ActionScript Class Let You Using XML Easily</a></li>
<li><a href="http://www.donotyet.com/2009/09/27/aszip-a-very-useful-actionscript-3-library-to-generate-zip-file-with-simple-interface/" title="ASZip: A Very Useful ActionScript 3 library to Generate ZIP file with Simple Interface">ASZip: A Very Useful ActionScript 3 library to Generate ZIP file with Simple Interface</a></li>
<li><a href="http://www.donotyet.com/2009/08/15/an-example-of-how-to-load-flashpaper-in-flex/" title="An example of How to load FlashPaper in Flex(with source code)">An example of How to load FlashPaper in Flex(with source code)</a></li>
<li><a href="http://www.donotyet.com/2009/08/09/5-very-beautiful-skins-for-flex-applications/" title="5+ Very Beautiful Skins for Flex Applications">5+ Very Beautiful Skins for Flex Applications</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.donotyet.com/2009/08/28/how-to-wait-or-sleep-in-flex-actionscript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An example of How to load FlashPaper in Flex(with source code)</title>
		<link>http://www.donotyet.com/2009/08/15/an-example-of-how-to-load-flashpaper-in-flex/</link>
		<comments>http://www.donotyet.com/2009/08/15/an-example-of-how-to-load-flashpaper-in-flex/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 13:23:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[FlashPaper]]></category>
		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://www.donotyet.com/2009/08/15/an-example-of-how-to-load-flashpaper-in-flex/</guid>
		<description><![CDATA[FlashPaper is very useful, we can create web-ready Flash documents or secure, compact PDF files from any printable document in just one click with FlashPaper.&#160; The following is some main feature of FlashPaper introduced on the offical site: 

Easily create or e-mail any Microsoft Office document as a Flash document or PDF 
Instantly secure sensitive [...]]]></description>
			<content:encoded><![CDATA[<p>FlashPaper is very useful, we can create web-ready Flash documents or secure, compact PDF files from any printable document in just one click with FlashPaper.&#160; The following is some main feature of FlashPaper introduced on the offical site: </p>
<ul>
<li>Easily create or e-mail any Microsoft Office document as a Flash document or PDF </li>
<li>Instantly secure sensitive medical, legal or business documents </li>
<li>Streamline document distribution with highly compressed files </li>
<li>Create universally accessible files that are viewable on any platform </li>
<li>Quickly capture web pages and HTML </li>
<li>Create online newsletters, flyers and marketing materials </li>
</ul>
<div style="margin: 0px 0px 0px 0px;"><script type="text/javascript"><!--
google_ad_client = "pub-7859640280892154";
/* DoNotYet-Article-336-280-01 */
google_ad_slot = "0432827541";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p><span id="more-134"></span>  </p>
<p><a href="http://www.donotyet.com/wp-content/uploads/2009/08/WindowsLiveWriterAnexampleofHowtoloadFlashPaperinFlex_1340FAdobe-FlashPaper_1808g_2.png"><img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="Adobe-FlashPaper_1808g" src="http://www.donotyet.com/wp-content/uploads/2009/08/WindowsLiveWriterAnexampleofHowtoloadFlashPaperinFlex_1340FAdobe-FlashPaper_1808g_thumb.png" width="500" height="273" /></a> </p>
<p>But if you are a flex developer, who has ever tried to load a FlashPaper document within a Flex application, then you should know it&#8217;s not so simple. The problem is: when a FlashPaper SWF is loaded in the flash player directly, as window is resized the area available for the document resizes, but the toolbars at the top stay the same height. Here is a sample on how to load FlashPaper in Flex, you can download full source code from <img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="download" src="http://www.donotyet.com/wp-content/uploads/2009/07/download.png" width="19" height="19" /><a href="http://www.donotyet.com/ext/An-example-of-How-to-load-FlashPaper-in-Flex/flexLoadFp.zip" target="_blank">here</a>.</p>
<p>Flex souce code:</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline"><span style="color: Olive;">&lt;</span><span style="color: Gray;"> ?</span><span style="color: Green;">xml</span><span style="color: Gray;"> </span><span style="color: #00008b;">version</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">1.0</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">encoding</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">utf-8</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">?&gt;</span></li>
<li><span style="color: Olive;">&lt;</span><span style="color: Green;">mx</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">:WindowedApplication</span><span style="color: Gray;"> </span><span style="color: #00008b;">xmlns:mx</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">http://www.adobe.com/2006/mxml</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">layout</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">absolute</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">creationComplete</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">initType()</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">&lt;/</span><span style="color: Green;">mx</span><span style="color: Olive;">&gt;&lt;</span><span style="color: Green;">mx</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">:Script</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Gray;"> ![</span><span style="color: #00008b;">CDATA</span><span style="color: Gray;">[</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">import</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">com</span><span style="color: Gray;">.</span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">FlashPaperLoader</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><span style="color: Green;">flashpaper</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">private</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">var</span><span style="color: Gray;"> </span><span style="color: #00008b;">magReader:FlashPaperLoader</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">private</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">function</span><span style="color: Gray;"> </span><span style="color: #00008b;">initType</span><span style="color: Gray;">()</span><span style="color: #00008b;">:void</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">var</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">urlStr:String</span><span style="color: Gray;"> = </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">Fpl.swf?url=template.swf</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;"> = </span><span style="color: #00008b;">new</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">FlashPaperLoader</span><span style="color: Gray;">();</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">source</span><span style="color: Gray;"> = </span><span style="color: #00008b;">urlStr</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">visible</span><span style="color: Gray;"> = </span><span style="color: #00008b;">false</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">addChild</span><span style="color: Gray;">(</span><span style="color: #00008b;">magReader</span><span style="color: Gray;">);</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><span style="color: Green;">loadingBar</span><span style="color: Gray;">.</span><span style="color: #00008b;">visible</span><span style="color: Gray;"> = </span><span style="color: #00008b;">true</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">addEventListener</span><span style="color: Gray;">(</span><span style="color: #00008b;">FlashPaperLoader</span><span style="color: Gray;">.</span><span style="color: #00008b;">FLASH_PAPER_LOADED</span><span style="color: Gray;">,</span><span style="color: #00008b;">fpLoaded</span><span style="color: Gray;">);</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><span style="color: Green;">flashpaper</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">private</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">function</span><span style="color: Gray;"> </span><span style="color: #00008b;">fpLoaded</span><span style="color: Gray;">(</span><span style="color: #00008b;">evt:Event</span><span style="color: Gray;">)</span><span style="color: #00008b;">:void</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><span style="color: Green;">trace</span><span style="color: Gray;">(</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">magContainer width = </span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> + </span><span style="color: #00008b;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">width</span><span style="color: Gray;"> + </span><span style="color: #8b0000;">&quot;</span><span style="color: Red;"> magContainer height = </span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> + </span><span style="color: #00008b;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">height</span><span style="color: Gray;">);</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">setSize</span><span style="color: Gray;">(</span><span style="color: #00008b;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">width</span><span style="color: Gray;">,</span><span style="color: #00008b;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">height</span><span style="color: Gray;">);</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">visible</span><span style="color: Gray;"> = </span><span style="color: #00008b;">true</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><span style="color: Green;">loadingBar</span><span style="color: Gray;">.</span><span style="color: #00008b;">visible</span><span style="color: Gray;"> = </span><span style="color: #00008b;">false</span><span style="color: Gray;">;</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //</span><span style="color: Green;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">removeChild</span><span style="color: Gray;">(</span><span style="color: #00008b;">loadingBar</span><span style="color: Gray;">);</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">removeEventListener</span><span style="color: Gray;">(</span><span style="color: #00008b;">FlashPaperLoader</span><span style="color: Gray;">.</span><span style="color: #00008b;">FLASH_PAPER_LOADED</span><span style="color: Gray;">,</span><span style="color: #00008b;">fpLoaded</span><span style="color: Gray;">);</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">public</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">function</span><span style="color: Gray;"> </span><span style="color: #00008b;">changSize</span><span style="color: Gray;">()</span><span style="color: #00008b;">:void</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">if</span><span style="color: Gray;">(</span><span style="color: #00008b;">magReader</span><span style="color: Gray;"> != </span><span style="color: #00008b;">null</span><span style="color: Gray;">)</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><span style="color: #00008b;">magReader</span><span style="color: Gray;">.</span><span style="color: #00008b;">setSize</span><span style="color: Gray;">(</span><span style="color: #00008b;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">width</span><span style="color: Gray;">,</span><span style="color: #00008b;">magContainer</span><span style="color: Gray;">.</span><span style="color: #00008b;">height</span><span style="color: Gray;">);</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; &nbsp; &nbsp; ]]</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">&lt;/</span><span style="color: Green;">mx</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">&lt;</span><span style="color: Green;">mx</span><span style="color: Gray;">&nbsp;</span><span style="color: #00008b;">:Canvas</span><span style="color: Gray;"> </span><span style="color: #00008b;">id</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">magContainer</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">width</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">100%</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">height</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">100%</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">resize</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">changSize()</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">horizontalScrollPolicy</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">off</span><span style="color: #8b0000;">&quot;</span><span style="color: Gray;"> </span><span style="color: #00008b;">verticalScrollPolicy</span><span style="color: Gray;">=</span><span style="color: #8b0000;">&quot;</span><span style="color: Red;">off</span><span style="color: #8b0000;">&quot;</span><span style="color: Olive;">&gt;</span></li>
<li><span style="color: Gray;">&nbsp;</span></li>
<li><span style="color: Gray;">&nbsp; &nbsp; </span><span style="color: Olive;">&lt;/</span><span style="color: Green;">mx</span><span style="color: Olive;">&gt;</span></li></ol></div>
<h3>Related Posts</h3>
<ul class="related_post">
<li><a href="http://www.donotyet.com/2009/09/18/how-to-render-pdf-content-in-air-with-source-code/" title="How to Render PDF Content in AIR(With Source Code)">How to Render PDF Content in AIR(With Source Code)</a></li>
<li><a href="http://www.donotyet.com/2009/08/28/how-to-wait-or-sleep-in-flex-actionscript/" title="How to Wait or Sleep in Flex/ActionScript">How to Wait or Sleep in Flex/ActionScript</a></li>
<li><a href="http://www.donotyet.com/2009/08/09/5-very-beautiful-skins-for-flex-applications/" title="5+ Very Beautiful Skins for Flex Applications">5+ Very Beautiful Skins for Flex Applications</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.donotyet.com/2009/08/15/an-example-of-how-to-load-flashpaper-in-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

