<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>.swfgeek &#187; TUTORIALS</title>
	<atom:link href="http://www.swfgeek.net/tag/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.swfgeek.net</link>
	<description>My Flash Wanderings</description>
	<lastBuildDate>Thu, 19 Jan 2012 23:07:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.5/mx/</creativeCommons:license>
		<item>
		<title>Flash Player 10.2 Beta (Native bitmap-based cursors)</title>
		<link>http://www.swfgeek.net/2010/12/02/flash-player-10-2-beta-native-bitmap-based-cursors/</link>
		<comments>http://www.swfgeek.net/2010/12/02/flash-player-10-2-beta-native-bitmap-based-cursors/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 23:08:49 +0000</pubDate>
		<dc:creator>swfgeek</dc:creator>
				<category><![CDATA[ACTIONSCRIPT 3.0]]></category>
		<category><![CDATA[EXAMPLES]]></category>
		<category><![CDATA[EXPERIMENTS]]></category>
		<category><![CDATA[FEATURED]]></category>
		<category><![CDATA[GENERAL]]></category>
		<category><![CDATA[TUTORIALS]]></category>
		<category><![CDATA[ADOBE]]></category>
		<category><![CDATA[flash player 10.2]]></category>

		<guid isPermaLink="false">http://www.swfgeek.net/?p=1358</guid>
		<description><![CDATA[
			
				
			
		
One of the new features of the Adobe Flash Player 10.2 is the Native bitmap-based cursors this will let You get rid of the Mouse.hide(), onMouseMove() handler  or starDrag() to display a custom cursor in your Flash projects. You can now directly assign your own custom cursors. So here&#8217;s a ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.swfgeek.net%2F2010%2F12%2F02%2Fflash-player-10-2-beta-native-bitmap-based-cursors%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.swfgeek.net%2F2010%2F12%2F02%2Fflash-player-10-2-beta-native-bitmap-based-cursors%2F&amp;source=swfgeek&amp;style=normal&amp;service=bit.ly&amp;service_api=R_3d65be79f0c5331925d1c67940cbc8ef&amp;hashtags=ADOBE,EXAMPLES,flash+player+10.2,TUTORIALS&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>One of the new features of the Adobe Flash Player 10.2 is the <strong>Native bitmap-based cursors</strong> this will let You get rid of the Mouse.hide(), onMouseMove() handler  or starDrag() to display a custom cursor in your Flash projects. You can now directly assign your own custom cursors. So here&#8217;s a sample extending <a title="Introducing Flash Player 10.2 Beta! by Thibault Imbert" href="http://www.bytearray.org/?p=2373" target="_blank">Thibault Imbert&#8217;s</a></p>
<p><strong>1.-</strong> First we embed the assets( the images that we will be using as our custom cursors) and  an int var that we will be using to switch our cursors.</p>
<pre class="brush:as3">[Embed (source="/assets/126.gif" )]
public static const NativeCursor:Class;
[Embed (source="/assets/cat1.png" )]
public static const CursorFrame1:Class;
[Embed (source="/assets/cat2.png" )]
public static const CursorFrame2:Class;
[Embed (source="/assets/cat3.png" )]
public static const CursorFrame3:Class;
[Embed (source="/assets/cat4.png" )]
public static const CursorFrame4:Class;
[Embed (source="/assets/cat5.png" )]
public static const CursorFrame5:Class
protected var _state : int = 0;</pre>
<p><strong>2.-</strong> Then on the class constructor we add the click mouse event listener so on each user click we toggle the cursor.</p>
<pre class="brush:applescript">public function NativeCursorTest() {
  stage.addEventListener(MouseEvent.CLICK, _onClick);
  toggle();
}</pre>
<p><strong>3.-</strong> The methods that create our cursors this is exactly the same code that <a title="Introducing Flash Player 10.2 Beta! by Thibault Imbert" href="http://www.bytearray.org/?p=2373" target="_blank">Thibault&#8217;s sample </a>just divided in two methods so You can see the animated and static cursor working.</p>
<pre class="brush:applescript">private function createNativeCursor() : void {
   // we create a MouseCursorData object
   var cursorData:MouseCursorData = new MouseCursorData();
   // we specify the hotspot
   cursorData.hotSpot = new Point(15,15);
   // we pass the cursor bitmap to a BitmapData Vector
   var bitmapDatas:Vector.&lt;BitmapData&gt; = new Vector.&lt;BitmapData&gt;(1, true);
   // we create the bitmap cursor (bitmaps should not be bigger than 32x32 pixels, this is an OS limitation)
   var bitmap:Bitmap = new NativeCursor();
   // we pass it to the bitmapDatas vector
   bitmapDatas[0] = bitmap.bitmapData;
   // we assign the bitmap to the MouseCursor object
   cursorData.data = bitmapDatas;
   // we register the MouseCursorData to the Mouse with an alias
   Mouse.registerCursor("myCursor", cursorData);
   // whenever we neeed to show it, we pass the alias to the existing cursor property
   Mouse.cursor = "myCursor";
}

private function createAnimatedCursor() : void	{
   // we create a MouseCursorData object
   var cursorData:MouseCursorData = new MouseCursorData();
   // we specify the hotspot
   cursorData.hotSpot = new Point(15,15);
   // we pass the cursors bitmap to a BitmapData Vector
   var bitmapDatas:Vector.&lt;BitmapData&gt; = new Vector.&lt;BitmapData&gt;(5, true);
   // we create the bitmap cursor frames (bitmaps should not be bigger than 32x32 pixels, this is an OS limitation)
   var frame1Bitmap:Bitmap = new CursorFrame1();
   var frame2Bitmap:Bitmap = new CursorFrame2();
   var frame3Bitmap:Bitmap = new CursorFrame3();
   var frame4Bitmap:Bitmap = new CursorFrame4();
   var frame5Bitmap:Bitmap = new CursorFrame5();
  // we pass it to the bitmapDatas vector
   bitmapDatas[0] = frame1Bitmap.bitmapData;
   bitmapDatas[1] = frame2Bitmap.bitmapData;
   bitmapDatas[2] = frame3Bitmap.bitmapData;
   bitmapDatas[3] = frame4Bitmap.bitmapData;
   bitmapDatas[4] = frame5Bitmap.bitmapData;
   // we assign the bitmap to the MouseCursor object
   cursorData.data = bitmapDatas;
   // we register the MouseCursorData to the Mouse
   Mouse.registerCursor("myAnimatedCursor", cursorData);
   // we just pass a frame rate
   cursorData.frameRate = 5;
   // whenever we neeed to show it, we pass the alias to the existing cursor property
   Mouse.cursor = "myAnimatedCursor";
}</pre>
<p><strong>4.- </strong>And finally our Mouse event listener and the toggle method that makes all that cursor magic switch happens.</p>
<pre class="brush:as3">private function _onClick(event : MouseEvent) : void {
	// we call the toggle function to switch between our mouse cursors
	toggle();
}

private function toggle() : void {
	switch (_state) {
	   case 0:
		// we set the static cursor
		createNativeCursor();
		_state = 1;
		break;
	   case 1:
		// we set the animated cursor
		createAnimatedCursor();
		trace(_state);
		_state = 0;
		break;
		default:
	}
}</pre>
<p>Hope this helps You and in case you haven&#8217;t already go to adobe labs and download<a title="Adobe Flash Player 10 at labs" href="http://labs.adobe.com/technologies/flashplayer10/" target="_blank"> the Flash Player 10.2 beta</a>.</p>
<p>Almost forgot <a class="fancybox iframe" href="http://examples.swfgeek.net/flash/nativecursor/NativeCursorTest.html"> here&#8217;s the example: </a> ( You&#8217;ll need Flash Player 10.2 in your browser to see it).</p>
<!-- AdSense Now! V1.98 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="float:left;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "ca-pub-9092206590322028";
/* EndPostLinkUnitAd */
google_ad_slot = "6427337093";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>]]></content:encoded>
			<wfw:commentRss>http://www.swfgeek.net/2010/12/02/flash-player-10-2-beta-native-bitmap-based-cursors/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.5/mx/</creativeCommons:license>
	</item>
		<item>
		<title>Using Flex PMD in FlashDevelop 3</title>
		<link>http://www.swfgeek.net/2009/09/18/using-flex-pmd-in-flashdevelop-3/</link>
		<comments>http://www.swfgeek.net/2009/09/18/using-flex-pmd-in-flashdevelop-3/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:33:05 +0000</pubDate>
		<dc:creator>swfgeek</dc:creator>
				<category><![CDATA[EXAMPLES]]></category>
		<category><![CDATA[FEATURED]]></category>
		<category><![CDATA[TUTORIALS]]></category>
		<category><![CDATA[FLASHDEVELOP]]></category>
		<category><![CDATA[FlexPMD]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.swfgeek.net/?p=654</guid>
		<description><![CDATA[
			
				
			
		

Adobe recently made available Flex PMD a tool that lets you keep track of your code bad practices and helps you  by auditing your source directory and displaying  common errors such as:

Unused code (functions, variables, constants, etc.)
Inefficient code (misuse of dynamic filters, heavy constructors, etc.)
Over-complex code (nested loops, too many ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.swfgeek.net%2F2009%2F09%2F18%2Fusing-flex-pmd-in-flashdevelop-3%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.swfgeek.net%2F2009%2F09%2F18%2Fusing-flex-pmd-in-flashdevelop-3%2F&amp;source=swfgeek&amp;style=normal&amp;service=bit.ly&amp;service_api=R_3d65be79f0c5331925d1c67940cbc8ef&amp;hashtags=EXAMPLES,FLASHDEVELOP,FlexPMD,plugins,TUTORIALS&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="alignnone size-full wp-image-656" title="FlashDevelop 3" src="http://www.swfgeek.net/blog/wp-content/uploads/2009/09/flexdevelop.png" alt="FlashDevelop 3" width="105" height="105" /></p>
<p>Adobe recently made available <a title="Adobe OpenSource FlexPMD" href="http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD" target="_blank">Flex PMD</a> a tool that lets you keep track of your code bad practices and helps you  by auditing your source directory and displaying  common errors such as:</p>
<ul>
<li>Unused code (functions, variables, constants, etc.)</li>
<li>Inefficient code (misuse of dynamic filters, heavy constructors, etc.)</li>
<li>Over-complex code (nested loops, too many conditionals, etc.)</li>
<li>Over-long code (classes, methods, etc.)</li>
<li>Incorrect use of the Flex component lifecycle (commitProperties, etc).</li>
</ul>
<p>A report is produced describing the violations of a given rule set. FlexPMD includes a rule set that is broad ranging and continually growing. It is also straightforward to create your own new rules.</p>
<p>Originally Flex PMD can be called from: Ant, The Command Line and Maven, but thanks to the <a title="FRlashDevelop" href="http://www.flashdevelop.org/" target="_blank">FlashDevelop</a> (FD3 from now on ) community a plugin has been made available that lets you use FlexPMD in the FD3 IDE and throws the result right in the Output and Results window of FD3.</p>
<p><img class="alignnone size-full wp-image-671" title="flexpmdinfd3" src="http://www.swfgeek.net/blog/wp-content/uploads/2009/09/flexpmdinfd3.jpg" alt="flexpmdinfd3" width="579" height="456" /></p>
<p><span style="font-weight: bold;">Installation</span></p>
<p><span style="font-weight: bold;">1.</span> Download flashdevelopPMD from <a href="http://www.kemelyon.com/flashdevelop/flashdevelopPMD.zip">http://www.kemelyon.com/flashdevelop/flashdevelopPMD.zip</a></p>
<p><span style="font-weight: bold;">2. </span>Copy PMD.dll into the plugins folder of your FD Application Files.</p>
<p><img class="alignnone size-full wp-image-680" title="fdsettings" src="http://www.swfgeek.net/blog/wp-content/uploads/2009/09/fdsettings.jpg" alt="fdsettings" width="399" height="277" /></p>
<p><img class="alignnone size-full wp-image-681" title="fdplugins" src="http://www.swfgeek.net/blog/wp-content/uploads/2009/09/fdplugins.jpg" alt="fdplugins" width="460" height="281" /></p>
<p><span style="font-weight: bold;">3. </span>Download flexPMD from Adobe Labs (<!-- m --><a href="http://opensource.adobe.com/wiki/display/flexpmd/Downloads">http://opensource.adobe.com/wiki/displa &#8230; /Downloads</a><!-- m -->) and extract to your disk.</p>
<p><img class="alignnone size-full wp-image-679" title="adobeos" src="http://www.swfgeek.net/blog/wp-content/uploads/2009/09/adobeos.jpg" alt="adobeos" width="376" height="97" /></p>
<p>Set &#8220;PMD jar Location&#8221; in Tools -&gt; Settings -&gt; FlexPMD to your &#8220;flex-pmd-command-line-1.0.RC3.jar&#8221;</p>
<p><img class="alignnone size-full wp-image-682" title="flexpmdlocation" src="http://www.swfgeek.net/blog/wp-content/uploads/2009/09/flexpmdlocation.jpg" alt="flexpmdlocation" width="600" height="384" /></p>
<p><span style="font-weight: bold;">Usage</span></p>
<p>Press Ctrl-Shift-A to run FlexPMD in current Project. <span style="font-style: italic;">This version only checks code inside the &#8220;src&#8221; folder</span>, so you don&#8217;t see warnings in your libraries.</p>
<p>To use your own ruleset, set &#8220;PMD Ruleset&#8221; in Tools -&gt; Settings -&gt; FlexPMD</p>
<p>Thanks again to the FlashDevelop community for spending time in making this useful plugins.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.swfgeek.net/2009/09/18/using-flex-pmd-in-flashdevelop-3/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.5/mx/</creativeCommons:license>
	</item>
		<item>
		<title>Drawing API and Mouse Events</title>
		<link>http://www.swfgeek.net/2008/02/25/drawing-api-and-mouse-events/</link>
		<comments>http://www.swfgeek.net/2008/02/25/drawing-api-and-mouse-events/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 16:33:44 +0000</pubDate>
		<dc:creator>swfgeek</dc:creator>
				<category><![CDATA[ACTIONSCRIPT 3.0]]></category>
		<category><![CDATA[EXAMPLES]]></category>
		<category><![CDATA[TUTORIALS]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[Drawing API]]></category>
		<category><![CDATA[Flex 3]]></category>
		<category><![CDATA[FLEX IDE]]></category>
		<category><![CDATA[MouseEvents]]></category>

		<guid isPermaLink="false">http://www.swfgeek.net/?p=117</guid>
		<description><![CDATA[
			
				
			
		

Click on the image to see the example and get the code.
A pair of days ago I found the blog of Sorin Haidan in wish he post some very useful tutorials on Flash and Actionscript 3.0 in a very understandable way, I found one that caught my attention called Draw ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.swfgeek.net%2F2008%2F02%2F25%2Fdrawing-api-and-mouse-events%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.swfgeek.net%2F2008%2F02%2F25%2Fdrawing-api-and-mouse-events%2F&amp;source=swfgeek&amp;style=normal&amp;service=bit.ly&amp;service_api=R_3d65be79f0c5331925d1c67940cbc8ef&amp;hashtags=ACTIONSCRIPT+3.0,Classes,Drawing+API,Flex+3,FLEX+IDE,MouseEvents,TUTORIALS&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://examples.swfgeek.net/flash/drawingapimouse"><img src="http://www.swfgeek.net/blog/wp-content/uploads/2008/02/drawingapi_img.jpg" alt="DrawingAPI" /></a><br />
<strong>Click on the image to see the example and get the code.</strong></p>
<p>A pair of days ago I found the <a href="http://biochimistu.blogspot.com/">blog</a> of <a href="http://www.blogger.com/profile/09135002905210428963">Sorin Haidan </a>in wish he post some very useful tutorials on Flash and Actionscript 3.0 in a very understandable way, I found one that caught my attention called <a href="http://biochimistu.blogspot.com/2008/02/draw-custom-shapes-with-actionscript-30.html">Draw Custom shapes with ActionScript 3.0.</a> In this tutorial he explains how to make a &#8220;Ball&#8221; appear on screen every time you click and move your mouse on the screen by using the Drawing API  and MouseEvents, the change of the color on the ball was achieved doing a loop in a 10 frame movie clip  with a ball of different gradient fill on each frame, so occurred to me to wrap that code on a class on a <a href="http://www.adobe.com/products/flex/">Flex 3</a> Actionscript Project  and get rid of the <a href="http://www.adobe.com/products/flash/">Flash</a> assets by drawing the ball  in a dynamic way and this let me Change the color of the Ball more than the 10 times of Sorin example, so check the example be sure to check <a href="http://biochimistu.blogspot.com/">Sorin&#8217;s blog </a>.<br />
In <a href="http://examples.swfgeek.net/flash/drawingapimouse">my example</a> if you right click on the file you get to see the source that it&#8217;s also included below this text here&#8217;s what I got: <a href="http://examples.swfgeek.net/flash/drawingapimouse">Drawing API Ball Example.</a></p>
<p>Thanks Sorin for letting me mess around with his code keep up with those good tutorials.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p117code2'); return false;">View Code</a> ACTIONSCRIPT3</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1172"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
</pre></td><td class="code" id="p117code2"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #3f5fbf;">/*
/////---- Class by Dave Ga?mez (.swfgeek) 24-February-2008 http://www.swfgeek.net----\\\
///---- Original Example by: Sorin Haidan in his  Draw Custom shapes with ActionScript 3.0. Tutorial ----\
///---- Found on his blog http://biochimistu.blogspot.com/ ---- \
*/</span>
&nbsp;
<span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=gradienttype%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:gradienttype.html"><span style="color: #004993;">GradientType</span></a><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=spreadmethod%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:spreadmethod.html"><span style="color: #004993;">SpreadMethod</span></a><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.geom</span><span style="color: #000066; font-weight: bold;">.</span><a href="http://www.google.com/search?q=matrix%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:matrix.html"><span style="color: #004993;">Matrix</span></a><span style="color: #000066; font-weight: bold;">;</span>
    <span style="color: #0033ff; font-weight: bold;">import</span> com<span style="color: #000066; font-weight: bold;">.</span>adobe<span style="color: #000066; font-weight: bold;">.</span>viewsource<span style="color: #000066; font-weight: bold;">.</span>ViewSource<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
    <span style="color: #000000;">&#91;</span>SWF<span style="color: #000000;">&#40;</span><span style="color: #004993;">backgroundColor</span>=<span style="color: #990000;">&quot;0x000000&quot;</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #004993;">frameRate</span>=<span style="color: #990000;">&quot;31&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
&nbsp;
    <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> DrawingAPI <span style="color: #0033ff; font-weight: bold;">extends</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> sprite<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> holder<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> myCircle<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> fillType<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">colors</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">alphas</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">ratios</span><span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=array%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:array.html"><span style="color: #004993;">Array</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> matr<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=matrix%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:matrix.html"><span style="color: #004993;">Matrix</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> spreadMethod<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=string%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:string.html"><span style="color: #004993;">String</span></a><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> focalPointRatio<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=number%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:number.html"><span style="color: #004993;">Number</span></a><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> DrawingAPI<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #004993;">init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
        <span style="color: #000000;">&#123;</span>
            ViewSource<span style="color: #000066; font-weight: bold;">.</span>addMenuItem<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #990000;">&quot;srcview/index.html&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleMode</span> = <a href="http://www.google.com/search?q=stagescalemode%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagescalemode.html"><span style="color: #004993;">StageScaleMode</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">NO_SCALE</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">align</span> = <a href="http://www.google.com/search?q=stagealign%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:stagealign.html"><span style="color: #004993;">StageAlign</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TOP_LEFT</span><span style="color: #000066; font-weight: bold;">;</span>
            <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_DOWN</span><span style="color: #000066; font-weight: bold;">,</span>prepareToDraw<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> prepareToDraw<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
         <span style="color: #000000;">&#123;</span>
          <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_MOVE</span><span style="color: #000066; font-weight: bold;">,</span>drawGraphics<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
          <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_UP</span><span style="color: #000066; font-weight: bold;">,</span>stopDrawing<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
         <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> drawGraphics<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
        <span style="color: #000000;">&#123;</span>
         fillType = <a href="http://www.google.com/search?q=gradienttype%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:gradienttype.html"><span style="color: #004993;">GradientType</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">RADIAL</span><span style="color: #000066; font-weight: bold;">;</span>
         <span style="color: #004993;">colors</span> = <span style="color: #000000;">&#91;</span>0xFFFFFF<span style="color: #000066; font-weight: bold;">,</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>0xFFFFFF<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
         <span style="color: #004993;">alphas</span> = <span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
         <span style="color: #004993;">ratios</span> = <span style="color: #000000;">&#91;</span>0x37<span style="color: #000066; font-weight: bold;">,</span> 0xFF<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
         matr= <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=matrix%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:matrix.html"><span style="color: #004993;">Matrix</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         matr<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">createGradientBox</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">100</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000066; font-weight: bold;">,</span> <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">360</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000066; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">40</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         spreadMethod = <a href="http://www.google.com/search?q=spreadmethod%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:spreadmethod.html"><span style="color: #004993;">SpreadMethod</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PAD</span><span style="color: #000066; font-weight: bold;">;</span>
         focalPointRatio = <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
         holder = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         <span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>holder<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         myCircle = <span style="color: #0033ff; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=sprite%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:sprite.html"><span style="color: #004993;">Sprite</span></a><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         myCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">beginGradientFill</span><span style="color: #000000;">&#40;</span>fillType<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">colors</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">alphas</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">ratios</span><span style="color: #000066; font-weight: bold;">,</span> matr<span style="color: #000066; font-weight: bold;">,</span>spreadMethod<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         myCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">drawCircle</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">40</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         myCircle<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">graphics</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">endFill</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         holder<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>myCircle<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
         holder<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #004993;">mouseX</span><span style="color: #000066; font-weight: bold;">;</span>
         holder<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #004993;">mouseY</span><span style="color: #000066; font-weight: bold;">;</span>
         holder<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleX</span> = holder<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">scaleY</span> = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">0.5</span><span style="color: #000066; font-weight: bold;">;</span>
         holder<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span> = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">360</span><span style="color: #000066; font-weight: bold;">;</span>
         holder<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">alpha</span> = <a href="http://www.google.com/search?q=math%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:math.html"><span style="color: #004993;">Math</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">0.7</span><span style="color: #000066; font-weight: bold;">;</span>
       <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> stopDrawing<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
       <span style="color: #000000;">&#123;</span>
        <span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><a href="http://www.google.com/search?q=mouseevent%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:mouseevent.html"><span style="color: #004993;">MouseEvent</span></a><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MOUSE_MOVE</span><span style="color: #000066; font-weight: bold;">,</span>drawGraphics<span style="color: #000000;">&#41;</span>
       <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.swfgeek.net/2008/02/25/drawing-api-and-mouse-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.5/mx/</creativeCommons:license>
	</item>
		<item>
		<title>Kelvin Luck’s Flasher</title>
		<link>http://www.swfgeek.net/2007/04/01/kelvin-lucks-flasher/</link>
		<comments>http://www.swfgeek.net/2007/04/01/kelvin-lucks-flasher/#comments</comments>
		<pubDate>Sun, 01 Apr 2007 06:22:12 +0000</pubDate>
		<dc:creator>swfgeek</dc:creator>
				<category><![CDATA[ACTIONSCRIPT 3.0]]></category>
		<category><![CDATA[EXAMPLES]]></category>
		<category><![CDATA[FRAMEWORKS]]></category>
		<category><![CDATA[TUTORIALS]]></category>
		<category><![CDATA[adobe flash platform]]></category>
		<category><![CDATA[libraries]]></category>

		<guid isPermaLink="false">http://www.swfgeek.net/?p=19</guid>
		<description><![CDATA[
			
				
			
		

Yesterday my wife asked me if I could somehow display her flickr archives on her personal website. And to be quite frank I had  been playing with the flickr API but never gave me the time to make something real out of it, so I started googling around and ...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.swfgeek.net%2F2007%2F04%2F01%2Fkelvin-lucks-flasher%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.swfgeek.net%2F2007%2F04%2F01%2Fkelvin-lucks-flasher%2F&amp;source=swfgeek&amp;style=normal&amp;service=bit.ly&amp;service_api=R_3d65be79f0c5331925d1c67940cbc8ef&amp;hashtags=adobe+flash+platform,EXAMPLES,libraries,TUTORIALS&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://examples.swfgeek.net/flash/flashrtest"><img id="image18" src="http://www.swfgeek.net/blog/wp-content/uploads/2007/03/flashrtest.jpg" alt="flashrTest" /></a></p>
<p>Yesterday my wife asked me if I could somehow display <strong><a href="http://www.flickr.com/photos/cecymeade">her flickr</a></strong> archives on her<a href="http://www.cecymeade.com"><strong> personal website</strong></a>. And to be quite frank I had  been playing with the flickr API but never gave me the time to make something real out of it, so I started googling around and found out this great Actionscript 2.0 wrapper called <a href="http://flashr.kelvinluck.com/"><strong>Flashr</strong></a> by <a href="http://www.kelvinluck.com/"><strong>Kelvin Luck</strong></a> that makes it easy to develop Flash applications to display and interact with photos on <a href="http://www.flickr.com"><strong>flickr.com</strong></a>.</p>
<p>So this is a very simple example (based on an tutorial of the version 0.4 of Flashr and I updated it to work with the current version (0.5)) of what can be done with Flashr but I plan to add more functionality and eyecandy to it (I&#8217;ll upload the result of that).</p>
<p>I almost forgot here&#8217;s the script that make this work:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p19code4'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p194"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
</pre></td><td class="code" id="p19code4"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">kelvinluck</span>.<span style="color: #006600;">flashr</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">Flashr</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">kelvinluck</span>.<span style="color: #006600;">flashr</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">Photo</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">kelvinluck</span>.<span style="color: #006600;">flashr</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">Photoset</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">kelvinluck</span>.<span style="color: #006600;">flashr</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">Person</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">kelvinluck</span>.<span style="color: #006600;">flashr</span>.<span style="color: #006600;">core</span>.<span style="color: #006600;">FlashrResponse</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">kelvinluck</span>.<span style="color: #006600;">util</span>.<span style="color: #006600;">LogWrapper</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">dynamicflash</span>.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Delegate</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> com.<span style="color: #006600;">cecymeade</span>.<span style="color: #006600;">UserRecentPhotos</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> xMax:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">214</span>;
<span style="color: #000000; font-weight: bold;">var</span> yMax:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">214</span>;
<span style="color: #000000; font-weight: bold;">var</span> xTemp:<span style="color: #0066CC;">Number</span>;
<span style="color: #000000; font-weight: bold;">var</span> yTemp:<span style="color: #0066CC;">Number</span>;
<span style="color: #000000; font-weight: bold;">var</span> apiKey:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;Your Flickr API key here&quot;</span>;
<span style="color: #000000; font-weight: bold;">var</span> userNsid:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">&quot;90349680@N00&quot;</span>;
<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">_target</span>:<span style="color: #0066CC;">MovieClip</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> UserRecentPhotos<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">target</span>:<span style="color: #0066CC;">MovieClip</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">Stage</span>.<span style="color: #0066CC;">scaleMode</span> = <span style="color: #ff0000;">&quot;noScale&quot;</span>;
LogWrapper.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">init</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
LogWrapper.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">addTracePublisher</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">_target</span> = <span style="color: #0066CC;">target</span>;
<span style="color: #000000; font-weight: bold;">var</span> _flashr:Flashr = Flashr.<span style="color: #006600;">getFlashr</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_flashr.<span style="color: #006600;">apiKey</span> = apiKey;
<span style="color: #000000; font-weight: bold;">var</span> _flashrResponse:FlashrResponse = <span style="color: #000000; font-weight: bold;">new</span> FlashrResponse<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
_flashrResponse.<span style="color: #006600;">setSuppressOutput</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>;
_flashrResponse.<span style="color: #006600;">onPeopleGetPublicPhotos</span> = Delegate.<span style="color: #006600;">create</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, onPeopleGetPublicPhotos<span style="color: #66cc66;">&#41;</span>;
_flashr.<span style="color: #006600;">peopleGetPublicPhotos</span><span style="color: #66cc66;">&#40;</span>userNsid, <span style="color: #000000; font-weight: bold;">null</span>, <span style="color: #cc66cc;">16</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> onPeopleGetPublicPhotos<span style="color: #66cc66;">&#40;</span>p:Person<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> photosArray:<span style="color: #0066CC;">Array</span> = p.<span style="color: #006600;">getPhotos</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> userNsid:<span style="color: #0066CC;">String</span> = p.<span style="color: #006600;">nsid</span>;
<span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i:<span style="color: #0066CC;">Number</span> = <span style="color: #cc66cc;">0</span>; i
<span style="color: #000000; font-weight: bold;">var</span> thisPhoto:Photo = Photo<span style="color: #66cc66;">&#40;</span>photosArray<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">var</span> mc:<span style="color: #0066CC;">MovieClip</span> = <span style="color: #0066CC;">_target</span>.<span style="color: #0066CC;">createEmptyMovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;photo&quot;</span>+i, i<span style="color: #66cc66;">&#41;</span>;
mc.<span style="color: #0066CC;">_x</span> = <span style="color: #cc66cc;">1</span>+<span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">%</span>4<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">76</span>;
mc.<span style="color: #0066CC;">_y</span> = <span style="color: #cc66cc;">1</span>+<span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">floor</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">/</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">*</span><span style="color: #cc66cc;">76</span>;
mc.<span style="color: #0066CC;">createEmptyMovieClip</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;jpgHolder&quot;</span>, <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
mc.<span style="color: #006600;">jpgHolder</span>.<span style="color: #0066CC;">loadMovie</span><span style="color: #66cc66;">&#40;</span>thisPhoto.<span style="color: #006600;">thumbnailUrl</span><span style="color: #66cc66;">&#41;</span>;
mc.<span style="color: #006600;">xMax</span> = xMax;
mc.<span style="color: #006600;">yMax</span> = yMax;
<span style="color: #000000; font-weight: bold;">var</span> freeDepth = <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">_root</span>.<span style="color: #0066CC;">getNextHighestDepth</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
mc.<span style="color: #0066CC;">onRollOver</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
xTemp = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span>;
yTemp = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#40;</span>xTemp, xMax<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> = <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">min</span><span style="color: #66cc66;">&#40;</span>yTemp, yMax<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">swapDepths</span><span style="color: #66cc66;">&#40;</span>freeDepth<span style="color: #66cc66;">&#41;</span>;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_xscale</span> = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_yscale</span>=<span style="color: #cc66cc;">120</span>;
<span style="color: #66cc66;">&#125;</span>;
mc.<span style="color: #0066CC;">onRollOut</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_x</span> = xTemp;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_y</span> = yTemp;
<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_xscale</span> = <span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_yscale</span>=<span style="color: #cc66cc;">100</span>;
<span style="color: #66cc66;">&#125;</span>;
mc.<span style="color: #006600;">photo</span> = thisPhoto;
mc.<span style="color: #0066CC;">onPress</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0066CC;">getURL</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;photo&quot;</span><span style="color: #66cc66;">&#93;</span>.<span style="color: #006600;">photoPageUrl</span>, <span style="color: #ff0000;">&quot;_blank&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">var</span> u:UserRecentPhotos = <span style="color: #000000; font-weight: bold;">new</span> UserRecentPhotos<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">_root</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">toString</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">String</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #b1b100;">return</span> <span style="color: #ff0000;">&quot;[com.cecymeade.UserRecentPhotos]&quot;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>[snippet=6312]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.swfgeek.net/2007/04/01/kelvin-lucks-flasher/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.5/mx/</creativeCommons:license>
	</item>
		<item>
		<title>FuseFX Audio Example</title>
		<link>http://www.swfgeek.net/2007/03/15/fusefx-audio-example/</link>
		<comments>http://www.swfgeek.net/2007/03/15/fusefx-audio-example/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 19:53:03 +0000</pubDate>
		<dc:creator>swfgeek</dc:creator>
				<category><![CDATA[EXAMPLES]]></category>
		<category><![CDATA[TUTORIALS]]></category>

		<guid isPermaLink="false">http://www.swfgeek.net/?p=13</guid>
		<description><![CDATA[Here's a little try on the new FuseFX:
( Based on the FuseFX Download Example )]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.swfgeek.net%2F2007%2F03%2F15%2Ffusefx-audio-example%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.swfgeek.net%2F2007%2F03%2F15%2Ffusefx-audio-example%2F&amp;source=swfgeek&amp;style=normal&amp;service=bit.ly&amp;service_api=R_3d65be79f0c5331925d1c67940cbc8ef&amp;hashtags=EXAMPLES,TUTORIALS&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Here&#8217;s a little try on the new FuseFX:<br />
( Based on the FuseFX Download Example )</p>
<p><a title="volumenFuseFx" href="http://examples.swfgeek.net/flash/volumefuse"><img title="Example of FuseFX" src="http://www.cloudfaces.com/swfgeekblogexamples/images/volumeTween2.jpg" alt="Example of FuseFX" /></a></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p13code5'); return false;">View Code</a> ACTIONSCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p135"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code" id="p13code5"><pre class="actionscript" style="font-family:monospace;"><span style="color: #0066CC;">import</span> com.<span style="color: #006600;">mosesSupposes</span>.<span style="color: #006600;">fuse</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">mosesSupposes</span>.<span style="color: #006600;">fusefx</span>.<span style="color: #66cc66;">*</span>;
<span style="color: #0066CC;">import</span> com.<span style="color: #006600;">mosesSupposes</span>.<span style="color: #006600;">util</span>.<span style="color: #66cc66;">*</span>;
&nbsp;
ZigoEngine.<span style="color: #006600;">register</span><span style="color: #66cc66;">&#40;</span> PennerEasing <span style="color: #66cc66;">&#41;</span>;
FuseFX.<span style="color: #006600;">register</span><span style="color: #66cc66;">&#40;</span> MixerFX <span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> s:<span style="color: #0066CC;">Sound</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Sound</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
s.<span style="color: #0066CC;">attachSound</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;librarySound&quot;</span><span style="color: #66cc66;">&#41;</span>;
s.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
volUp_mc.<span style="color: #0066CC;">onPress</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_parent</span>.<span style="color: #006600;">fadeUp</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_alpha</span> = <span style="color: #cc66cc;">50</span>;
	ZigoEngine.<span style="color: #006600;">doTween</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;_alpha&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
volDown_mc.<span style="color: #0066CC;">onPress</span> = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_parent</span>.<span style="color: #006600;">fadeSound</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #0066CC;">this</span>.<span style="color: #0066CC;">_alpha</span> = <span style="color: #cc66cc;">50</span>;
	ZigoEngine.<span style="color: #006600;">doTween</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">this</span>, <span style="color: #ff0000;">&quot;_alpha&quot;</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> fadeUp<span style="color: #66cc66;">&#40;</span>endVolume:<span style="color: #0066CC;">Number</span>, seconds:<span style="color: #0066CC;">Number</span>, ease:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>volume<span style="color: #66cc66;">!</span>=<span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		volume = <span style="color: #cc66cc;">150</span>;
	<span style="color: #66cc66;">&#125;</span>
ZigoEngine.<span style="color: #006600;">doTween</span><span style="color: #66cc66;">&#40;</span>s, MixerFX.<span style="color: #006600;">VOLUME</span>, volume, seconds, ease<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> fadeSound<span style="color: #66cc66;">&#40;</span>endVolume:<span style="color: #0066CC;">Number</span>, seconds:<span style="color: #0066CC;">Number</span>, ease:<span style="color: #0066CC;">String</span><span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Void</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>volume <span style="color: #66cc66;">!</span>=<span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
		volume = <span style="color: #cc66cc;">0</span>;
	<span style="color: #66cc66;">&#125;</span>
ZigoEngine.<span style="color: #006600;">doTween</span><span style="color: #66cc66;">&#40;</span>s, MixerFX.<span style="color: #006600;">VOLUME</span>, volume, seconds, ease<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.swfgeek.net/2007/03/15/fusefx-audio-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.5/mx/</creativeCommons:license>
	</item>
	</channel>
</rss>

