<?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; Tutorials</title>
	<atom:link href="http://scottrockers.com/blog/category/resources/tutorials/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>Fade In and Fade Out in jQuery</title>
		<link>http://scottrockers.com/blog/resources/tutorials/fade-in-and-fade-out-in-jquery</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/fade-in-and-fade-out-in-jquery#comments</comments>
		<pubDate>Tue, 27 Apr 2010 15:36:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[fade in]]></category>
		<category><![CDATA[fade out]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=1055</guid>
		<description><![CDATA[I have been working a lot more with jQuery lately, so I thought I would show you how to do the simple fade in or fade out jQuery hover effect that occurs to the navigation when you go to the Google homepage. You know the one that I am talking about, its occurs when your [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working a lot more with <a href="http://jquery.com/" target="_blank">jQuery</a> lately, so I thought I would show you how to do the simple fade in or fade out jQuery hover effect that occurs to the navigation when you go to the <a href="http://www.google.com" target="_blank">Google</a> homepage. You know the one that I am talking about, its occurs when your mouse goes over the page of the google homepage, all the navigation at the top appears. </p>
<p>For the first example, I will show you how to make the fade in jQuery hover effect. Hover over the box below to see the effect.</p>
<div id="googlediv" style="width:500px; height:200px; border:1px solid #ffffff;">
<div id="googlenav">
<ul>
<li><a href="#">Web</a></li>
<li><a href="#">Images</a></li>
<li><a href="#">Videos</a></li>
<li><a href="#">Maps</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Shopping</a></li>
<li><a href="#">Gmail</a></li>
</ul>
</div>
<div style="margin:0px auto; width:500px; text-align:center;">
<p>&nbsp;</p>
<p>The rest of the content of the page</p>
</div>
</div>
<p>To do this, first place this jQuery code in the &lt;head&gt;&lt;/head&gt; section of your html file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//the first line gets the latest jquery scripts</span>
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #006600; font-style: italic;">//this function is called when the page is ready</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//first hide the div with the id of googlenav</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlenav&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">//then when you rollover the specified div fade in the googlenav</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlediv&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlenav&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>Then add this html code into the &lt;body&gt;&lt;/body&gt; of your html document</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
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;googlediv&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width:500px; height:200px; border:1px solid #ffffff;&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;googlenav&quot;</span>&gt;</span>
	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Web<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Images<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Videos<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Maps<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>News<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Shopping<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">li</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;#&quot;</span>&gt;</span>Gmail<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">li</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;margin:0px auto; width:500px; text-align:center;&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span><span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>The rest of the content of the page<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></td></tr></table></div>

<p>You can style the content hover you like, I tried to keep all the links inline like google does. Here is my styling, you can add this in the &lt;head&gt;&lt;/head&gt; section too.</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
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
<span style="color: #cc00cc;">#googlenav</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Arial</span><span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#c9d7f1</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">26px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#googlenav</span> ul <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding-left</span><span style="color: #00AA00;">:</span><span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#googlenav</span> ul li<span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>

<p>Now google fades in their links and navigation when you roll over the page, not a specific div.  So if you wanted it to be exactly like that, you would target the page instead of that particular div. So in your jQuery instead of this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlediv&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlenav&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>You would put this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">body</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlenav&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>And style accordingly. Now if you want to fade out in jQuery, instead of fadeIn(), you would use the fadeOut() function. And Remember you don&#8217;t have to hide the content first, so the jQuery would look like this.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//the first line gets the latest jquery scripts</span>
<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://code.jquery.com/jquery-latest.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #006600; font-style: italic;">//this function is called when the page is ready</span>
<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//then when you rollover the specified div fade in the googlenav</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlediv&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div#googlenav&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'slow'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>An example of the fadeOut function is below using the code above.</p>
<div id="googlediv2" style="width:500px; height:200px; border:1px solid #ffffff;">
<div id="googlenav2">
<ul>
<li><a href="#">Web</a></li>
<li><a href="#">Images</a></li>
<li><a href="#">Videos</a></li>
<li><a href="#">Maps</a></li>
<li><a href="#">News</a></li>
<li><a href="#">Shopping</a></li>
<li><a href="#">Gmail</a></li>
</ul>
</div>
<div style="margin:0px auto; width:500px; text-align:center;">
<p>&nbsp;</p>
<p>The rest of the content of the page</p>
</div>
</div>
<p>That&#8217;s really about it, if this helps you out please leave a comment.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/fade-in-and-fade-out-in-jquery/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery Cycle Plugin &#8211; A Slideshow Creator Javascript File</title>
		<link>http://scottrockers.com/blog/resources/tutorials/jquery-cycle-plugin-a-slideshow-creator-javascript-file</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/jquery-cycle-plugin-a-slideshow-creator-javascript-file#comments</comments>
		<pubDate>Tue, 16 Feb 2010 18:19:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=905</guid>
		<description><![CDATA[Here is another useful script that I wanted to write a quick post about. Its called jQuery Cycle Plugin, and its an additional javascript file that basically allows you to create a slideshow very easily and it supports many different types of transition effects. It &#8216;s dual licensed under the MIT and GPL licenses which [...]]]></description>
			<content:encoded><![CDATA[<div class="cyclebannerexample" style="width:82px; height:82px;" align="center">
    <img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/233158.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/271131.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/216505.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/260178.jpg" width="80" height="80" /><img src="http://scottrockers.com/blog/wp-content/uploads/2010/02/115908.jpg" width="80" height="80" />
</div>
<p>Here is another useful script that I wanted to write a quick post about. Its called <a title="jquery cycle plugin" href="http://www.malsup.com/jquery/cycle/" target="_blank">jQuery Cycle Plugin</a>, and its an additional javascript file that basically allows you to create a slideshow very easily and it supports many different types of transition effects. It &#8216;s dual licensed under the MIT and GPL licenses which is great so you can use it in basically any project. If you don&#8217;t want to use Flash this is a really simple way to setup a slideshow that will show in all browsers. Some of the transitions are:  scrollup,  scrollleft,  scrollright,  scrolldown,  shuffle, and turndown. The images above is an example of it in action, and here is the code to it, really simple.</p>
<p>There are two things you need to add to your &lt;head&gt; section in your html, the css and javascript import lines:</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
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
<span style="color: #6666ff;">.banner</span> <span style="color: #00AA00;">&#123;</span>  
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span>  <span style="color: #933;">82px</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span>   <span style="color: #933;">82px</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>  
<span style="color: #00AA00;">&#125;</span> 
&nbsp;
<span style="color: #6666ff;">.banner</span> img <span style="color: #00AA00;">&#123;</span>   
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span>  <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>   
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span>  <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">80px</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span>  <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> 
<span style="color: #00AA00;">&#125;</span> 
<span style="color: #6666ff;">.banner</span> img <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span> <span style="color: #00AA00;">&#125;</span> //these lines <span style="color: #993333;">hide</span> all the rest of the pictures on startup 
<span style="color: #6666ff;">.banner</span> img<span style="color: #6666ff;">.first</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span> <span style="color: #00AA00;">&#125;</span> //except the first image
&nbsp;
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">&lt;!-- include jQuery library --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;!-- include Cycle plugin --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.2.72.js&quot;&gt;&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
	$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.banner'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">cycle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
			fx<span style="color: #339933;">:</span> <span style="color: #3366CC;">'scrollLeft'</span> <span style="color: #006600; font-style: italic;">//  transition type, scrollleft</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>And here is the image code, just add this anywhere in your &lt;body&gt;, just make sure the class name is the same as what the javascript is looking for:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;banner&quot;&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/233158.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/271131.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/216505.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/260178.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
    &lt;img src=&quot;http://scottrockers.com/blog/wp-content/uploads/2010/02/115908.jpg&quot; width=&quot;80&quot; height=&quot;80&quot; /&gt; 
&lt;/div&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/jquery-cycle-plugin-a-slideshow-creator-javascript-file/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>Flash ipod Style Volume Controller</title>
		<link>http://scottrockers.com/blog/resources/tutorials/flash-ipod-style-volume-controller</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/flash-ipod-style-volume-controller#comments</comments>
		<pubDate>Thu, 20 Aug 2009 21:43:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=609</guid>
		<description><![CDATA[I am almost finished with the mp3player that I have been working on. I will make a post once it gets live on Flashden.  I just wanted to share how the volume controller works and the code with it. As you will see, I used the Math.atan2 function which basically returns the arc tangent of [...]]]></description>
			<content:encoded><![CDATA[<p>I am almost finished with the mp3player that I have been working on. I will make a post once it gets live on Flashden.  I just wanted to share how the volume controller works and the code with it. As you will see, I used the Math.atan2 function which basically returns the arc tangent of a point, and I used this to get the angle of where the mouse is compared to where you slide it. Click and hold over the circle and then move your mouse while still holding the mouse down to see the circle rotating. Look to my comments in my code for further explanation.</p>
<p style="text-align: center;"><a rel="shadowbox; height=200; width=200" href="http://scottrockers.com/blog/wp-content/uploads/2009/08/circleButton.swf"><img class="aligncenter size-full wp-image-610" title="ipodVolumeController" src="http://scottrockers.com/blog/wp-content/uploads/2009/08/ipodVolumeController.jpg" alt="ipodVolumeController" width="200" height="200" /></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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">//create a boolean variable for when the volume button is being pushed, and variables for the new and old rotation of that button</span>
<span style="color: #6699cc; font-weight: bold;">var</span> buttonCircleMovement<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> newAngle<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> oldAngle<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>
&nbsp;
<span style="color: #009900; font-style: italic;">//create the inital volume variables, start at .5 or 50% volume</span>
<span style="color: #6699cc; font-weight: bold;">var</span> volumePercent<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000066; font-weight: bold;">.</span>5<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> currentVolume<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #000066; font-weight: bold;">.</span>5
&nbsp;
<span style="color: #009900; font-style: italic;">//masks the volume tracker to what the currentVolume is times the width of the volume bar</span>
volumeTracker<span style="color: #000066; font-weight: bold;">.</span>volumeBarMask<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">80</span> <span style="color: #000066; font-weight: bold;">*</span> currentVolume<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//on mouse down allow the the volume to change, on mouse up make it so the volume can't change</span>
buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_DOWN</span><span style="color: #000066; font-weight: bold;">,</span> volumeOn<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_UP</span><span style="color: #000066; font-weight: bold;">,</span> volumeOff<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//add event listeners for mouse movements and call the button circle move functions for the button circle</span>
buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_MOVE</span><span style="color: #000066; font-weight: bold;">,</span> buttonCircleMove<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//function is called when the mouse is down on the circle movieclip</span>
<span style="color: #339966; font-weight: bold;">function</span> volumeOn<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</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 button circle movement variable to true</span>
	buttonCircleMovement = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #009900; font-style: italic;">// get the initial angle of where your mouse click was before the rotating the object</span>
	oldAngle = <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">atan2</span><span style="color: #000000;">&#40;</span>buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #004993;">mouseY</span><span style="color: #000066; font-weight: bold;">,</span> buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #004993;">mouseX</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">180</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PI</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//function is called when the mouse is up off of the circle movieclip</span>
<span style="color: #339966; font-weight: bold;">function</span> volumeOff<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</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 button circle movement variable to false</span>
	buttonCircleMovement = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//function that controls the volume bar</span>
<span style="color: #339966; font-weight: bold;">function</span> buttonCircleMove<span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</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;">//if the button circle movement variable is set to true</span>
	<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>buttonCircleMovement<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//as your mouse moves, calculate the angle by where your mouse is located</span>
		newAngle = <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">atan2</span><span style="color: #000000;">&#40;</span>buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #004993;">mouseY</span><span style="color: #000066; font-weight: bold;">,</span> buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #004993;">mouseX</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">180</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PI</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//make a temporary variable hold the difference between the new and old angle</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> tempVar = <span style="color: #000000;">&#40;</span>newAngle <span style="color: #000066; font-weight: bold;">-</span> oldAngle<span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">-</span> <span style="color: #000000; font-weight:bold;">360</span> <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">round</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>newAngle <span style="color: #000066; font-weight: bold;">-</span> oldAngle<span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">360</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//rotate the circle to the new angle that is being calculated</span>
		buttonCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span> = newAngle<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//make the old angle where the new angle is now</span>
		oldAngle = newAngle<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//get the new volume percent by adding the old percent to the temporary variable divided by 360</span>
		volumePercent = volumePercent <span style="color: #000066; font-weight: bold;">+</span> tempVar <span style="color: #000066; font-weight: bold;">/</span> <span style="color: #000000; font-weight:bold;">360</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//if the volume percent is greater than 1 then just make it 1</span>
		<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>volumePercent <span style="color: #000066; font-weight: bold;">&gt;</span>= <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			volumePercent = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900; font-style: italic;">//if the volume percent is less than 0 then just make it 0</span>
		<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>volumePercent <span style="color: #000066; font-weight: bold;">&lt;</span>= <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			volumePercent = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//make the current volume equal to the volume percent</span>
		currentVolume = volumePercent<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #009900; font-style: italic;">//changes the width of the mask for the volume bar</span>
		volumeTracker<span style="color: #000066; font-weight: bold;">.</span>volumeBarMask<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">80</span> <span style="color: #000066; font-weight: bold;">*</span> currentVolume<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/flash-ipod-style-volume-controller/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Flash Text Ticker / Scrolling Text in Actionscript 3.0</title>
		<link>http://scottrockers.com/blog/resources/tutorials/flash-ticker-scrolling-text-in-actionscript-3-0</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/flash-ticker-scrolling-text-in-actionscript-3-0#comments</comments>
		<pubDate>Wed, 29 Jul 2009 17:48:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[scrolling text]]></category>
		<category><![CDATA[text ticker]]></category>

		<guid isPermaLink="false">http://scottrockers.com/blog/?p=588</guid>
		<description><![CDATA[Update: I have created a text ticker / scrolling text component based off of this tutorial that is integrated with a XML file so users have more options and can make easy changes.  Click the image below to learn more. So I have been working on a mp3player that is designed similar to a ipod [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: I have created a text ticker / scrolling text component based off of this tutorial that is integrated with a XML file so users have more options and can make easy changes.  Click the image below to learn more.</strong></p>
<p style="text-align: center;"><a href="http://activeden.net/item/flash-text-ticker-scrolling-text-actionscript-3/83544?ref=scottrockers"><img class="aligncenter size-full wp-image-850" style="border: 1px solid white;" title="flashtextticker2" src="http://scottrockers.com/blog/wp-content/uploads/2009/07/flashtextticker2.jpg" alt="" width="590" height="300" /></a></p>
<p>So I have been working on a mp3player that is designed similar to a ipod with a little bit different functionality. I needed the text fields to scroll back and forth so you could see all the text written inside of it, if the field was shorter than the width of the text. After looking around for a tutorial or another persons help and not finding a thing for Actionscript 3, I decided to write my own. I am using <a href="http://blog.greensock.com/tweenliteas3/" target="_blank">Tweenlite </a>to handle the tweens because its really low on weight and its a very smooth and powerful tweening engine.  I am almost done with the mp3player and I will show you that very soon, but I wanted to post an example of the scrolling text or flash ticker (as some people call them) to you first before then. The example and code is below. I use one movieclip with an instance name of item that has two items inside of it, a dynamic textfield holding the text and a mask to only show the part I want shown.</p>
<p><a rel="shadowbox;height=101;width=200" href="http://scottrockers.com/blog/wp-content/uploads/2009/07/scrollingText.swf"><img class="aligncenter size-full wp-image-590" title="scrollingText" src="http://scottrockers.com/blog/wp-content/uploads/2009/07/scrollingText.jpg" alt="scrollingText" width="200" height="101" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #009900; font-style: italic;">//import libraries</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.utils</span><span style="color: #000066; font-weight: bold;">.*;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextField</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> gs<span style="color: #000066; font-weight: bold;">.*;</span>
<span style="color: #0033ff; font-weight: bold;">import</span> gs<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;">//make the text too long for the textfield and assign the mask for it</span>
item<span style="color: #000066; font-weight: bold;">.</span>menuItemText<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = <span style="color: #990000;">&quot;This text is too long to fit in this tiny textfield, here is the end&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
item<span style="color: #000066; font-weight: bold;">.</span>menuItemText<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">mask</span> = item<span style="color: #000066; font-weight: bold;">.</span>menuItemMask<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//call the scrollWords function</span>
scrollWords<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;">//the scrollWords function</span>
<span style="color: #339966; font-weight: bold;">function</span> scrollWords<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: #009900; font-style: italic;">//make the textfield wordwrap false and autosize to textFieldAutoSize.LEFT</span>
	item<span style="color: #000066; font-weight: bold;">.</span>menuItemText<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">wordWrap</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
	item<span style="color: #000066; font-weight: bold;">.</span>menuItemText<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #009900; font-style: italic;">//if the textwidth is longer than the masks width which is 173 then call goforwardtween</span>
	<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>item<span style="color: #000066; font-weight: bold;">.</span>menuItemText<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">textWidth</span> <span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #000000; font-weight:bold;">173</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		goForwardTween<span style="color: #000000;">&#40;</span>item<span style="color: #000066; font-weight: bold;">.</span>menuItemText<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//go forward tween, on complete it calls go back tween</span>
<span style="color: #339966; font-weight: bold;">function</span> goForwardTween<span style="color: #000000;">&#40;</span>tf<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextField</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>
	TweenLite<span style="color: #000066; font-weight: bold;">.</span>to<span style="color: #000000;">&#40;</span>tf<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">3</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000;">&#123;</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:-</span><span style="color: #000000;">&#40;</span>item<span style="color: #000066; font-weight: bold;">.</span>menuItemText<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">textWidth</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">163</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">delay</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> onComplete<span style="color: #000066; font-weight: bold;">:</span>goBackTween<span style="color: #000066; font-weight: bold;">,</span> onCompleteParams<span style="color: #000066; font-weight: bold;">:</span><span style="color: #000000;">&#91;</span>tf<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</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;">//go back tween, on complete it calls go forward tween</span>
<span style="color: #339966; font-weight: bold;">function</span> goBackTween<span style="color: #000000;">&#40;</span>tf<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextField</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>
	TweenLite<span style="color: #000066; font-weight: bold;">.</span>to<span style="color: #000000;">&#40;</span>tf<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">3</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000;">&#123;</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">delay</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> onComplete<span style="color: #000066; font-weight: bold;">:</span>goForwardTween<span style="color: #000066; font-weight: bold;">,</span> onCompleteParams<span style="color: #000066; font-weight: bold;">:</span><span style="color: #000000;">&#91;</span>tf<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/flash-ticker-scrolling-text-in-actionscript-3-0/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Update: WordPress and Flash Integration part III</title>
		<link>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration-part-iii</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration-part-iii#comments</comments>
		<pubDate>Wed, 11 Mar 2009 21:56:37 +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[Wordpress]]></category>

		<guid isPermaLink="false">http://www.scottrockers.com/blog/?p=435</guid>
		<description><![CDATA[Well, I finally had a little bit of free time and I wanted to rework all my wordpress and flash integrations stuff into ActionScript 3.  There were a couple of interesting things that came up while working on this as well.  You can&#8217;t tween the alpha property of a textfield created in actionscript (unless you [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I finally had a little bit of free time and I wanted to rework all my wordpress and flash integrations stuff into ActionScript 3.  There were a couple of interesting things that came up while working on this as well.  You can&#8217;t tween the alpha property of a textfield created in actionscript (unless you use a simple hack that I found out in the Flash live-docs online).  You have to change the blendmode style to &#8220;LAYER&#8221;, or another type, as long as its not the default style type. Weird but at least I got it to work. Also, I was going to implement the tweens using TweenLite but they also have problems accessing textfield properities, too.</p>
<p>Here is the swf, and below is the actionscript 3:</p>
<p style="text-align: center;"><a rel="shadowbox;width=400;height=200;" href="http://www.scottrockers.com/blog/wp-content/uploads/2009/03/test4.swf"><img class="aligncenter size-medium wp-image-441" title="wordpressflashex4" src="http://www.scottrockers.com/blog/wp-content/uploads/2009/03/wordpressflashex4-300x150.jpg" alt="wordpressflashex4" width="300" height="150" /></a></p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span>  <span style="color: #000000;">&#123;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MovieClip</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">BlendMode</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">URLLoader</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">URLRequest</span><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><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>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>TweenEvent<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: #3f5fbf;">/*
    * Redo of scott rockers's wordpress to flash integration but in AS3 and as3wordpressFlash class file
    */</span>
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> AS3WordpressFlash <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">MovieClip</span> <span style="color: #000000;">&#123;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> titleList<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XMLList</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> linkList<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XMLList</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> tf<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextField</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> format<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> tweenIt<span style="color: #000066; font-weight: bold;">:</span>Tween<span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> tweenIt2<span style="color: #000066; font-weight: bold;">:</span>Tween<span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> theXML<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XML</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">public</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;">URLLoader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLLoader</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: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> AS3WordpressFlash<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #004993;">loader</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> loadXML<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</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;http://www.scottrockers.com/blog/wp-rss2.php&quot;</span><span style="color: #000000;">&#41;</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: #339966; font-weight: bold;">function</span> loadXML<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>
            theXML = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">XML</span><span style="color: #000000;">&#40;</span>e<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">target</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            titleList = theXML<span style="color: #000066; font-weight: bold;">.</span>channel<span style="color: #000066; font-weight: bold;">.</span>item<span style="color: #000066; font-weight: bold;">.</span>title<span style="color: #000066; font-weight: bold;">;</span>
            linkList = theXML<span style="color: #000066; font-weight: bold;">.</span>channel<span style="color: #000066; font-weight: bold;">.</span>item<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">link</span><span style="color: #000066; font-weight: bold;">;</span>
            createTextFields<span style="color: #000000;">&#40;</span>titleList<span style="color: #000066; font-weight: bold;">,</span> linkList<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #339966; font-weight: bold;">function</span> createTextFields<span style="color: #000000;">&#40;</span>titles<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XMLList</span><span style="color: #000066; font-weight: bold;">,</span> links<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">XMLList</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>
            format = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextFormat</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            format<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">font</span> = <span style="color: #990000;">&quot;Arial&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
            format<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span> = 0xFFFFFF<span style="color: #000066; font-weight: bold;">;</span>
            format<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">size</span> = <span style="color: #000000; font-weight:bold;">14</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
            <span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>i = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i <span style="color: #000066; font-weight: bold;">&amp;</span>lt<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> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                tf = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">blendMode</span> = <span style="color: #004993;">BlendMode</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">LAYER</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span> = <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">selectable</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">autoSize</span> = <span style="color: #004993;">TextFieldAutoSize</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">CENTER</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #000000;">&#40;</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">htmlText</span> = <span style="color: #990000;">&quot;&lt;a href=&quot;</span><span style="color: #000066; font-weight: bold;">&amp;</span>quot<span style="color: #000066; font-weight: bold;">;+</span> links<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+&amp;</span>quot<span style="color: #000066; font-weight: bold;">;</span><span style="color: #990000;">&quot; target=&quot;</span>_blank<span style="color: #990000;">&quot;&gt;&quot;</span> <span style="color: #000066; font-weight: bold;">+</span> titles<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot;&lt;/a&gt;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
                tf<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setTextFormat</span><span style="color: #000000;">&#40;</span>format<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
                <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>tf<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
                tweenIt = <span style="color: #0033ff; font-weight: bold;">new</span> Tween<span style="color: #000000;">&#40;</span>tf<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;y&quot;</span><span style="color: #000066; font-weight: bold;">,</span> Elastic<span style="color: #000066; font-weight: bold;">.</span>easeOut<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">50</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>i <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">30</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">30</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>i <span style="color: #000066; font-weight: bold;">*</span> <span style="color: #000000; font-weight:bold;">15</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
                tweenIt2 = <span style="color: #0033ff; font-weight: bold;">new</span> Tween<span style="color: #000000;">&#40;</span>tf<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;">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: #000000; font-weight:bold;">100</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000;">&#40;</span>i <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> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration-part-iii/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: WordPress and Flash Integration part II</title>
		<link>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration-part-ii</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration-part-ii#comments</comments>
		<pubDate>Tue, 27 Jan 2009 20:23:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.rockerssoft.org/scott/blog/?p=297</guid>
		<description><![CDATA[After working on accessing WordPress through the RSS feed with Flash, I have finally achieved what I was aiming for:  I wanted to be able to tween the headings of each post individually as well as make them links to the actual post.  Also, as you will see, this swf is dynamic meaning it will [...]]]></description>
			<content:encoded><![CDATA[<p>After working on accessing WordPress through the RSS feed with Flash, I have finally achieved what I was aiming for:  I wanted to be able to tween the headings of each post individually as well as make them links to the actual post.  Also, as you will see, this swf is dynamic meaning it will update itself to have the most recent blog post headings. Here is what I came up with:</p>
<p style="text-align: center;"><a rel="shadowbox;width=400;height=200;" href="http://www.scottrockers.com/blog/wp-content/uploads/2009/01/test3.swf"><img class="aligncenter size-medium wp-image-299" title="wordpressflashex3" src="http://www.scottrockers.com/blog/wp-content/uploads/2009/01/wordpressflashex3-300x150.jpg" alt="" /></a></p>
<p style="text-align: left;">I did come across a few interesting things. When accessing the titles of each heading, I used &#8220;.nodeValue&#8221;, but when accessing the links of the headings I had to use &#8220;theNodePath.toString()&#8221;. I thought this was weird because all the information looked the same inside each node in the XML.</p>
<p style="text-align: left;">I will use this technology on my blog as well as my Flash site, once I get some time to work on them. Hopefully soon, because I am pumped that I figured out how to do this.</p>
<p style="text-align: left;">Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration-part-ii/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update: WordPress and Flash Integration part I</title>
		<link>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration</link>
		<comments>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration#comments</comments>
		<pubDate>Fri, 23 Jan 2009 20:48:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.rockerssoft.org/scott/blog/?p=251</guid>
		<description><![CDATA[I&#8217;ve been working on integrating my WordPress blog with Flash for the last couple days now whenever I had some free time, and I have some great things to show.  I will try explain the best I can about what I am doing.  If I do this correctly, and I think I am, then I [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on integrating my WordPress blog with Flash for the last couple days now whenever I had some free time, and I have some great things to show.  I will try explain the best I can about what I am doing.  If I do this correctly, and I think I am, then I will be able to use my WordPress blog as a complete CMS for my flash website.</p>
<p>If you have a WordPress blog already setup, then you can do all this easy too.  All WordPress blogs have a RSS feed built into them, so what I did was access that php file that creates the RSS feed (which renders out as XML),  and thats all Flash needs to have to be able to do what we want.  The best part is that the .swf file updates itself automatically anytime it is called which makes the whole thing dynamic.</p>
<p>Click on the image below to see an example that retrieves every heading to every post on my blog and puts them into a simple list component.</p>
<p style="text-align: center;"><a rel="shadowbox;width=479;height=100;" href="http://www.scottrockers.com/blog/wp-content/uploads/2009/01/test1.swf"><img class="aligncenter size-full wp-image-260" title="WordPress and Flash Example1" src="http://www.scottrockers.com/blog/wp-content/uploads/2009/01/wordpressflashex1.jpg" alt="" width="481" height="102" /></a></p>
<p style="text-align: left;">Here is the code I used in the .FLA, its AS2:</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
</pre></td><td class="code"><pre class="actionscript" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">// Create new XML Object and set ignoreWhite true</span>
<span style="color: #000000; font-weight: bold;">var</span> theXML:<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: #66cc66;">&#41;</span>;
theXML.<span style="color: #0066CC;">ignoreWhite</span> = <span style="color: #000000; font-weight: bold;">true</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//the function to check to see if the xml file was loaded</span>
theXML.<span style="color: #0066CC;">onLoad</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
     <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>success<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
          <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Your XML file was loaded! See its right here:'</span> + <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span> + <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> + <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #66cc66;">&#41;</span>;
          processXML<span style="color: #66cc66;">&#40;</span>theXML<span style="color: #66cc66;">&#41;</span>;
     <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
          <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Your XML file was not loaded'</span><span style="color: #66cc66;">&#41;</span>;
     <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">//where to find the the xml file and loads it</span>
<span style="color: #808080; font-style: italic;">//just change the url to your rss url</span>
theXML.<span style="color: #0066CC;">load</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.scottrockers.com/blog/wp-rss2.php&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//function that puts all the posts' headers into the list component</span>
<span style="color: #000000; font-weight: bold;">function</span> processXML<span style="color: #66cc66;">&#40;</span>xmlInfo<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
     <span style="color: #808080; font-style: italic;">// xmlInfo is now a reference to the XML</span>
     <span style="color: #808080; font-style: italic;">// object where our information is stored</span>
     <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> n = <span style="color: #cc66cc;">0</span>; n <span style="color: #66cc66;">&lt;</span> xmlInfo.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">childNodes</span>.<span style="color: #0066CC;">length</span>; n++<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
          <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>xmlInfo.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">childNodes</span><span style="color: #66cc66;">&#91;</span>n<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">nodeName</span> == <span style="color: #ff0000;">&quot;item&quot;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
               <span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>xmlInfo.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">childNodes</span><span style="color: #66cc66;">&#91;</span>n<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">nodeValue</span><span style="color: #66cc66;">&#41;</span>;
               theList.<span style="color: #006600;">addItem</span><span style="color: #66cc66;">&#40;</span>xmlInfo.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">childNodes</span><span style="color: #66cc66;">&#91;</span>n<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">firstChild</span>.<span style="color: #0066CC;">nodeValue</span><span style="color: #66cc66;">&#41;</span>;
          <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
               <span style="color: #808080; font-style: italic;">//these are the parent nodes, do not print them</span>
               <span style="color: #808080; font-style: italic;">//trace(xmlInfo.firstChild.firstChild.childNodes[n].firstChild.nodeValue);</span>
          <span style="color: #66cc66;">&#125;</span>
     <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p style="text-align: left;">I can even access certain categories by changing: theXML.load(&#8220;http://www.scottrockers.com/blog/wp-rss2.php&#8221;); to theXML.load(&#8220;http://www.scottrockers.com/blog/?cat=4&amp;feed=rss2&#8243;);</p>
<p>Click on the image below to see an example that retrieves only headings to posts under the category &#8220;Portfolio&#8221; and puts them into a simple list component.</p>
<p style="text-align: center;"><a rel="shadowbox;width=479;height=100;" href="http://www.scottrockers.com/blog/wp-content/uploads/2009/01/test2.swf"><img class="aligncenter size-full wp-image-282" title="Wordpress Flash Example2" src="http://www.scottrockers.com/blog/wp-content/uploads/2009/01/wordpressflashex2.jpg" alt="" width="481" height="102" /></a></p>
<p>Since I now know how to access those node values then I will also be able to do anything with them, such as animate them on to the stage, make them links, etc. I am sooooo pumped about this.</p>
<p>Cya</p>
]]></content:encoded>
			<wfw:commentRss>http://scottrockers.com/blog/resources/tutorials/update-wordpress-and-flash-integration/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

