<?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>何尹璇：璇璇的祕密花園 &#187; Flash</title>
	<atom:link href="http://poet.930.info/blog/category/skills/flash/feed/" rel="self" type="application/rss+xml" />
	<link>http://poet.930.info/blog</link>
	<description>每當夜深孤獨一人的時候，我會試著寫下一些記憶　它可能是愛情，可能是生活，也可能是一種夢與痛苦的感受</description>
	<lastBuildDate>Sat, 21 Jan 2012 15:22:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Preloader with percent loaded</title>
		<link>http://poet.930.info/blog/2007/12/03/preloader-with-percent-loaded/</link>
		<comments>http://poet.930.info/blog/2007/12/03/preloader-with-percent-loaded/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 06:12:10 +0000</pubDate>
		<dc:creator>小璇子</dc:creator>
				<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://poet.930.info/blog/2007/12/03/preloader-with-percent-loaded/</guid>
		<description><![CDATA[// This script must have two keyframes: // FIRST KEYFRAME &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; // The first step is create a text field with variable name "loadedField". In that field, // Flash gonna...]]></description>
			<content:encoded><![CDATA[<p>// This script must have two keyframes:<br />
// FIRST KEYFRAME &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>// The first step is create a text field with variable name "loadedField". In that field,<br />
// Flash gonna paste the porcent loaded for the movie in text format.<br />
percent = Math.floor(getBytesLoaded()/getBytesTotal()*100);<br />
loadedField = percent+"% loaded of "+Math.floor(getBytesTotal()/1024)+"kb";</p>
<p>// The second step is create the progress bar. With the rectangle tool we drag<br />
// and create, then convert to movie clip symbol with the variable name "bar".<br />
// If you see in the script, we use the property "_xscale". In that way, flash apply in<br />
// horizontal mode the percent loaded to the symbol "bar".<br />
if(percent != 100){<br />
        setProperty(bar, _xscale, percent);<br />
}</p>
<p>// The third step is to check for loaded file. If the percent loaded is 100%, then go<br />
// to the frame where the animation begin. I prefer put the preloader on one scene<br />
// and the animation in another.<br />
if (percent == 100) {<br />
        gotoAndPlay("escene2&#8243;, "1&#8243;);<br />
}</p>
<p>// SECOND KEYFRAME &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>// Put this script in the second keyframe.<br />
gotoAndPlay(1);<br />
// On this way, the movie loop till the file become 100% loaded.</p>
<h2  class="related_post_title">你可以延伸閱讀以下文章：</h2><ul class="related_post"><li><a href="http://poet.930.info/blog/2010/03/28/thickbox/" title="thickbox 浮動視窗">thickbox 浮動視窗</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://poet.930.info/blog/2007/12/03/preloader-with-percent-loaded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

