<?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>orangeSPLoTCH &#187; Flex</title>
	<atom:link href="http://orangesplotch.com/blog/categories/flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://orangesplotch.com/blog</link>
	<description>Web developing in the middle of the night.</description>
	<lastBuildDate>Wed, 25 Aug 2010 11:45:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>SwfObj Version 0.9.2</title>
		<link>http://orangesplotch.com/blog/swfobj-version-0-9-2/</link>
		<comments>http://orangesplotch.com/blog/swfobj-version-0-9-2/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 05:17:48 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[SwfObj]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[swfobject]]></category>
		<category><![CDATA[wp plugin]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=252</guid>
		<description><![CDATA[The latest release of SwfObj adds the option to embed your Flash objects dynamically. Now SwfObj fully takes advantage of the SwfObject Javascript library.]]></description>
			<content:encoded><![CDATA[<p class="intro">Big changes are finally here in SwfObj land. Thanks to the encouragement of fantastic SwfObj users, such as yourself, I&#8217;ve mustered up the motivation to implement what I consider to be a major feature. Dynamic Embedding of Flash objects is finally available with SwfObj.</p>
<h3>Dynamic vs. Static Embedding</h3>
<p>Prior to this release, the only option for embedding Flash objects with SwfObj, was statically. This embeds the objects directly into the html rendered by WordPress.</p>
<p>By dynamically embedding them, WordPress instead places a <code>div</code> tag on the page that holds the alternative content only. Once the page has loaded, Javascript replaces this alternative content with the Flash object.</p>
<p>I&#8217;ll defer you to the official SwfObject project for <a href="http://code.google.com/p/swfobject/wiki/documentation#Should_I_use_the_static_or_dynamic_publishing_method?">the advantages and disadvantages of either SwfObject embedding method</a>.</p>
<h3>How to embed objects dynamically</h3>
<p>By default, SwfObj is set to embed statically. If you would rather use dynamic embedding by default on your site, it is very easy to change the settings. Go to Settings > SwfObj and in &#8220;Default Embedding Mode&#8221; select &#8220;Dynamic Publishing&#8221;. Save your changes and you&#8217;re all set.</p>
<p>If you ever want to use the other method for a particular post, you can override the default with the new <code>dynamic_embed</code> attribute. Here are a couple examples.</p>
<pre>&#91;swfobj src="..." dynamic_embed="true"&#93; &larr; <em>(embedded dynamically)</em>
&#91;swfobj src="..." dynamic_embed="false"&#93; &larr; <em>(embedded statically)</em>
</pre>
<h3>Other developments</h3>
<p>In more exciting news, <a href="http://noscope.com/">Joen Asmussen</a> the developer behind the <a href="http://wordpress.org/extend/plugins/flash-shorttags-swfobject/">Flash Shorttags SwfObject Plugin</a> requested that I merge in features from his plugin so he could discontinue it in favor of SwfObj. As a result, you can also use the &#91;flash&#93; shorttag to embed your Flash objects. I really appreciate Joen approaching me about merging our two plugins. It makes things simpler for everyone out there looking for an easier way to embed Flash on their WordPress site.</p>
<p>I originally developed this plugin for myself because embedding Flash was such a pain. It&#8217;s been great to see so many other people getting value from it as well. Thanks to your help and suggestions SwfObj continues to improve. Please continue to send any comments or suggestions you may have as you use it on your sites. And if you really want to show your appreciation, feel free to <a href="http://orangesplotch.com/freelunch">buy me lunch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-version-0-9-2/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Flash Tutorial: Eyes Following the Mouse</title>
		<link>http://orangesplotch.com/blog/flash-tutorial-eyes-following-the-mouse/</link>
		<comments>http://orangesplotch.com/blog/flash-tutorial-eyes-following-the-mouse/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 13:59:25 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[eye-roll]]></category>
		<category><![CDATA[eyes]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[motion]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=158</guid>
		<description><![CDATA[Have you ever seen those paintings where the eyes are always looking at you no matter where you stand. Well, sorry, this tutorial won't teach you anything about painting. This simple Flash tutorial goes over how to make a pair of eyes follow the mouse using Actionscript.]]></description>
			<content:encoded><![CDATA[<p class="intro">Have you ever seen those paintings where the eyes are always looking at you no matter where you stand. Well, sorry, this tutorial won&#8217;t teach you anything about painting. This simple Flash tutorial goes over how to make a pair of eyes follow the mouse using Actionscript.</p>
<p><a href="#rollingeyes-source">Jump straight to the source code</a> if you&#8217;d like to skip the details.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_0" width="500" height="196" class="align-right bordered">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2009/04/rollingeyes.swf" />
      <param name="wmode" value="transparent" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2009/04/rollingeyes.swf" width="500" height="196" wmode="transparent">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>The eye</h3>
<p>First you need to create three <code>Sprites</code> for each eye. The pupil, the eye, and the mask for the pupil. The mask for the pupil needs to be identical in shape to the part of the eye where the pupil shows. In my case, the eye and the mask for the eye are identical circles. To make things easier on yourself, the registration point for both the pupil and the eye should be located at the center of each.</p>
<p>For this tutorial, I&#8217;ll be doing everything in basic Actionscript. However, you are free to use images or <code>MovieClip</code>s for your eyes. In fact I&#8217;d encourage it, as that will look way better than my goofy circle eyes.</p>
<p class="note">I&#8217;m not going to bother pasting my eyeball creation and placement Actionscript here, since it isn&#8217;t important to the tutorial. If you really want to see it, just <a href="#rollingeyes-source">download the source code</a> at the bottom of the article.</a></p>
<p>So now that you have your eye, pupil and mask, place them on the screen wherever you want. Make sure you mask the pupils with the mask object. Otherwise you&#8217;ll have some weird floating pupil effect. Again, I&#8217;m doing all of this in the Actionscript, but you are free to manually place everything on the stage. That&#8217;s actually the easier way to do it, since you can see exactly where they are going. </p>
<h3>It follows me everywhere I go</h3>
<p>Ok, enough talk about making and placing eyeballs on the stage. The real reason you are reading this is to see how to get your eyes to follow the mouse. As I said before, the code is really simple. </p>
<p>First calculate the offset between the mouse position and your eye. In this case I have two eyes, so I created the <code>_focalPoint</code> object to compare against. My <code>_focalPoint</code> is located right between the two eyes. This allows both eyes to move together in uniform instead of getting cross-eyed in the middle. The following code goes in your <code>EnterFrame</code> handler function.</p>
<pre>// calculate mouse offset
var distx:Number = mouseX - _focalPoint.x;
var disty:Number = mouseY - _focalPoint.y;</pre>
<p>Finally we reposition the pupils based on this offset. You will notice that we are scaling down <code>distx</code> and <code>disty</code>. This is so the eyes don&#8217;t move so far that they are no longer visible. I am using a factor of 25. You may need to change this depending on how wide or thin your stage is and where you position the eyes. Experiment a little to get it just right.</p>
<pre>// set the eyes according to the mouse offset
_pupil1.x = _eye1.x + (distx / 25);
_pupil1.y = _eye1.y + (disty / 25);
_pupil2.x = _eye2.x + (distx / 25);
_pupil2.y = _eye2.y + (disty / 25);</pre>
<p>Because we set the registration point of both the eye and the pupil Sprites, we can use the eye <code>.x</code> and <code>.y</code> properties to place the pupil. This makes the code a lot cleaner as you can see.</p>
<p>And there you go. Nice rolling eyes going everywhere your mouse goes. Like I said, it&#8217;s a very easy effect to make once you know how to do it. No complex trig. No fancy classes. Just plain simple Actionscript.</p>
<h3>Eye Following Downloads</h3>
<ul id="rollingeyes-source" class="downloads">
<li><a title="Download the source file used in this tutorial." type="zip" href="http://orangesplotch.com/files/RollingEyes.zip">Rolling Eyes Actionscript 3.0 source file.</a></li>
</ul>
<p>If you have any questions, please let me know either in the comments below or through the <a href="http://orangesplotch.com/contact/">contact form</a>. I&#8217;d love to see what you guys come up with this. So go set your mouse following eyeballs free. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/flash-tutorial-eyes-following-the-mouse/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tutorial: Polar Coordinate Plotting in Actionscript</title>
		<link>http://orangesplotch.com/blog/tutorial-polar-coordinate-plotting-in-actionscript/</link>
		<comments>http://orangesplotch.com/blog/tutorial-polar-coordinate-plotting-in-actionscript/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 14:52:26 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[plot]]></category>
		<category><![CDATA[polar coordinates]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=102</guid>
		<description><![CDATA[If you are trying to generate effects in a circular pattern, like a planet's orbit then polar coordinates are the way to go. Here's a brief discussion on the topic of polar coordinate plotting inFlash to create some very cool rotating effects without a lot of effort.]]></description>
			<content:encoded><![CDATA[<p class="intro">A long, long time ago someone requested that I post a tutorial based on some polar coordinate experiments I was doing. I think it&#8217;s about time to get this post published.<br />As usual, if you are just interested in the code, you can <a href="#polarcoordinate-downloads">skip straight to the source</a>.</p>
<h3>Polar Coordinate Basics</h3>
<p>In Flash, like most other graphics applications, elements are positioned using the Cartesian coordinate system. While you may not be familiar with the name, you are probably familiar with the way it works. Location coordinates are set using x and y positions. &#8220;x&#8221; represents a horizontal offset from the origin <em>(top left corner of the screen)</em>, and &#8220;y&#8221; represents the vertical offset from the origin.</p>
<p>The polar coordinate system also uses two values, r and θ (theta). &#8220;r&#8221; is the radial distance from the origin, and &#8220;θ&#8221; is the angular offset from 0 <em>(a line going straight up from the origin)</em>. The following image shows the differences between the two coordinate systems.</p>
<p><img src="http://orangesplotch.com/blog/wp-content/uploads/2009/03/polar-coordinates.png" alt="Plotting a point using cartesian and polar coordinates." title="Cartesian vs. Polar Coordinates" width="380" height="150" class="bordered" /></p>
<p>That&#8217;s all the explaining of the two coordinate systems that I&#8217;ll waste your time with here. If you&#8217;d like to learn more about them, you can consult Wikipedia.</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Polar_coordinate_system">http://en.wikipedia.org/wiki/Polar_coordinate_system</a></li>
<li><a href="http://en.wikipedia.org/wiki/Cartesian_coordinate_system">http://en.wikipedia.org/wiki/Cartesian_coordinate_system</a></li>
<ul>
<p>So why do we care? When positioning things in Flash, it is usually easier to use the default Cartesian (x, y) system. However, for positioning objects that rotate around a fixed point, the Polar Coordinate system is much more efficient.</p>
<p>For example, here are two ways to move an object in a circle around the screen. One uses Cartesian coordinates and one uses Polar coordinates.</p>
<pre>// Cartesian coordinate circle
obj.x = radius * cos(t);
obj.y = radius * sin(t);
t += increment;

// Polar coordinate circle
obj.theta += increment;</pre>
<p>As you can see the code is much simpler in the Polar coordinate example. We didn&#8217;t have to deal with cos or sin, and we only had to change one value of the object (θ) since the radius of the circle doesn&#8217;t change. Are you convinced?</p>
<p>Unfortunately Flash does not directly support Polar coordinate plotting. It&#8217;s an easy problem to get around, though. For my work, I&#8217;ve created an Actionscript class derived from the Sprite class which adds Polar coordinate functionality. I call it PolarSprite. How&#8217;s that for creative! I&#8217;m not going to pretend that I&#8217;m the first person to have done this, or that my class is the most elegant/efficient one out there. But it works great for me.</p>
<h3>How to go Polar</h3>
<p>I&#8217;m not going to go into the details of my PolarSprite class. You can look at the source code if you really want to see how it works. However, I will quickly show you the translation from polar coordinates (r, θ) to Cartesian coordinates (x, y).</p>
<pre>x = offset_x + r * Math.cos( theta );
y = offset_y + r * Math.sin( theta );</pre>
<p>The offsets are used to set the origin of the polar coordinate somewhere away from the top left corner of the screen. Usually, you want the center of the rotation to be in the center of the screen when you have an object orbiting around in a circle.</p>
<h3>Experimenting in Polar</h3>
<p>Now that you know how to translate from the Polar coordinate frame into the Cartesian, the real fun begins. Here is some example AS3 code using the PolarSprite class to make an object move in a simple circle.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_1" width="500" height="180">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/07/polarcircle.swf" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/07/polarcircle.swf" width="500" height="180" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<pre>public function PolarCircle(){
  // create and initialize the animation
  inc = 0.1; // how much to rotate each frame
  hero = new PolarSprite();
  hero.SetOrigin(250, 50);
  hero.r = 50; // radius of the circle animation
  hero.addChild(new BigHero()); // BigHero is the flying guy graphic
  hero.addEventListener(Event.ENTER_FRAME, this.Rotate);
  addChild(hero);
}

private function Rotate(event:Event):void {
  // rotate the image in a circle
  hero.theta += inc;
}</pre>
<p>And there you go. Flying, polar-coordinate Flash fun. For all my talking, it really isn&#8217;t that complicated to do. In a later post I&#8217;ll go over ways to get some really cool variations in your animations, but for now, here&#8217;s a little teaser.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_2" width="500" height="180" class="align-right">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2009/04/polarexample1.swf" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2009/04/polarexample1.swf" width="500" height="180" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>Polar Source</h3>
<p>Here are the source files for your downloading pleasure. Feel free to use them however you&#8217;d like. And if you really want to make my day, send me a link so I can check out your work. Enjoy!</p>
<ul id="polarcoordinate-downloads" class="downloads">
<li><a title="Download the source files used in this tutorial." type="zip" href="http://orangesplotch.com/files/PolarCoordinateExamples.zip">Polar Coordinate Actionscript 3.0 source files.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/tutorial-polar-coordinate-plotting-in-actionscript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SwfObj Version 0.6 Released</title>
		<link>http://orangesplotch.com/blog/swfobj-version-06-released/</link>
		<comments>http://orangesplotch.com/blog/swfobj-version-06-released/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 21:17:36 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[SwfObj]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[media library]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[swfobject]]></category>
		<category><![CDATA[wp plugin]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=113</guid>
		<description><![CDATA[SwfObj just received some needed bug fixes. You can view some notes on the changes here. Or just go and <a href="http://wordpress.org/extend/plugins/swfobj/" title="Download the SwfObj WordPress plugin.">get the latest version</a>.]]></description>
			<content:encoded><![CDATA[<p class="intro">A new version of SwfObj just shipped out of the factory today. This release fixes a couple of bugs that were recently brought to my attention by users like you.</p>
<h3>Taming the big bully</h3>
<p>Apparently, unknown to me, this plugin has been inserting swfobj shortcode whenever a media object is imported into a post from the Media Library, whether it is a Flash object or not. That kind of over-aggressive attitude is not welcome around here. As a result I added a media check to the import function. Now the swfobj shortcode is only inserted when embedding Flash objects. I also sent the plugin to time-out and told him he needed to apologize to everyone for his bad behavior.</p>
<h3>Class-itis</h3>
<p>A minor bug fix that most people probably won&#8217;t notice involved cleaning up the class attribute. It was being added to both object tags as well as being placed in a defunct param tag. The class attribute is now only applied to the outer object tag and no defunct param tags to speak of.</p>
<p class="aside">I&#8217;d also like to take this chance to thank all of you who have sent in feedback both good and bad on this plugin. Thank you for taking the time to contact me so I can continue to improve the SwfObj plugin. And a very big thanks to the generous person who recently sent me a donation as well! <br />Please continue to send any bug or feature requests you have. All feedback good and bad is appreciated.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-version-06-released/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flash Player 10</title>
		<link>http://orangesplotch.com/blog/flash-player-10/</link>
		<comments>http://orangesplotch.com/blog/flash-player-10/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 16:50:43 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[player]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=110</guid>
		<description><![CDATA[Flash released version 10 of their player. It comes with one feature I am especially excited about. Keyboard inputs in fullscreen mode!]]></description>
			<content:encoded><![CDATA[<p class="intro">I turned on my computer today and was greeted with a Flash Player update request. Being the curious fellow that I am, I went and checked the release notes and made a very pleasant discovery.</p>
<h3>Flash Player 10 supports keyboard inputs in fullscreen mode!</h3>
<p>Many of you may not be aware, but when Flash originally added support for fullscreen mode in version 9, they bizarrely blocked everything but mouse inputs when a user switched to full screen. This meant that all interactivity had to come from the mouse. They stated it was a security measure, <em>which may be true</em>, but seemed a bit excessive. It was a real downer for me seeing the possibilities of what could be done in fullscreen mode, and not being able to do them because of the limitations.</p>
<p>But now that is no more. I know I&#8217;m not the only one excited about this feature, so get ready to see all of your favorite games now available in fullscreen mode. And hopefully Adobe&#8217;s fears of secret fullscreen popups stealing people&#8217;s identities won&#8217;t come to fruition. We&#8217;ll have to wait and see how this feature ends up being used and abused over the next few months.</p>
<p class="update"><strong>Update: </strong> Guess I should read the fine print. While this does bring support for arrow, shift, spacebar and enter keys; it still blocks input from what they are calling &#8220;print&#8221; keys. Print keys apparently are all of the letter/number keys on the keyboard. Better than nothing, but still frustrating. No support for text blocks in fullscreen mode. Oh well.</p>
<p class="aside">There are some other great features included, so if you are that kind of nerd, go check out <a title="Flash Player 10 release notes" href="http://www.adobe.com/go/flplayer10_rn">the release notes</a> yourself. <em>(WARNING: the notes are in a large pdf that showed up in Chinese in my browser, so you may want to download it rather than viewing it in your browser)</em></p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/flash-player-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SwfObj version 0.3 released</title>
		<link>http://orangesplotch.com/blog/swfobj-version-03-released/</link>
		<comments>http://orangesplotch.com/blog/swfobj-version-03-released/#comments</comments>
		<pubDate>Fri, 23 May 2008 20:28:19 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Site]]></category>
		<category><![CDATA[SwfObj]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[swfobject]]></category>
		<category><![CDATA[wordpress 2.5]]></category>
		<category><![CDATA[wp plugin]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=93</guid>
		<description><![CDATA[A new release of the SwfObj WordPress plugin just in time for Memorial Day. So go grill up some hamburgers and when you get a chance, update your plugins. It seems SwfObj is all I've been talking about for the last little while.]]></description>
			<content:encoded><![CDATA[<p class="intro">Last night I quietly released version 0.3 of the SwfObj WordPress plugin. The plugin is making steady progress towards an official 1.0 release. I&#8217;ll touch on the new features, but try to keep this post short so you can enjoy your Memorial Day weekend.</p>
<h3>Upgraded interface</h3>
<p>If you use the media toolbar to insert Flash objects into your posts, you will now find a lot more options available for customizing the embedded object. These include width, height, alignment, id, class, allowfullscreen, etc. Any options filled in will be included in the auto-generated shortcode when the object is inserted in the post.</p>
<p><a href="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss3.png"><img class="alignnone size-full wp-image-95" title="swfobj_ss3" src="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss3.png" alt="SwfObj plugin screenshot showing advanced options hidden." width="400" height="326" /></a></p>
<p>In an effort to keep the library interface clean and practical, the advanced options are tucked away by default. If you want to use them to embed an object, click &#8220;Show Advanced Options&#8221; and they magically appear. The interface is still a bit cluttered, but its the best I&#8217;ve got for now.</p>
<p><a href="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss2.png"><img class="alignnone size-full wp-image-94" title="swfobj_ss2" src="http://orangesplotch.com/blog/wp-content/uploads/2008/05/swfobj_ss2.png" alt="SwfObj plugin screenshot showing media library view." width="400" height="328" /></a></p>
<h3>The webpage</h3>
<p><a href="http://orangesplotch.com/blog/swfobj/">SwfObj&#8217;s official web page</a> also got an upgraded look. It has two fat download and donate buttons. I also added a &#8220;recent news&#8221; blurb, so you can quickly see any new posts about the plugin. <strong>Pretty exciting.</strong> Ok, not really.</p>
<h3>The future</h3>
<p>There is still more to be done on SwfObj. Not all of the Flash parameters are supported yet. The code could use some polishing. And lots of testing and bug fixing. If anyone has any problems or feature requests, please let me know.</p>
<p>Hopefully I&#8217;ll get some translations in as well. <em>Any takers?<br />
</em></p>
<p>Updates probably won&#8217;t be as frequent as the last two releases, though. Most of the major features are in now. Rather than playing with plugins all the time, I think it&#8217;s time to start doing some actual Flash.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-version-03-released/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SwfObj Plugin Unleashed</title>
		<link>http://orangesplotch.com/blog/swfobj-plugin-unleashed/</link>
		<comments>http://orangesplotch.com/blog/swfobj-plugin-unleashed/#comments</comments>
		<pubDate>Tue, 20 May 2008 07:44:12 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[SPLoTCH]]></category>
		<category><![CDATA[SwfObj]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[swf]]></category>
		<category><![CDATA[swfobject]]></category>
		<category><![CDATA[wordpress 2.5]]></category>
		<category><![CDATA[wp plugin]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=92</guid>
		<description><![CDATA[A new version of the SwfObj WordPress plugin was released today. Come see what's new.]]></description>
			<content:encoded><![CDATA[<p class="intro">It&#8217;s been almost one week since I released the SwfObj plugin for WordPress. In that time its been downloaded 65 times and 2 people have contacted me about it. In my opinion that&#8217;s not too shabby. So now what?</p>
<p><strong>SwfObj is overdue for an overhaul</strong>. As I stated in my <a href="http://orangesplotch.com/blog/swfobj-wordpress-plugin/">original release announcement</a>, the purpose of this plugin is to take the pain out of uploading and embedding Flash media in WordPress. Right now it makes it easier to embed content, but you still have to upload the Flash files to the server manually, figure out their URLs, and then type out the shortcode. This falls far short of being painless.</p>
<p>Today SwfObj is taking a step in the right direction. Expanded features now make uploading and embedding Flash content into WordPress just a little easier. <strong>Still not painless, but closer.</strong></p>
<h3>Upload Flash directly</h3>
<p>When you install and enable the latest SwfObj release, a new media button will appear in your post editor. This allows you to upload new Flash content to your WordPress Media Library for embedding. Additionally you can view all of the Flash content currently in your library and insert it into your post. Simply click on the &#8220;Media Library&#8221; to see all of your Flash objects.</p>
<p>Inserting Flash content from the library injects the proper shortcode into the post or page you are editing. Currently it only embeds the &#8220;<code>src</code>&#8221; and &#8220;<code>alt</code>&#8221; properties. Any additional properties such as dimensions have to be added manually. Future releases will auto-embed more properties.</p>
<h3>Multiple language support</h3>
<p>This release also adds international support for the SwfObj plugin. If anyone wants to translate this into their native language, please do. I&#8217;d love to have this available in several languages.</p>
<h3>Try it out</h3>
<p>If you use Flash a lot in your posts and are looking for an easier way to upload and embed them, this plugin may be something you&#8217;ll want.  Feel free to download <a title="SwfObj WordPress Plugin" href="http://wordpress.org/extend/plugins/swfobj">the latest version of the SwfObj plugin</a> and try it out. Let me know if you have any questions or comments. I&#8217;d love to hear about any features you&#8217;d like to see, or problems you have encountered while using it. All feedback, <em>good and bad</em>, is welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/swfobj-plugin-unleashed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Actionscript Tutorial: Starry Night</title>
		<link>http://orangesplotch.com/blog/actionscript-tutorial-starry-night/</link>
		<comments>http://orangesplotch.com/blog/actionscript-tutorial-starry-night/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 14:11:27 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3.0]]></category>
		<category><![CDATA[night sky]]></category>
		<category><![CDATA[star]]></category>
		<category><![CDATA[twinkle]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=28</guid>
		<description><![CDATA[This is a very basic Actionscript tutorial that will show you how to make a sky full of twinkling stars. Everything for this tutorial will be done in Actionscript, using Actionscript 3.0. If you're interested, jump on in and check it out.]]></description>
			<content:encoded><![CDATA[<p class="intro">This is a very basic Actionscript tutorial that will show you how to make a sky full of twinkling stars. Everything for this tutorial will be done in Actionscript, using Actionscript 3.0. It is targeted at novices, but hopefully pros and newbies alike can get something from it. Make a wish on the first star you see and maybe your dreams will come true.</p>
<h3>The first star I see tonight</h3>
<p>First we need to make our black sky. This is going to be a black rectangle that covers the entire area of the <code>Stage</code>. We&#8217;ll draw this using a Sprite, which is a type of object that can hold graphics, such as black rectangles. Here is how simple it is to make night.</p>
<pre>bg = new Sprite();
bg.graphics.beginFill(0);
bg.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
addChild(bg);</pre>
<p>The last line adds the <code>bg</code> <code>Sprite</code> to the <code>Stage</code>. This is what triggers the Flash player to actually render the object. Until you put this line in, <code>bg</code> is invisible.</p>
<p>Next we are going to need to draw a star. The stars are just tiny circles, so there isn&#8217;t too much to drawing them. Make the star by creating a new <code>Sprite</code>, drawing a white circle in it with a 2 pixel radius, positioning it, then adding it to the <code>Stage</code> so it will be displayed. I&#8217;ve made the positioning random so every time you run it, your star will be in a different place. The following Actionscript is all we need to dynamically draw our star.</p>
<pre>var star:Sprite = new Sprite();
star.graphics.beginFill(0xFFFFFF);
star.graphics.drawCircle(0, 0, 2);
star.x = Math.random() * stage.stageWidth;
star.y = Math.random() * stage.stageHeight;
addChild(star);</pre>
<p class="note">In all of the following examples, you can click on the image to regenerate it.</p>
<p>Here is the resulting dynamically created star.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_3" width="500" height="90">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/lonestar.swf" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/lonestar.swf" width="500" height="90" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>The Milky Way</h3>
<p>One star is nice and all, but what we really want is a whole sky full of stars. The Universe has bajillions of stars, but for this tutorial we&#8217;ll just make 100. The nice thing about doing this in Actionscript is that we can make 200 stars just as easily. All you need to do is change one number in the code.</p>
<p>To make lots of stars, we put the star creation in a for loop and run it as many times as we want stars. It may surprise you just how easy it is to make lots of stars now that we know how to make just one. Here&#8217;s the code with just two extra lines.</p>
<pre><strong>for (var i:Number = 0; i&lt;100; ++i) {</strong>
    var star:Sprite = new Sprite();
    star.graphics.beginFill(0xFFFFFF);
    star.graphics.drawCircle(0, 0, 2);
    star.x = Math.random() * stage.stageWidth;
    star.y = Math.random() * stage.stageHeight;
    addChild(star);
<strong>}</strong></pre>
<p>And you&#8217;ve got a starry sky.</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_4" width="500" height="90">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_samesize.swf" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_samesize.swf" width="500" height="90" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<p>Now they say variety is the spice of life, but all of these stars are exactly the same, just in a different location. What we want to do now is make them all different sizes. I am going to vary mine between a radius of 0.25 and 1.5, but you can feel free to make yours whatever size you want. Changing the size of the stars to be random is again, very easy. We just need to change one line of code.</p>
<pre>for (var i:Number = 0; i&lt;100; ++i) {
    var star:Sprite = new Sprite();
    star.graphics.beginFill(0xFFFFFF);
    star.graphics.drawCircle(0, 0, <strong>((Math.random() * 1.25) + 0.25)</strong>);
    star.x = Math.random() * stage.stageWidth;
    star.y = Math.random() * stage.stageHeight;
    addChild(star);
}</pre>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_5" width="500" height="90">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_notwinkle.swf" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/starrynight_notwinkle.swf" width="500" height="90" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>Twinkle, twinkle little star</h3>
<p>To make this starry sky even better, you can add a little twinkle effect. I&#8217;ve been playing around with this quite a bit to try and get just the right effect. You want them to flicker, but not too much. It is a sweet spot between not being able to notice the twinkle, to it being way too obvious and annoying.</p>
<p>The effect is by adding an <code>ENTER_FRAME</code> event handler to each star <code>Sprite</code>. The <code>ENTER_FRAME </code>event handler is a function that is called every frame of your movie. To make the stars twinkle I randomly change their their <code>alpha</code> and size very subtly. Also, I keep the value within a certain limit so that the stars don&#8217;t disappear on me. Play around with the effect on your own to find your sweet spot.</p>
<pre>public function Twinkle(event:Event):void {
    // get the current star to tweak
    var _self:Sprite = Sprite(event.currentTarget);

    // change the alpha and size of the star
    _self.alpha += Math.random() * 0.02 - 0.01;
    _self.scaleX = _self.alpha * 0.5 + 0.5;
    _self.scaleY = _self.alpha * 0.5 + 0.5;

    // do some bounds checking
    if (_self.alpha &lt; 0.5) _self.alpha = 0.5;
    if (_self.alpha &gt; 1) _self.alpha = 1;
}</pre>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_6" width="500" height="196">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" />
      <param name="allowfullscreen" value="true" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/constellation.swf" width="500" height="196" allowfullscreen="true" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

<h3>To infinity and beyond</h3>
<p>You can use this wherever you want to throw some stars into a scene. If you don&#8217;t want the stars, or the night sky to cover the entire stage, simply change the bounds from the stage.stageWidth and stage.stageHeight to whatever you want them to be. Or put other elements on top of this, like mountains, or a cityscape or whatever you feel like. The possibilities are as numberless as the stars <em>(sorry, that was really pathetic)</em>.</p>
<p>Feel free to download the full source files used to make this. Included is a bonus full screen enabled version.<strong> Now that&#8217;s exciting!</strong></p>
<ul id="starrynight-downloads" class="downloads">
<li><a title="Download the source files used in this tutorial." type="zip" href="http://orangesplotch.com/files/starrynight.zip">Starry Night Actionscript 3.0 source files.</a></li>
</ul>
<p class="aside">And that&#8217;s the end of our tutorial. Hope you enjoyed your stay. Feel free to <a href="#discussion">leave any comments or questions</a> you have. <strong>Thanks!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/actionscript-tutorial-starry-night/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Flash Fullscreen Fun</title>
		<link>http://orangesplotch.com/blog/flash-fullscreen-fun/</link>
		<comments>http://orangesplotch.com/blog/flash-fullscreen-fun/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 20:09:56 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[actionscript 3.0]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[fullscreen]]></category>
		<category><![CDATA[hyperspace]]></category>
		<category><![CDATA[star field]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=58</guid>
		<description><![CDATA[While delving deep into the mysteries of Actionscript 3.0, I came across something that really made me smile. Apparently the Flash Player 9.x allows for FullScreen mode. I must have been living in a cave for the past couple of years. How have I never seen this before?]]></description>
			<content:encoded><![CDATA[<p class="intro">While delving deep into the mysteries of Actionscript 3.0, I came across something that really made me smile. Apparently the Flash Player 9.x allows for FullScreen mode. I must have been living in a cave for the past couple of years. <strong>How have I never seen this before?</strong></p>
<div class="object-wrapper">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_7" width="500" height="250">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/fullscreen.swf" />
      <param name="allowfullscreen" value="true" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/fullscreen.swf" width="500" height="250" allowfullscreen="true" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
<br />
<em>Click anywhere on the video to go to fullscreen mode.</em></div>
<p>The great thing is how easy it is to do. Here is a handler that turns fullscreen mode on and off.</p>
<pre>private function FullScreenSwitch(event:Event):void {
  if (StageDisplayState.FULL_SCREEN == stage.displayState) {
    stage.displayState = StageDisplayState.NORMAL;
  }
  else {
    stage.displayState = StageDisplayState.FULL_SCREEN;
  }
}</pre>
<p>There are a few caveats to the system and one of them is really frustrating.</p>
<p><strong>First:</strong> fullscreen mode can only be set by the user interacting with something, such as clicking with the mouse. Fullscreen mode can&#8217;t just be dynamically turned on without any user interaction. Fair enough. I think I&#8217;d be pretty ticked if web sites had banner ads that suddenly went fullscreen on their own.</p>
<p><strong>Second:</strong> a little text blurb shows up when the video switches to text mode telling the user they can switch it off by hitting the Escape key. This fades away after a couple of seconds. Again, I think this is great. You don&#8217;t want someone who accidentally makes a Flash video full screen to not be able to get out of it.</p>
<p><strong>Third:</strong> and very annoyingly, all keyboard inputs are blocked in fullscreen mode. <em>What!?!</em> Apparently Adobe thinks it is a huge security risk to allow keyboard input while in fullscreen mode. I don&#8217;t understand this at all, and it totally ruins most of the great ideas I had for implementing fullscreen mode.  Can you imagine how much cooler games would be if they were in fullscreen. Too bad! Unless they are mouse only games, you can&#8217;t play them in fullscreen. Maybe that&#8217;s why I hadn&#8217;t heard of this until recently. Better than nothing, though.</p>
<p class="aside">For more detailed info on how it all works, check out this <a href="http://www.adobe.com/devnet/flashplayer/articles/full_screen_mode_02.html">fullscreen tutorial over at Adobe</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/flash-fullscreen-fun/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash Tutorial: Elastic Object Follower</title>
		<link>http://orangesplotch.com/blog/flash-tutorial-elastic-object-follower/</link>
		<comments>http://orangesplotch.com/blog/flash-tutorial-elastic-object-follower/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 14:55:04 +0000</pubDate>
		<dc:creator>mattc</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[elastic]]></category>
		<category><![CDATA[follow the leader]]></category>
		<category><![CDATA[momentum]]></category>
		<category><![CDATA[mouse]]></category>

		<guid isPermaLink="false">http://orangesplotch.com/blog/?p=29</guid>
		<description><![CDATA[Finally, a new Flash tutorial. In this article, we'll explore how to make one object follow another around like a little puppy dog. This tutorial includes both Actionscript 3.0 and Actionscript 2.0 versions. So if you always wanted to make more followers, now you can.]]></description>
			<content:encoded><![CDATA[<p class="intro">In this tutorial I will show you how to make one object follow another object in Flash. Then I&#8217;ll show you how to make the effect more elastic. It&#8217;s up to you to figure out an application for it. I use it a lot to get things to follow the mouse around.</p>
<p>The following scripts are written in Actionscript 3.0. However, I&#8217;ve also included a .fla done in Flash 8 in for anyone who wants to see it in Actionscript 2.0. If you just want the files, feel free to <a href="#elasticfollower-downloads">jump down and download them now</a>.</p>
<h3>We&#8217;re following the leader!</h3>
<p>So first we need to get one object to follow the other object around. Having a two year old son and a dog, I have a lot of experience with things following you. In these examples, the object follows the mouse pointer.</p>
<p>Getting an object to follow the mouse is fairly simple in Flash. In fact, you can just use the <code>startDrag()</code> function, but that sticks the object to the mouse. We&#8217;d like it to follow at a distance, so we&#8217;ll need to make our own function to do that. This function will be an <code>EnterFrame</code> event handler.</p>
<p class="note">Rather than documenting the entire script here, I&#8217;ll just focus on where the real action is. The full Actionscript files are available for download at the end of the article.</p>
<pre>private function FollowMouse(event:Event):void {
    // follow the mouse, but not too closely
    distx = follower.x - mouseX;
    disty = follower.y - mouseY;
    follower.x -= distx / 10;
    follower.y -= disty / 10;
}</pre>
<p>Basically, all we do here is figure out how far away the follower object is from the mouse. Then we move the object a certain amount closer. Here we are moving 10% closer each frame. And here is the resulting mouse following effect.</p>
<div class="object-wrapper">
<p class="title">Mouse Follower</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_8" width="500" height="196">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/follow.swf" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/follow.swf" width="500" height="196" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

</div>
<h3>Now add some elasticity</h3>
<p>Now that the object is following, let&#8217;s add a little personality to the effect. I know when my son is following me around, he rarely makes a straight path directly to me, nor is he always able to stop once he&#8217;s caught up.</p>
<p>Rather than directly moving towards the mouse, we&#8217;ll use momentum to insert some elasticity to the objects response. This makes it appear that the object is attached to the mouse by a rubber band. And it is surprisingly easy to do.</p>
<pre>private function FollowMouse(event:Event):void {
    // follow the mouse in a more elastic way
    // by using momentum
    distx = follower.x - mouseX;
    disty = follower.y - mouseY;
    momentumx -= distx / 3;
    momentumy -= disty / 3;

    // dampen the momentum a little
    momentumx *= 0.75;
    momentumy *= 0.75;

    // go get that mouse!
    follower.x += momentumx;
    follower.y += momentumy;
}</pre>
<p>You will notice that we had to dampen the momentum a little. This keeps it from bouncing indefinitely off the screen. The number you use here needs to be between <code>0.0</code> and <code>1.0</code>. Anything else and you&#8217;ll have flubber that shoots off the screen, never to return.</p>
<p>The closer this value is to <code>1.0</code>, the faster your object will move and the more it will swing around. The closer it is to <code>0.0</code>, the slower it will move and the less it will overshoot its target. Experiment with it a bit to get the effect you want. You can also speed or slow the object by changing the number that you divide the distance by when adjusting the momentum.</p>
<div class="object-wrapper">
<p class="title">Elastic Mouse Follower</p>

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="swfobj_9" width="500" height="196">
      <param name="movie" value="http://orangesplotch.com/blog/wp-content/uploads/2008/04/elasticfollow.swf" />
      <param name="wmode" value="opaque" />
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="http://orangesplotch.com/blog/wp-content/uploads/2008/04/elasticfollow.swf" width="500" height="196" wmode="opaque">
      <!--<![endif]-->
        
      <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>

</div>
<h3>Follow another object</h3>
<p>So now you can follow the mouse. What about when you want to follow something else? That&#8217;s what makes this script so simple, just replace <code>mouseX</code> and <code>mouseY</code> with the <code>x</code> and <code>y</code> of the object you want to follow and you are set.</p>
<pre>distx = follower.x - leader.x;
disty = follower.y - leader.y;</pre>
<h3>Download the fun</h3>
<ul id="elasticfollower-downloads" class="downloads">
<li><a title="Download the source files used in this tutorial." type="zip" href="http://orangesplotch.com/files/FollowTutorial.zip">Elastic mouse follower Actionscript 3.0 source files.</a></li>
<li><a title="Download the Flash 8 version of this tutorial." type="zip" href="http://orangesplotch.com/files/ElasticFollower.fla.zip">Elastic follower in Flash 8 form <em>(Actionscript 2.0)</em>.</a></li>
</ul>
<p class="aside">Please feel free to leave any comments or questions you may have about this tutorial. That&#8217;s what the comments are all about.</p>
]]></content:encoded>
			<wfw:commentRss>http://orangesplotch.com/blog/flash-tutorial-elastic-object-follower/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
