<?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>Scott Rockers&#039; Blog &#187; preloader</title>
	<atom:link href="http://scottrockers.com/blog/tag/preloader/feed" rel="self" type="application/rss+xml" />
	<link>http://scottrockers.com/blog</link>
	<description>Website Designer and Developer, Flash, Wordpress, jQuery, and Other Scripts</description>
	<lastBuildDate>Mon, 22 Aug 2011 21:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Flash AS3 Preloader</title>
		<link>http://scottrockers.com/blog/resources/tutorials/flash-as3-preloader</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/flash-as3-preloader#comments</comments>
		<pubDate>Thu, 19 Nov 2009 21:37:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[preloader]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=708</guid>
		<description><![CDATA[I wanted to write a basic tutorial on creating a simple flash AS3 (actionscript 3) preloader. Also, I am going to talk about some of the issues that I came across during the process that might help out other designers and developers. You can see the preloader in action by clicking the image below and [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to write a basic tutorial on creating a simple flash AS3 (actionscript 3) preloader. Also, I am going to talk about some of the issues that I came across during the process that might help out other designers and developers. You can see the preloader in action by clicking the image below and the code is below that. The comments in the code should help explain exactly what I am doing and be a basic tutorial for any beginner. This preloader is easy to use, just change one line of code, the line defining the name of the swf you want to load, and you can easily change the color too. The download link is below the code, but please give me credit when using it.</p>
<p>One of the first problems I encountered is when I add the url loader with this line of code, &#8220;addChild(loader);&#8221; Most other tutorials will tell you to put this in your eventlistener complete function, but I have come across several problems when doing that such as the ugly &#8220;1009 cannot access a property or method of a null object reference&#8221; error.&#8221; The reason you get this is because you are trying to do something with the loader before its actual loaded into memory. So I just add the &#8220;addChild(loader)&#8221; outside of any eventlistener and it resolves it. Then, I add another function inside of the eventlistener complete function to handle any tweens or effects on the preloader itself after its done loading.</p>
<p>Another problem I come across is the text field not fading away when tweening it. This is a textfield problem, I can&#8217;t explain why its doing it, it just is, so the work around there is to make it a movie clip and change that movieclip&#8217;s blend mode to anything but normal and then the tweens will handle it correctly.</p>
<p>Make sure to check out some of my advanced preloaders for sale on my <a title="Scott Rockers ActiveDen Portfolio" href="http://activeden.net/user/scottrockers?ref=scottrockers" target="_blank">activeden portfolio</a> and please buy one if they spark your interest. A nicely designed preloader can really impress your client and its only costs a few bucks.</p>
<p style="text-align: center;"><a rel="shadowbox;width=300;height=100;" href="http://scottrockers.com/blog/wp-content/uploads/2009/11/flashPreloader.swf"><img class="aligncenter size-full wp-image-709" title="flashas3preloader" src="http://scottrockers.com/blog/wp-content/uploads/2009/11/flashas3preloader.jpg" alt="flashas3preloader" width="303" height="104" /></a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">//import tweening libraries</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>transitions<span style="color: #000066; font-weight: bold;">.</span>Tween<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> fl<span style="color: #000066; font-weight: bold;">.</span>transitions<span style="color: #000066; font-weight: bold;">.</span>easing<span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//stop command</span>
<span style="color: #004993;">stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//initalize percent, loaded, and total variables for preloader</span>
<span style="color: #6699cc; font-weight: bold;">var</span> percent<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> loaded<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> total<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//intialize loader variable</span>
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Loader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Loader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//set up the listener for the loader object to get the progress of the download</span>
<span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">contentLoaderInfo</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">ProgressEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PROGRESS</span><span style="color: #000066; font-weight: bold;">,</span> getBytesLoop<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">//set up the listener for the loader object to call loadingDone function when loading is done</span>
<span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">contentLoaderInfo</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">COMPLETE</span><span style="color: #000066; font-weight: bold;">,</span> loadingDone<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #009900; font-style: italic;">//set up the listener for the on enterframe event, this is called all the time</span>
mypreloader<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span>preloaderMotion<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//load the swf you want</span>
<span style="color: #009900; font-style: italic;">//***change this swf name to the one you want to load****</span>
<span style="color: #004993;">loader</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;testContent.swf&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//add the loader to the stage</span>
<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">loader</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//getbytesloop function sets the info of the loaded swf during the progress of the load</span>
<span style="color: #339966; font-weight: bold;">function</span> getBytesLoop<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">ProgressEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">//set the total and loaded variable for the progress of the preloader</span>
	total = e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bytesTotal</span><span style="color: #000066; font-weight: bold;">;</span>
	loaded = e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bytesLoaded</span><span style="color: #000066; font-weight: bold;">;</span>
	percent = <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">floor</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>loaded <span style="color: #000066; font-weight: bold;">/</span> total<span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #009900; font-style: italic;">//make the text on the screen show how much is loaded</span>
	textMC<span style="color: #000066; font-weight: bold;">.</span>myText<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = percent<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//loadingDone function hides the preloader when its done</span>
<span style="color: #339966; font-weight: bold;">function</span> loadingDone<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	hidePreloader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//preloader motion function give motion to the preloader, add effects here to make your preloader move</span>
<span style="color: #339966; font-weight: bold;">function</span> preloaderMotion<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	mypreloader<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span> <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//hidepreloader function, fades away all the objects in the preloader and shows the loaded content on the screen</span>
<span style="color: #339966; font-weight: bold;">function</span> hidePreloader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> myTween2<span style="color: #000066; font-weight: bold;">:</span>Tween = <span style="color: #0033ff; font-weight: bold;">new</span> Tween<span style="color: #000000;">&#40;</span>mypreloader<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;alpha&quot;</span><span style="color: #000066; font-weight: bold;">,</span> Strong<span style="color: #000066; font-weight: bold;">.</span>easeOut<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> myTween3<span style="color: #000066; font-weight: bold;">:</span>Tween = <span style="color: #0033ff; font-weight: bold;">new</span> Tween<span style="color: #000000;">&#40;</span>textMC<span style="color: #000066; font-weight: bold;">.</span>myText<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;alpha&quot;</span><span style="color: #000066; font-weight: bold;">,</span> Strong<span style="color: #000066; font-weight: bold;">.</span>easeOut<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><a href="http://www.scottrockers.com/downloads/flashas3preloader.zip">Download Flash AS3 Preloader</a></p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/flash-as3-preloader/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Segmented Circular Preloader added to ActiveDen</title>
		<link>http://scottrockers.com/blog/portfolio/sellable-items/second-item-added-to-activeden</link>
		<comments>http://scottrockers.com/blog/portfolio/sellable-items/second-item-added-to-activeden#comments</comments>
		<pubDate>Fri, 15 May 2009 14:46:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sellable Items]]></category>
		<category><![CDATA[ActiveDen]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[preloader]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=535</guid>
		<description><![CDATA[Another file has been approved and posted on activeDen.  It&#8217;s a Flash preloader titled Segmented Circular Preloader. It&#8217;s really easy to customize and easy to use and  I wrote it in both Actionscript 2.0 and 3.0. This preloader uses the timer function to make sure the preloader ALWAYS displays for a while before loading the [...]]]></description>
			<content:encoded><![CDATA[<p>Another file has been approved and posted on <a title="activeDen" href="http://activeden.net?ref=scottrockers" target="_blank">activeDen</a>.  It&#8217;s a Flash preloader titled <a href="http://flashden.net/item/segmented-circular-preloader/41231?ref=scottrockers" target="_blank">Segmented Circular Preloader</a>. It&#8217;s really easy to customize and easy to use and  I wrote it in both Actionscript 2.0 and 3.0. This preloader uses the timer function to make sure the preloader ALWAYS displays for a while before loading the desired content.  I want to make all my files really easy to use so anyone can use them. The Actionscript 2 version all you have to do to use it is just copy and paste the preloader movieclip to the first frame of your flash file and your finished, and have your content on the second frame and on. For the Actionscript 3 version all you have to do to use this version is just change line 46 in the as3 file to the name of the swf you want to load. Here is a preview of the file. If you want to purchase it, you can go on over to activeDen and buy it.</p>
<p style="text-align: center;"><a rel="shadowbox;width=590;height=300;" href="http://scottrockers.com/blog/wp-content/uploads/2009/05/preview2.swf"><img class="aligncenter size-medium wp-image-524" title="preloaderv2" src="http://scottrockers.com/blog/wp-content/uploads/2009/05/preloaderv2-300x152.jpg" alt="preloaderv2" width="300" height="152" /></a></p>
<p style="text-align: left;">Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/portfolio/sellable-items/second-item-added-to-activeden/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Layered Circular Preloader Added to ActiveDen</title>
		<link>http://scottrockers.com/blog/portfolio/sellable-items/first-item-added-to-flashden</link>
		<comments>http://scottrockers.com/blog/portfolio/sellable-items/first-item-added-to-flashden#comments</comments>
		<pubDate>Thu, 30 Apr 2009 14:42:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sellable Items]]></category>
		<category><![CDATA[ActiveDen]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[preloader]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=522</guid>
		<description><![CDATA[I have just added my first sellable Flash file to ActiveDen, which is a website for buying and selling Flash files, components, effects, and other stuff.  I&#8217;ts called Layered Circular Preloader and it&#8217;s a preloader I designed and it has both versions (Actionscript 2.0 and Actionscript 3.0) for only $2.00. Click on the image below [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://flashden.net?ref=scottrockers" target="_blank"><img class="aligncenter size-full wp-image-523" title="flashdenlogo" src="http://scottrockers.com/blog/wp-content/uploads/2009/04/flashdenlogo.jpg" alt="flashdenlogo" width="250" height="250" /></a></p>
<p>I have just added my first sellable Flash file to <a title="ActiveDen" href="http://ActiveDen.net?ref=scottrockers" target="_blank">ActiveDen</a>, which is a website for buying and selling Flash files, components, effects, and other stuff.  I&#8217;ts called <a href="http://flashden.net/item/layered-circular-preloader-/40014?ref=scottrockers" target="_blank">Layered Circular Preloader</a> and it&#8217;s a preloader I designed and it has both versions (Actionscript 2.0 and Actionscript 3.0) for only $2.00.</p>
<p style="text-align: left;">Click on the image below to view a preview swf of what I am selling. If you want to purchase this item, all you have to do is create a free account on their site and then deposit some cash and then buy it. I will be starting to work on creating a widget for wordpress that implements the Envato Marketplace API, that shows the latest items for sell that links back to the page for selling. More to come soon.</p>
<p style="text-align: center;"><a rel="shadowbox;width=590;height=300;" href="http://scottrockers.com/blog/wp-content/uploads/2009/04/previewpreloaderv1.swf"><img class="aligncenter size-medium wp-image-524" title="preloaderv1" src="http://scottrockers.com/blog/wp-content/uploads/2009/04/preloaderv1-300x152.jpg" alt="preloaderv1" width="300" height="152" /></a></p>
<p style="text-align: left;">Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/portfolio/sellable-items/first-item-added-to-flashden/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

