<?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/"
	>

<channel>
	<title>The Effect Generator</title>
	<atom:link href="http://effectgenerator.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://effectgenerator.com/blog</link>
	<description>Create Flash in a flash, in Flash</description>
	<pubDate>Sat, 04 Jul 2009 13:33:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pixelate Effect</title>
		<link>http://effectgenerator.com/blog/?p=49</link>
		<comments>http://effectgenerator.com/blog/?p=49#comments</comments>
		<pubDate>Sat, 04 Jul 2009 13:33:07 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=49</guid>
		<description><![CDATA[We&#8217;ve just added a new &#8216;pixelate&#8217; effect to the collection. The effect is displayed under the &#8216;Animations&#8217; heading, and allows you to use it to fade in and out components, as well as to react to mouse events. Here&#8217;s an example of it used as a slideshow transition:



There are three main parameters to the effect:

Pixel [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just added a new &#8216;pixelate&#8217; effect to the collection. The effect is displayed under the &#8216;Animations&#8217; heading, and allows you to use it to fade in and out components, as well as to react to mouse events. Here&#8217;s an example of it used as a slideshow transition:</p>
<div id='effect199577' style='width:330px;height:250px;'>
</div>
<p><script src="http://www.effectgenerator.com/1.0.7/effect.php?id=199577&#038;replace=effect199577"
 type="text/javascript"></script></p>
<p>There are three main parameters to the effect:</p>
<ul>
<li><strong>Pixel Size</strong> - determines the size of the square blocks used by the effect.</li>
<li><strong>Time Spread</strong> - determines the number of blocks fading at any one time (higher number means fewer blocks).</li>
<li><strong>Pattern</strong> - the pattern that determines the order in which blocks are faded.</li>
</ul>
<p>We hope you enjoy this new addition. As always, let us know if you have any other suggestions for new features!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d49').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d49" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=49&amp;title=Pixelate+Effect" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=49&amp;title=Pixelate+Effect" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Pixelate+Effect&amp;url=http://effectgenerator.com/blog/?p=49&amp;title=Pixelate+Effect" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=49" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=49&amp;title=Pixelate+Effect" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=49&amp;title=Pixelate+Effect" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=49&amp;title=Pixelate+Effect" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=49&amp;title=Pixelate+Effect" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=49" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=49&amp;t=Pixelate+Effect" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d49').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=49</wfw:commentRss>
		</item>
		<item>
		<title>Accent characters and self-hosting</title>
		<link>http://effectgenerator.com/blog/?p=45</link>
		<comments>http://effectgenerator.com/blog/?p=45#comments</comments>
		<pubDate>Mon, 25 May 2009 12:22:12 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=45</guid>
		<description><![CDATA[We&#8217;ve just released an updated version of The Effect Generator based on feedback that we&#8217;ve had from our users. New features with this version include:

Allowing accent characters in many text fonts
A new service which lets us package up effects so that you can host them yourself
Play and pause buttons for easier editing of effects
New extra [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just released an updated version of <a href="http://www.effectgenerator.com/" >The Effect Generator</a> based on feedback that we&#8217;ve had from our users. New features with this version include:</p>
<ul>
<li>Allowing accent characters in many text fonts</li>
<li>A new service which lets us package up effects so that you can host them yourself</li>
<li>Play and pause buttons for easier editing of effects</li>
<li>New extra &#8216;Cube&#8217; effect which lets you rotate any content on the surface of a 3d cube</li>
<li>Improvements to loading speed</li>
</ul>
<p>We hope you like the new content - <a href="http://www.effectgenerator.com/doc/contact.php" >let us know if you uncover any problems or have any suggestions for new features</a>!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d45').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d45" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=45&amp;title=Accent+characters+and+self-hosting" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=45&amp;title=Accent+characters+and+self-hosting" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Accent+characters+and+self-hosting&amp;url=http://effectgenerator.com/blog/?p=45&amp;title=Accent+characters+and+self-hosting" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=45" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=45&amp;title=Accent+characters+and+self-hosting" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=45&amp;title=Accent+characters+and+self-hosting" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=45&amp;title=Accent+characters+and+self-hosting" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=45&amp;title=Accent+characters+and+self-hosting" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=45" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=45&amp;t=Accent+characters+and+self-hosting" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d45').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=45</wfw:commentRss>
		</item>
		<item>
		<title>Flex vs. Silverlight: The Elephant in the Room</title>
		<link>http://effectgenerator.com/blog/?p=35</link>
		<comments>http://effectgenerator.com/blog/?p=35#comments</comments>
		<pubDate>Sat, 21 Feb 2009 12:28:24 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=35</guid>
		<description><![CDATA[The battle for making riches out of RIA platforms is now really heating up between Adobe&#8217;s Flash/Flex platform and Microsoft&#8217;s Silverlight. This is an important area for the future of web applications, and is bound to give the winner a critical flow of developer bucks. 
Up until now I&#8217;ve been an advocate of Flex through-and-through. [...]]]></description>
			<content:encoded><![CDATA[<p>The battle for making riches out of RIA platforms is now really heating up between Adobe&#8217;s Flash/Flex platform and Microsoft&#8217;s Silverlight. This is an important area for the future of web applications, and is bound to give the winner a critical flow of developer bucks. </p>
<p>Up until now I&#8217;ve been an advocate of Flex through-and-through. This was partly, I admit, because I&#8217;ve always had the feeling that Silverlight has just been a copy of the Flex/Flash environment. But in the real world, it doesn&#8217;t matter so much who got there first, and it&#8217;s the current productivity and functionality benefits that count. And so it&#8217;s only come to dawn on me recently that there&#8217;s one big problem with Flex that Adobe has yet to face up to&#8230;if they can. And it&#8217;s potentially a killer.</p>
<h2>The problem</h2>
<p>At first the problem seems a like not such a big deal. In fact, for many RIAs out there today, it probably makes not once single bit of difference. But I think it really is a fairly <em>vital feature</em> that Microsoft offers out of the box, but Adobe has somehow managed to over-look. And I think it&#8217;s only because of the relative immaturity of RIAs, and the strong <em>event</em> focus of Adobe&#8217;s Flash platform that has caused it to be overlooked.</p>
<p>The problem comes down to one word: threading. In short, Silverlight has it, and Flash doesn&#8217;t. We&#8217;ll talk a bit about <em>why</em> Adobe haven&#8217;t provided this below, but first let&#8217;s examine why it&#8217;s an issue.</p>
<h2>The scale of the problem</h2>
<p>How important is multi-threading in the RIA space? Well, of course, that rather depends on what it is that you&#8217;re trying to build. As I have already said, I don&#8217;t think this is a problem for many of the RIAs out there today. On the other-hand, it certainly is for some. As RIA apps grow more complex and libraries become sophisticated and nested, it&#8217;s going to be more of a problem.</p>
<h3>Synthesizers</h3>
<p>Take the fantasic <a href="http://www.noteflight.com/" onclick="javascript:urchinTracker ('/outbound/article/www.noteflight.com');">Noteflight</a>. If you haven&#8217;t yet seen this app then you really need to check it out. This Flex RIA app lets you drag around musical notation to compose scores, which may then be played-back using a synth that overlays sounds loaded from .wav files on noteflights servers. It&#8217;s a fantastic app, and I&#8217;m pretty sure that tools like this will bring to many musicians what mp3s have brought to music listeners (i.e. mass, systematic theft of music, which has, somehow, to be properly monetized).</p>
<p>But &#8216;.wav&#8217; files? What&#8217;s going on there? Surely nobody would notice if they noteflight used mp3s for thier sound samples, and wouldn&#8217;t the download time be a million times better? Well, as it turns out, noteflight.com used wav files because &#8220;<em><a href="http://joeberkovitz.com/blog/2008/10/06/introducing-noteflight/" onclick="javascript:urchinTracker ('/outbound/article/joeberkovitz.com');">an ActionScript3-based decoder is inevitably going to be slow (and consume development cycles too)</a></em>&#8220;.</p>
<p>Now maybe I&#8217;m reading between the lines a little bit, but here is what I suspect is going on. If you do a method call to decode an mp3 file in ActionScript then it&#8217;s going to take quite a long time to complete. During that time, because Flash is single threaded, absolutely nothing can happen in the UI. Nothing. Progress indicators can&#8217;t update, mouse events can&#8217;t be processed, and the user will generally be left with an impression that the RIA is temporarily dead. This isn&#8217;t at all good.</p>
<p>For Silverlight, on the other hand, I believe it would be a doddle to spawn a worker process to sort this out, and meanwhile still remain responsive. Just like what you&#8217;d expect out of a modern-day platform.</p>
<h3>Image processing</h3>
<p>For a chronic example, look at the <a href="http://quickimageresizer.com/" onclick="javascript:urchinTracker ('/outbound/article/quickimageresizer.com');">quick image resizer</a>. This site is pretty nifty because it lets you resize a jpg, directly from your local filesystem, without once transferring an image between you and the RIA&#8217;s server.</p>
<p>But my-oh-my have you seen what happens when you resize a large image taken with a digital camera? Nothing&#8230;.for a long while, and then&#8230;..your image. This simply won&#8217;t do.</p>
<h3>Other apps</h3>
<p>It&#8217;s not hard to extend this to a whole host of other applications that need threading. Doesn&#8217;t a word-processor need to spell check innocuously? Doesn&#8217;t any form of editor need to be able to process it&#8217;s content for saving, without blocking the UI? Is there any point in Flash Player 10 having <a href="http://www.kaourantin.net/2008/05/adobe-is-making-some-noise-part-2.html" onclick="javascript:urchinTracker ('/outbound/article/www.kaourantin.net');">support for audio processing</ if it can only be done in dribs and drabs (<a href="http://www.flashmagazine.com/news/detail/flash_player_10_feature_pixel_bender/">PixelBender</a> aside, which is kind of a cop out for certain flavours of processing, and besides, do <i>most</i> developers really want to have to code this stuff in a different language catered for mass parallel processing)?</p>
<h2>Why is Flash like this?</h2>
<p>The short answer to this is that Flash has grown organically and hasn&#8217;t always been intended for the sophisticated RIA applications that people are now starting to build with it. In fact, ActionScript was first created with much smaller ambitions: i.e. animated vector graphics. The Flash event model was ideal for this, queuing up messages for processing via a single thread. Now these original platform intentions have been hijacked to support the Flex libraries that enable such more complex embedded web content, but the underlying threading model didn&#8217;t change.</p>
<p>In contrast, Silverlight has been built from the ground up with more ambitious targets in mind: fully fledged applications.</p>
<h2>How can the problem be solved?</h2>
<p>Instead of moving in the direction of Silverlight, there are a few other steps that Flex developers can take to get around this problem. Unfortunately though, none of them are particuarly pleasant!</p>
<h3>Splitting tasks up</h3>
<p>One approach is to simply <a href="http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html" onclick="javascript:urchinTracker ('/outbound/article/blogs.adobe.com');">split up big processing tasks into small blocks</a> so that other events can be processed between each block. If this is possible then it&#8217;s certainly an approach, albeit an awkward one. It goes without saying, however, that it is a complete pain to manually divide up sequential composition into Flash&#8217;s event model.</p>
<h3>Spawning another VM</h3>
<p>Another approach is to get all your work done in a completely seperate Flash virtual machine. Flash&#8217;s <a href="http://osflash.org/localconnection" onclick="javascript:urchinTracker ('/outbound/article/osflash.org');">LocalConnection interface</a> is probably the best way to communicate with such a seperate process. Despite again being an obvious pain to code, this method is also likely to be pretty slow at transferring large amounts of data between the VMs, and there are all sorts of synchronization problems when you cater for the user having the same app open in multiple browser windows etc.</p>
<h3>Adobe extending the Flash Player and ActionScript</h3>
<p>It should be possible for Adobe to cater for multi-threading in a single virtual machine, but it&#8217;s likely to be a lot of work for them. Obviously, many of the libraries (including the Flex ones) would need to be rewritten to add thread-safety. Events would still have to be processed one at a time by a single thread to maintain backwards compatibility, since existing apps will depend on this.</p>
<p>Adobe&#8217;s stance on this is a little disappointing, as Alex from Adobe explains on his <a href="http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html" onclick="javascript:urchinTracker ('/outbound/article/blogs.adobe.com');">very useful blog</a>:</p>
<p><em>As we hear more from our users about the importance of threading, the higher its priority will be.</em></p>
<p>While it&#8217;s very nice that Adobe is taking our concerns into account, I can&#8217;t help thinking that this isn&#8217;t the best way for them to do business. Wouldn&#8217;t it be better if problems could be anticipated, rather than waiting until developers are upset about them? In this case, Microsoft seems to have managed this pretty well.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d35').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d35" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=35&amp;title=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=35&amp;title=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room&amp;url=http://effectgenerator.com/blog/?p=35&amp;title=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=35" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=35&amp;title=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=35&amp;title=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=35&amp;title=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=35&amp;title=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=35" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=35&amp;t=Flex+vs.+Silverlight%3A+The+Elephant+in+the+Room" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d35').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=35</wfw:commentRss>
		</item>
		<item>
		<title>AS3Wrapper: Pulling Flash objects into Javascript</title>
		<link>http://effectgenerator.com/blog/?p=33</link>
		<comments>http://effectgenerator.com/blog/?p=33#comments</comments>
		<pubDate>Mon, 26 May 2008 00:05:47 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Air]]></category>

		<category><![CDATA[Announcements]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=33</guid>
		<description><![CDATA[I&#8217;m very excited about a new tool that I&#8217;ve written this weekend called AS3Wrapper. It&#8217;s a Javascript library, compatible with IE and Firefox, that can pull the contents of the Flash virtual machine into Javascript.
The result is that the entire Flash API becomes accessible from regular script tags. Owing to the simlarities between the two [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very excited about a new tool that I&#8217;ve written this weekend called <a href="http://www.effectgenerator.com/AS3Wrapper/" >AS3Wrapper</a>. It&#8217;s a Javascript library, compatible with IE and Firefox, that can <em>pull the contents of the Flash virtual machine</em> into Javascript.</p>
<p>The result is that the <a href="http://livedocs.adobe.com/flex/201/langref/index.html" onclick="javascript:urchinTracker ('/outbound/article/livedocs.adobe.com');">entire Flash API</a> becomes accessible from regular script tags. Owing to the simlarities between the two languages, coding Flash in Javascript is actually incredibly natural, and what&#8217;s more, it also seems to have pretty nice performance!</p>
<p><strong>A Simple Example</strong></p>
<p>Here&#8217;s a <a href="http://effectgenerator.com/AS3Wrapper/example-drawing.html" >simple example at work</a>. I suggest you take a look at the source code to see how the Javascript is constructed.</p>
<p>You first have to create yourself a Flash player object:</p>
<pre>
var player = new
  AS3Wrapper.Player("content",100,100,false);
</pre>
<p>This replaces the div in your html page with id &#8216;content&#8217; to be a 100&#215;100 Flash player instance. The false parameter prevents transparency. The player might take a few moments to load, so assign a callback to setup your Flash scene:</p>
<pre>
player.onload = function(){
  // Do the meat of your Flash work here
}
</pre>
<p>Once the player has loaded, it&#8217;s javascript object will contain the <em>complete class hierarchy of the internal Flash API</em>. For example, player.flash.display.Sprite will be the constructor for the flash class <a href="http://livedocs.adobe.com/flex/201/langref/flash/display/Sprite.html" onclick="javascript:urchinTracker ('/outbound/article/livedocs.adobe.com');">flash.display.Sprite</a> inside player &#8216;player&#8217;. Here&#8217;s a screenshot from Firebug:</p>
<p><a href='http://effectgenerator.com/blog/wp-content/uploads/2008/05/firebug.gif'><img src="http://effectgenerator.com/blog/wp-content/uploads/2008/05/firebug.gif" alt="" title="The Flash API imported into Javascript Object" width="187" height="207" class="aligncenter size-full wp-image-34" /></a></p>
<p>To write Javascript for a particular player, use <em>with</em>. With blocks are also the equivalent of the ActionScript import statements. Apart from this, there is pretty much a direct correspondance between the two languages. For example:</p>
<pre>
with(playerInstance)
with(flash.display)
with(flash.net){
	var image = new Loader();
	image.load(new URLRequest(url));
	addChild(image);
}
</pre>
<p>is the Javascript equivalent of</p>
<pre>
import flash.display.*;
import flash.net.*;
... {
	var image:Loader = new Loader();
	image.load(new URLRequest(url));
	addChild(image);
}
</pre>
<p>Pretty similar, huh?</p>
<p>Some things to note: Javascript doesn&#8217;t have type annotations (obviously), and because IE doesn&#8217;t support getters and setters, I&#8217;ve created methods instead - getWidth() for getting a Flash &#8216;width&#8217; property and setWidth(v) for setting it.</p>
<p><strong>What next?</strong></p>
<p>One impact of this might be that it opens up Flash programming to a wider audience. Even though Flash compilers are free, having the code right there in HTML eliminates the extra step of installing extra tools. What&#8217;s more, any code generated in this way is naturally open.</p>
<p>By using the <a href="http://blog.papervision3d.org/" onclick="javascript:urchinTracker ('/outbound/article/blog.papervision3d.org');">Papervision3d</a> module (<a href="http://effectgenerator.com/AS3Wrapper/example-papervision1.html" >see this example</a>), you can now program quick-rendered 3d in Javascript. You can also use a Javascript console for interactive Flash programming and debugging. Maybe one day Flash grease-monkey scripts will exist? Who knows.</p>
<p>There are, of course, also many disadvantages: losing a richer programming environment, type checking and performance. But still, hopefully you&#8217;ll find playing with it a little bit of fun!</p>
<p><strong>Download</strong></p>
<p>You can download <a href="http://www.effectgenerator.com//AS3Wrapper/AS3Wrapper.zip" >AS3Wrapper here</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d33').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d33" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=33&amp;title=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=33&amp;title=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript&amp;url=http://effectgenerator.com/blog/?p=33&amp;title=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=33" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=33&amp;title=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=33&amp;title=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=33&amp;title=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=33&amp;title=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=33" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=33&amp;t=AS3Wrapper%3A+Pulling+Flash+objects+into+Javascript" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d33').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=33</wfw:commentRss>
		</item>
		<item>
		<title>FlicksTube: Turning YouTube Old-Style</title>
		<link>http://effectgenerator.com/blog/?p=32</link>
		<comments>http://effectgenerator.com/blog/?p=32#comments</comments>
		<pubDate>Thu, 03 Apr 2008 22:54:32 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[EffectGenerator]]></category>

		<category><![CDATA[FXML]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Generators]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[cinema]]></category>

		<category><![CDATA[effect]]></category>

		<category><![CDATA[film]]></category>

		<category><![CDATA[flicker]]></category>

		<category><![CDATA[generate]]></category>

		<category><![CDATA[generator]]></category>

		<category><![CDATA[grain]]></category>

		<category><![CDATA[old]]></category>

		<category><![CDATA[sepia]]></category>

		<category><![CDATA[video]]></category>

		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=32</guid>
		<description><![CDATA[
Transport your YouTube movies back in time with this bleached, jerky, flickery effect script!
Example


 


(original video here)
Code Generator
To get the code for your movie, find your movie on YouTube and copy and paste your URL here:

// 







Video Width:

Video Height:

Background Color:




Creating Your Own Effects
This old-style movie effect was created online using The Effect Generator. You can [...]]]></description>
			<content:encoded><![CDATA[<div style="background-color:#000000;color:#cccccc;padding:30px;">
Transport your YouTube movies back in time with this bleached, jerky, flickery effect script!</p>
<h3 style="color:#cccccc;">Example</h3>
<div style="text-align:center">
<div id='effect2235' style='width:330px;height:250px;'>
<a href='http://www.effectgenerator.com/'> </a></div>
<p><script src="http://www.effectgenerator.com/1.0.6/effect.php?id=2235&#038;replace=effect2235"
 type="text/javascript"></script>
</div>
<div style="float:right;">(<a href="http://youtube.com/watch?v=z6vDVPH7I50" onclick="javascript:urchinTracker ('/outbound/article/youtube.com');">original video here</a>)</div>
<h3 style="color:#cccccc;">Code Generator</h3>
<p>To get the code for your movie, find your movie on YouTube and copy and paste your URL here:<br />
<script>
// <!--
document.dosubmit = function(){
  var s = document.generator.url.value;
  var vidid = s.substring(s.indexOf("v=")+2,s.length);
  document.generator.fxml.value = "<Effect transparent=\"false\" height=\"250\" bgcolor=\"#000000\" width=\"330\">\n <Contrast smoothing=\"linear\" endValue=\"100.8\" event=\"Constantly\" startValue=\"36\" frames=\"25\" frames2=\"50\">\n  <Brightness smoothing=\"linear\" event=\"Random Drift\" endValue=\"28\" frames=\"50\" frames2=\"50\" startValue=\"74\">\n   <Drift movement=\"80\" amount=\"3\">\n    <FadedEdges edgewidth=\"20\" edgeheight=\"20\">\n     <Scale smoothing=\"linear\" endValue=\"4\" event=\"Constantly\" startValue=\"0.84\" frames=\"25\" frames2=\"50\">\n      <Stain smoothing=\"linear\" endValue=\"1\" color=\"#cc9933\" startValue=\"0.99\" event=\"Constantly\" frames2=\"50\" frames=\"25\">\n       <Transparency smoothing=\"linear\" event=\"On Display\" endValue=\"0.88\" frames2=\"50\" frames=\"50\" startValue=\"0\">\n        <Saturation smoothing=\"linear\" endValue=\"100\" event=\"Constantly\" startValue=\"-100\" frames=\"25\" frames2=\"50\">\n         <FilmGrain specs=\"25\" lines=\"20\">\n          <YouTubeVideo x=\"0\" videoId=\""+vidid+"\" title=\"YouTube Video\" y=\"0\"/>\n         </FilmGrain>\n        </Saturation>\n       </Transparency>\n      </Stain>\n     </Scale>\n    </FadedEdges>\n   </Drift>\n</Brightness>\n </Contrast>\n</Effect"+unescape("%3E");
  document.generator.submit();
}
// -->
</script></p>
<form name="generator" action="http://www.effectgenerator.com/1.0.6/publish.php" method="POST">
<input type="text" name="url" value="http://youtube.com/watch?v=z6vDVPH7I50" size="50"/>
<input type="hidden" name="fxml"/>
<input type="hidden" name="author" value="FlickTube"/>
<input type="hidden" name="email" value=""/>
<input type="hidden" name="title" value="FlickTube Effect"/>
<p>Video Width:<br />
<input type="text" name="width" value="330" size="4"/></p>
<p>Video Height:<br />
<input type="text" name="height" value="250" size="4"/></p>
<p>Background Color:<br />
<input type="text" name="bgcolor" value="000000" size="7"/></p>
<input type="hidden" name="transparency" value="0"/>
<input type="button" name="submitbutton" onclick="document.dosubmit();" value="Get Code"/>
</form>
<h3 style="color:#cccccc;">Creating Your Own Effects</h3>
<p>This old-style movie effect was created online using <a href="http://www.effectgenerator.com/" >The Effect Generator</a>. You can edit the effect directly, by right-clicking on it and selecting &#8216;Edit&#8217;. </p>
<p>In The Effect Generator, you can search for and add YouTube videos, photos, clipart and mp3s, then select from a wide range of transitions and effects to add to them. See <a href="http://effectgenerator.com/blog/?p=31" >here</a> for more <a href="http://effectgenerator.com/blog/?p=31" >examples</a>.
</div>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d32').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d32" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=32&amp;title=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=32&amp;title=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=FlicksTube%3A+Turning+YouTube+Old-Style&amp;url=http://effectgenerator.com/blog/?p=32&amp;title=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=32" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=32&amp;title=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=32&amp;title=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=32&amp;title=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=32&amp;title=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=32" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=32&amp;t=FlicksTube%3A+Turning+YouTube+Old-Style" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d32').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=32</wfw:commentRss>
		</item>
		<item>
		<title>Sequencing Embedded YouTube Videos</title>
		<link>http://effectgenerator.com/blog/?p=31</link>
		<comments>http://effectgenerator.com/blog/?p=31#comments</comments>
		<pubDate>Thu, 03 Apr 2008 20:54:08 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[EffectGenerator]]></category>

		<category><![CDATA[FXML]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[animation]]></category>

		<category><![CDATA[playlist]]></category>

		<category><![CDATA[sequence]]></category>

		<category><![CDATA[sequencing]]></category>

		<category><![CDATA[transition]]></category>

		<category><![CDATA[video]]></category>

		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=31</guid>
		<description><![CDATA[In this tutorial, I&#8217;ll show you how to make use of the new YouTube Chromeless player without any programming required, to create video content that fits in better with the style of your site, using video playlists, and even extra video effects like color cycling.
An Example
You&#8217;re probably used to the old blog standard YouTube embedded [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial, I&#8217;ll show you how to make use of the new <a href="http://code.google.com/apis/youtube/chromeless_player_reference.html" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">YouTube Chromeless player</a> <em>without any programming required</em>, to create video content that fits in better with the style of your site, using video playlists, and even extra video effects like color cycling.</p>
<h3>An Example</h3>
<p>You&#8217;re probably used to the old blog standard YouTube embedded player, that looks like this:</p>
<div style="text-align:center;">
<object width="320" height="240"><param name="movie" value="http://www.youtube.com/v/icoNDvRgZZg&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/icoNDvRgZZg&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="320" height="240"></embed></object></div>
<p>But now you can have content embedded and running more directly in your site. Here&#8217;s an example that autoplays and repeats two different YouTube videos in sequence:</p>
<div style="text-align:center;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" type="application/x-shockwave-flash" width="320" height="240" align="middle" data="http://www.effectgenerator.com/1.0.6/EffectMovie.swf"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.effectgenerator.com/1.0.6/EffectMovie.swf" /><param name="quality" value="high" /><param name="FlashVars" value="id=2200" /><param name="wmode" value="opaque" /><param name="bgcolor" value="#ffffff" /><embed src="http://www.effectgenerator.com/1.0.6/EffectMovie.swf" quality="high" bgcolor="#ffffff" width="320" height="240" align="middle" play="true" loop="false" quality="high" wmode="opaque" allowScriptAccess="always" FlashVars="id=2200" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object></div>
<p>Notice that the new Chromeless style doesn&#8217;t really have a defined border, so it feels much more like content that&#8217;s integrated with your page, rather than just an embedded widget.</p>
<p>Goo-Tube have recently released <a href="http://code.google.com/apis/youtube/chromeless_player_reference.html" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">Javascript and ActionScript 2.0 APIs</a> (rather poorly excluding ActionScript 3.0) for this player, but all these require programming skills to use. I&#8217;ll show you a <em>quick and easy way</em> to make use of the player without any programming and embed it in your site in no time. You can either use an <em>XML description</em> of your video playlist, or else use my graphical editor.</p>
<h3>XML-based Playlists</h3>
<p>Here&#8217;s the XML playlist for the example video sequence above:</p>
<pre>
&lt;Effect height="240" width="320" bgcolor="#ffffff"&gt;
 &lt;SlideShow autoAdvance="false" gap="0"&gt;
  &lt;YouTubeVideo videoId="FB2WUSvQStg"/&gt;
  &lt;YouTubeVideo videoId="fxu5CUPRU-U"/&gt;
 &lt;/SlideShow&gt;
&lt;/Effect&gt;
</pre>
<p>The root &#8216;Effect&#8217; tag lets you define the width and height of your videos, and also the background colour to display during loading. The &#8216;Slideshow&#8217; tag represents a container that displays each of it&#8217;s children in turn, then repeats. You can simply add or replace videos by adding or removing &#8216;YouTubeVideo&#8217; children elements.</p>
<p>Here the children are the two YouTube videos with ids &#8216;FB2WUSvQStg&#8217; and &#8216;FB2WUSvQStg&#8217;. The easiest way to find the YouTube id of the video you want is to look at the URL of the You Tube page for the video. The string of letters and numbers after &#8220;v=&#8221; in the URL is the id code. So for the URL:</p>
<p>http://www.youtube.com/watch?v=CCz1kmfqL7g </p>
<p>the id is &#8216;CCz1kmfqL7g&#8217;. Once you have the XML video playlist you want, simply surround with HTML code so that it looks like this:</p>
<pre>
&lt;!--Video PLAYER: http://www.effectgenerator.com/ --&gt;
&lt;script class=&quot;fxml&quot; type=&quot;text/xml&quot;&gt;

&lt;Effect height="240" width="320" bgcolor="#ffffff"&gt;
 &lt;SlideShow autoAdvance="false" gap="0"&gt;
  &lt;YouTubeVideo videoId="FB2WUSvQStg"/&gt;
  &lt;YouTubeVideo videoId="fxu5CUPRU-U"/&gt;
 &lt;/SlideShow&gt;
&lt;/Effect&gt;

&lt;/script&gt;&lt;script
src=&quot;http://www.effectgenerator.com/1.0.6/fxml.js&quot;
type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;!--    ____ END Video PLAYER ___ --&gt;
</pre>
<p>You can now put it directly in to your website. Since this uses JavaScript, it won&#8217;t work on sites like MySpace, but you copy the XML code into <a href="http://www.effectgenerator.com/" >The Effect Generator</a> (see below) to create Flash EMBED code for the video.</p>
<h3>Using the GUI</h3>
<p>You can also edit video sequences graphically inside my site <a href="http://www.effectgenerator.com/" >The Effect Generator</a>. Try right clicking on the video player above and selecting &#8216;edit&#8217;.</p>
<p>Start a new blank effect, and add the Slideshow component from the &#8216;Component Library&#8217; on the right of the screen. Click the slideshow component and set it&#8217;s configuration not to auto advance (otherwise you will only see the first <em>n</em> seconds of each movie!). Then go to the &#8216;Public Media&#8217; tab on the right and search for the YouTube videos you&#8217;d like to include. </p>
<p>Click &#8216;Publish&#8217; and you can instantly add your video playlist to social networks, blogs, or get the Flash code to embed it.</p>
<h3>Adding Lyrics and Other Effects</h3>
<p>The XML description is actually an example of <a href="http://www.effectgenerator.com/doc/fxml.php" >FXML</a> - The Effect Generator&#8217;s <a href="http://www.effectgenerator.com/doc/fxml.php" >internal language</a> for describing Flash effects. This means that you can actually do a whole lot more than just sequence video using The Effect Generator. For example, you can add transitions between videos, text or graphic slides between them, overlay graphics or text, and more.</p>
<p>Here&#8217;s an <a href="http://www.effectgenerator.com/1.0.5/showeffect.php?id=1498" >example</a> that uses the &#8216;Ticker&#8217; component to move text across any video, adding lyrics for music. It also scales and rotates the video and adds a colour cycle effect. Right click on it to remix it into your own!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d31').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d31" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=31&amp;title=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=31&amp;title=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Sequencing+Embedded+YouTube+Videos&amp;url=http://effectgenerator.com/blog/?p=31&amp;title=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=31" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=31&amp;title=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=31&amp;title=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=31&amp;title=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=31&amp;title=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=31" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=31&amp;t=Sequencing+Embedded+YouTube+Videos" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d31').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=31</wfw:commentRss>
		</item>
		<item>
		<title>Adding a Flash Ripple Effect to Images on Mouse Over</title>
		<link>http://effectgenerator.com/blog/?p=29</link>
		<comments>http://effectgenerator.com/blog/?p=29#comments</comments>
		<pubDate>Sat, 29 Mar 2008 00:55:14 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[EffectGenerator]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[effect]]></category>

		<category><![CDATA[generate]]></category>

		<category><![CDATA[generator]]></category>

		<category><![CDATA[image]]></category>

		<category><![CDATA[lake]]></category>

		<category><![CDATA[mouse]]></category>

		<category><![CDATA[ripple]]></category>

		<category><![CDATA[water]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=29</guid>
		<description><![CDATA[This week I&#8217;ve added a mouse ripple effect to The Effect Generator. This is a Flash adaptation of the classic Java applet animation. Try moving your mouse over the example below:

To create your own:
Load up The Effect Generator here
Select &#8216;Image&#8217; from the Component Library on the left-hand side
Enter your image URL, or click &#8216;Upload&#8217; to [...]]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;ve added a mouse ripple effect to <a href="http://www.effectgenerator.com/" >The Effect Generator</a>. This is a Flash adaptation of the classic Java applet animation. Try moving your mouse over the example below:</p>
<p style="horizontal-align:center;text-align:center;"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="EffectMovie" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" type="application/x-shockwave-flash" width="100" height="100" align="middle" data="http://www.effectgenerator.com/1.0.5/EffectMovie.swf"><param name="allowScriptAccess" value="always" /><param name="movie" value="http://www.effectgenerator.com/1.0.5/EffectMovie.swf" /><param name="quality" value="high" /><param name="FlashVars" VALUE="id=1811"><param name="wmode" value="opaque" /><param name="bgcolor" value="#ffffff" /><embed src="http://www.effectgenerator.com/1.0.5/EffectMovie.swf" quality="high" bgcolor="#ffffff" width="100" height="100" name="EffectMovie" align="middle" play="true" loop="false" quality="high" wmode="opaque" allowScriptAccess="always" FlashVars="id=1811" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object></p>
<p>To create your own:</p>
<li>Load up <a href="http://www.effectgenerator.com/" >The Effect Generator here</a></li>
<li>Select &#8216;Image&#8217; from the Component Library on the left-hand side</li>
<li>Enter your image URL, or click &#8216;Upload&#8217; to upload your image</li>
<li>Select the &#8216;Extras&#8217; tab on the left-hand side and click &#8216;Mouse Ripple&#8217;</li>
<li>Change the effect size by click on the root &#8216;Effect&#8217; node in the Component Tree (bottom) and adjusting it&#8217;s width and height</li>
<li>Press Publish to get HTML code or post to your blog or social network</li>
<p>Enjoy!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d29').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d29" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=29&amp;title=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=29&amp;title=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over&amp;url=http://effectgenerator.com/blog/?p=29&amp;title=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=29" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=29&amp;title=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=29&amp;title=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=29&amp;title=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=29&amp;title=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=29" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=29&amp;t=Adding+a+Flash+Ripple+Effect+to+Images+on+Mouse+Over" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d29').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=29</wfw:commentRss>
		</item>
		<item>
		<title>Add Reflection to Images in 6 Easy Steps, Online</title>
		<link>http://effectgenerator.com/blog/?p=11</link>
		<comments>http://effectgenerator.com/blog/?p=11#comments</comments>
		<pubDate>Sat, 08 Mar 2008 21:36:07 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[EffectGenerator]]></category>

		<category><![CDATA[Tutorials]]></category>

		<category><![CDATA[fade]]></category>

		<category><![CDATA[gif]]></category>

		<category><![CDATA[gradient]]></category>

		<category><![CDATA[image]]></category>

		<category><![CDATA[jpeg]]></category>

		<category><![CDATA[photoshop]]></category>

		<category><![CDATA[png]]></category>

		<category><![CDATA[reflection]]></category>

		<category><![CDATA[transparency]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=11</guid>
		<description><![CDATA[
In this tutorial, I&#8217;ll show you how to use the png and jpeg capture tool in The Effect Generator to add web-2.0-style reflection to any jpg, gif or png image in seconds.
The Six Steps
Step 1 Load The Effect Generator, choosing &#8216;Empty Effect&#8217; instead of a Flash template.
Step 2 Click &#8216;Image&#8217; from the component library on [...]]]></description>
			<content:encoded><![CDATA[<p style="horizontal-align:center;text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/test.jpg' alt='Arrow without reflection' style='vertical-align:top;'/><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/test_refl.jpg' alt='Arrow with reflection' style='vertical-align:top;' /></p>
<p>In this tutorial, I&#8217;ll show you how to use the <strong>png and jpeg capture</strong> tool in <a href="http://www.effectgenerator.com/" >The Effect Generator</a> to add web-2.0-style reflection to any jpg, gif or png image in <em>seconds</em>.</p>
<p><strong>The Six Steps</strong></p>
<p><strong>Step 1</strong> Load <a href="http://www.effectgenerator.com/" frame="_blank" >The Effect Generator</a>, choosing &#8216;Empty Effect&#8217; instead of a Flash template.</p>
<p><strong>Step 2</strong> Click &#8216;Image&#8217; from the component library on the left-hand side of the window.</p>
<p style="text-align:center;">
<img alt="Image Icon" src="http://effectgenerator.com/blog/wp-content/uploads/2008/03/image.jpg"/></p>
<p><strong>Step 3</strong> Click &#8216;Upload&#8217; from the configuration panel that appears at the bottom of the screen, and select your source jpeg, gif or png file.</p>
<p style="text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/upload.jpg' alt='Upload Image Selection' /></p>
<p><strong>Step 4</strong> Select the &#8216;Decoration&#8217; tab from underneath the component library on the left-hand side of the screen, and pick &#8216;Reflection&#8217;.</p>
<p style="text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/reflection.jpg' alt='Reflection Icon' /></p>
<p><strong>Step 5</strong> Change the background color, transparency, height and width of your effect by seleting the root &#8216;Effect&#8217; node from the Component Tree at the bottom middle of the screen.</p>
<p style="text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/settings.jpg' alt='Effect Settings' /></p>
<p><strong>Step 6</strong> Click the &#8216;Download Screenshot&#8217; camera icon at the top of the screen, third from left.</p>
<p style="text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/camera.jpg' alt='Camera Icon' /></p>
<p><strong>Configuring the Reflection</strong></p>
<p>You can configure the reflection effect into other forms than standard vertical type. To do this, click on the &#8216;Image&#8217; component in the component tree, and then click on the &#8216;Reflection&#8217; effect in the &#8216;Effects&#8217; box next door. This will bring up the reflection component settings:</p>
<p style="text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/settings2.jpg' alt='Reflection Settings' /></p>
<p>The &#8216;Amount&#8217; parameter specifies the height of the Reflection:</p>
<p style="horizontal-align:center;text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/test_refl.jpg' alt='Arrow with reflection' style='vertical-align:top;' /><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/large_reflection.jpg' alt='Amount Reflection' style='vertical-align:top;'/></p>
<p>The &#8216;Angle&#8217; parameter specifies the angle of the reflected image:</p>
<p style="horizontal-align:center;text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/large_reflection.jpg' alt='Amount Reflection' style='vertical-align:top;'/><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/angle_reflection.jpg' alt='Angle Reflection' style='vertical-align:top;'/><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/45deg.jpg' alt='45 Degrees' style='vertical-align:top;'/></p>
<p>Finally, the &#8216;Alpha&#8217; parameter controls the transparency of the reflection:</p>
<p style="horizontal-align:center;text-align:center;"><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/large_reflection.jpg' alt='Amount Reflection' style='vertical-align:top;'/><img src='http://effectgenerator.com/blog/wp-content/uploads/2008/03/alpha_reflection.jpg' alt='Alpha Reflection' style='vertical-align:top;'/></p>
<p><strong>Other Image Manipulations</strong></p>
<p>Reflection is only the first of a large number of image processing effects that you can use this tool for. Here are some others you might like to try:</p>
<ol>Rounding corners</ol>
<ol>Fading edges</ol>
<ol>Overlaying clipart</ol>
<ol>Setting brightness, saturation, hue, etc.</ol>
<ol>Adding glows</ol>
<ol>Adding shadows</ol>
<p>Plus, of course, you can use <a href="http://www.effectgenerator.com/" >The Effect Generator</a> to create great Flash effects <a href="http://www.effectgenerator.com/1.0.3/showeffect.php?id=656" >like this one</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d11').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d11" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=11&amp;title=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=11&amp;title=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online&amp;url=http://effectgenerator.com/blog/?p=11&amp;title=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=11" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=11&amp;title=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=11&amp;title=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=11&amp;title=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=11&amp;title=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=11" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=11&amp;t=Add+Reflection+to+Images+in+6+Easy+Steps%2C+Online" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d11').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
		<item>
		<title>Emulating Nested Classes in ActionScript</title>
		<link>http://effectgenerator.com/blog/?p=9</link>
		<comments>http://effectgenerator.com/blog/?p=9#comments</comments>
		<pubDate>Tue, 04 Mar 2008 01:43:30 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Air]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[class]]></category>

		<category><![CDATA[emulation]]></category>

		<category><![CDATA[inner]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[nested]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=9</guid>
		<description><![CDATA[Although nested classes are not supported by ActionScript 3.0, I&#8217;m going to describe a rather deviant means to achieve pretty much the same effect. The syntax doesn&#8217;t work out too great, but hopefully you might still get some use out of it!
What is a nested class?
A nested (or inner) class is a class inside a [...]]]></description>
			<content:encoded><![CDATA[<p>Although nested classes are <a href="http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&#038;file=03_Language_and_Syntax_160_05.html" onclick="javascript:urchinTracker ('/outbound/article/livedocs.adobe.com');">not supported by ActionScript 3.0</a>, I&#8217;m going to describe a rather deviant means to achieve pretty much the same effect. The syntax doesn&#8217;t work out too great, but hopefully you might still get some use out of it!</p>
<p><strong>What is a nested class?</strong></p>
<p>A <em>nested</em> (or inner) class is a <em>class inside a class</em>, which has access to the members of its parent, even if they are declared private. In Java, they are declared by literally nesting the class definitions:</p>
<pre>
class OuterClass {
    ...
    class NestedClass {
        ...
    }
}
</pre>
<p>Nested classes are useful because they allow a way of <em>logically grouping</em> classes that are only used in one place. For instance, if only a class is used by only a single other, then the class can be declared as a nested <em>(helper)</em> class, and furthermore, declared private. </p>
<p>Another use is the case where only one class needs to access the member variables of another. By nesting the class, the member variables can be kept private, increasing encapsulation.</p>
<p><strong>Closures as Objects</strong></p>
<p>Nested classes cannot be declared directly in ActionScript. However, as Ely Greenfield <a href="http://effectgenerator.com/blog/?p=8#comment-8" >pointed out to me</a> earlier, it turns out that closures for function calls in ActionScript are quite a lot like objects:</p>
<pre>
"...parameters, local variables, even member
references of ‘this’ are all accessible in the
closure, whenever it’s called, however often
it’s called, for as long as the closure exists."
</pre>
<p>As a result, it must be that the local variables of function definitions are quite a lot like the member variables of <em>classes</em>.</p>
<p><strong>What&#8217;s the Hack?</strong></p>
<p>So, we can define a nested class by defining a function (it&#8217;s constructor) with local variables and functions corresponding to the members of the class. By default, each of these is private, but we can selectively expose them by returning an appropriate object. </p>
<p><strong>An Example</strong></p>
<p>First the class as a top-level class:</p>
<pre>
class A {
   private var x;

   public function A(a){x = a;}

   public function inc(){x++;print();}
   private function print(){trace(x);}
}

var c = new A(4);
</pre>
<p>and now the class as a nested class:</p>
<pre>
public function new_A(a){  // constructor
  var x;                     // members

  x = a;

  function inc(){x++;print();}
  function print(){trace(x);}

  // public members
  return {inc:inc};
}

var c = new_A(4);
</pre>
<p>As you can see, the syntax actually ends up looking quite similar in both cases, the same encapsulation rules exist for both and the usage rules are the same. What&#8217;s more, the methods in the &#8216;nested class&#8217; can still access the member variables of its enclosing class, just like in Java. </p>
<p>Of course, this isnt going to work so well if you need to use more advanced techniques (like inheritance, type-checking&#8230;etc!). You might still find it useful.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d9').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d9" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=9&amp;title=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=9&amp;title=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Emulating+Nested+Classes+in+ActionScript&amp;url=http://effectgenerator.com/blog/?p=9&amp;title=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=9" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=9&amp;title=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=9&amp;title=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=9&amp;title=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=9&amp;title=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=9" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=9&amp;t=Emulating+Nested+Classes+in+ActionScript" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d9').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>A Hole in ActionScript, and a Way Around It</title>
		<link>http://effectgenerator.com/blog/?p=8</link>
		<comments>http://effectgenerator.com/blog/?p=8#comments</comments>
		<pubDate>Fri, 29 Feb 2008 01:03:08 +0000</pubDate>
		<dc:creator>Ed</dc:creator>
		
		<category><![CDATA[Actionscript]]></category>

		<category><![CDATA[Air]]></category>

		<category><![CDATA[Flash]]></category>

		<category><![CDATA[Flex]]></category>

		<category><![CDATA[anonymous]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[closure]]></category>

		<category><![CDATA[fix]]></category>

		<category><![CDATA[function]]></category>

		<category><![CDATA[reference]]></category>

		<guid isPermaLink="false">http://effectgenerator.com/blog/?p=8</guid>
		<description><![CDATA[In my previous post, I put forward several reasons why functional programmers might feel at home with Adobe&#8217;s rather terrific ActionScript 3.0 programming language that&#8217;s the basis of Flash, Flex and AIR. Today I&#8217;m going to describe one reason why they just might not want to. Some people will call this behaviour a stylistic feature. [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post, I put forward <a href="http://effectgenerator.com/blog/?p=6" >several reasons</a> why functional programmers might feel at home with Adobe&#8217;s rather terrific <a href="http://www.adobe.com/devnet/actionscript/" onclick="javascript:urchinTracker ('/outbound/article/www.adobe.com');">ActionScript 3.0</a> programming language that&#8217;s the basis of Flash, <a href="http://www.adobe.com/products/flex/" onclick="javascript:urchinTracker ('/outbound/article/www.adobe.com');">Flex</a> and <a href="http://www.adobe.com/products/air/" onclick="javascript:urchinTracker ('/outbound/article/www.adobe.com');">AIR</a>. Today I&#8217;m going to describe <em>one reason</em> why they just might not want to. Some people will call this behaviour a stylistic feature. Others will call it a semantic irregularity. Personally, I think it&#8217;s a <strong>bug</strong>, and suspect that those coming from functional programming will feel the same.</p>
<p><strong>What!? Closures take references?</strong></p>
<p>The problem concerns ActionScript&#8217;s behaviour when local variables are used in function definitions. Let&#8217;s take a look at an example:</p>
<pre>
// Create an empty array to hold our functions
var functions:Array = [];

// Add functions to array that print out x
for(var x:Number = 0;x<10;x++)
  functions.push( function(){ trace(x); } )

// Execute functions
for each(var f:Function in functions)
  f();
</pre>
<p>First we create an empty array (or list). Then we add 10 functions that print out <code>x</code> for a range from 0 to 9. Finally, we iterate through the array and execute each function. The result?</p>
<pre>
10 10 10 10 10 10 10 10 10 10
</pre>
<p>So what went wrong? Well. I feel that many programmers would expect the functions to display the value that <code>x</code> held during the <em>definition of the function</em>. However, in fact what was used was the value of <code>x</code> <em>during the execution of the function</em>.</p>
<p><strong>Style?&#8230;or Bug?</strong></p>
<p>On the face of it, whether <code>x</code> should be determined at function definition or function execution <em>sounds</em> like it might be a language design choice. Maybe this is just the way they chose it to be? </p>
<p>But dig a little deeper and you realise that things seem a bit wrong. For starters, in our example, is the variable <code>x</code> even <em>defined</em> at the time of function execution? Is it right that a fuction&#8217;s local variables should still be accessible after the function has completed execution?</p>
<p><strong>Ways Around It</strong></p>
<p>For anonymous classes in Java, the same problem is dealt with by enforcing variables to be declared <code>final</code> (unassignable) before they can be used within a delayed piece of code. I think it&#8217;s a shame that the ActionScript compiler doesn&#8217;t require a similar convention.</p>
<p>Still, I have found a stylistic way to hack around the problem, and I suggest that all ActionScript users do the same. The method involves allocating a fresh persistent reference on the stack for any local variables that you would like to use inside a function definition. You can do this by wrapping your function in <em>yet another</em> anonymous function. Here&#8217;s the modification in place for the code above:</p>
<pre>
// Add functions to array that print out x
for(var x:Number = 0;x<10;x++)
    functions.push( (function(x){
      return function(){ trace(x); }
     })(x) )
</pre>
<p>And now, success!</p>
<pre>
0 1 2 3 4 5 6 7 8 9
</pre>
<p>It works because the outer <code>x</code> is evaluated at the same time as the function definition. As a rather interesting aside, it demonstrates that</p>
<p><code>E</code> &nbsp;&nbsp; is not &nbsp;&nbsp;<code>(function(x){return E})(x)</code></p>
<p>Surely not the best of features? Or am I molded by the over-use of functional programming?</p>
<p><strong>The Pass-by-Reference Hack</strong></p>
<p>Things get much stranger than that. It turns out that not only can you read variables that have seemingly ceased to exist, but you can also <em>write</em> to them. This can lead to some usages that seem really odd coming from a Java background. For example, here&#8217;s an example I created of emulated integer pass-by-reference call:</p>
<pre>
// Receives reference to x, and doubles x
function twice(xRef){
  xRef(xRef()*2);
}

function test() {
  var x = 1;

  // Create reference to x
  var xRef = function(value=null){
    if(value!=null)
      x=value;
    return x;
  };

  // Call-by-reference
  twice(xRef);
  twice(xRef);

  trace(x);
  // result is 4
}
</pre>
<p>Sweet. Did I really call ActionScript <em>terrific</em> at the start of the article? Actually, I still think it rather kicks arse, just needs a little tweak. Afterall, I just made <a href="http://effectgenerator.com/" >this</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d8').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d8" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://effectgenerator.com/blog/?p=8&amp;title=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://effectgenerator.com/blog/?p=8&amp;title=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;digg"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=A+Hole+in+ActionScript%2C+and+a+Way+Around+It&amp;url=http://effectgenerator.com/blog/?p=8&amp;title=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;DZone"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://effectgenerator.com/blog/?p=8" title="Add to&nbsp;Facebook"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://effectgenerator.com/blog/?p=8&amp;title=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://effectgenerator.com/blog/?p=8&amp;title=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;reddit"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http://effectgenerator.com/blog/?p=8&amp;title=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://effectgenerator.com/blog/?p=8&amp;title=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://effectgenerator.com/blog/?p=8" title="Add to&nbsp;Technorati"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://effectgenerator.com/blog/?p=8&amp;t=A+Hole+in+ActionScript%2C+and+a+Way+Around+It" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://effectgenerator.com/blog/wp-content/plugins/social_bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d8').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://effectgenerator.com/blog/?feed=rss2&amp;p=8</wfw:commentRss>
		</item>
	</channel>
</rss>
