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

<channel>
	<title>Bagonca &#187; Flex and ActionScript</title>
	<atom:link href="http://www.bagonca.com/blog/tag/flex-and-actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bagonca.com/blog</link>
	<description>Yet another developer blog</description>
	<lastBuildDate>Fri, 18 Jun 2010 09:28:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Stopp Internet Explorer&#8217;s CTRL &#8211; MouseWheel</title>
		<link>http://www.bagonca.com/blog/2009/04/22/ie7-ctrl-mousewheel/</link>
		<comments>http://www.bagonca.com/blog/2009/04/22/ie7-ctrl-mousewheel/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 09:33:55 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Flex/AS]]></category>
		<category><![CDATA[Flex and ActionScript]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[MouseWheel]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=293</guid>
		<description><![CDATA[CTRL - MouseWheel in IE7 will resize everything on the page (even the flash application area itself). Here's how to stop that from happening.]]></description>
			<content:encoded><![CDATA[<p>As a Flex developer I come in contact with all sorts of problems when I run my applications in Internet Explorer 7. One of the most annoying ones is the one where CTRL &#8211; MouseWheel will resize the Flex application area itself, even when the application is scaled to 100% * 100% of your browser window and has focus. This is impossible to accept and here is the solution to the problem.</p>
<p>Assuming that you&#8217;re working with Flex Builder, all you have to do is edit the index.template.html file a little bit. Such that it contains the following JavaScript.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> catchCtrlMouseWheel<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">event</span>.<span style="color: #660066;">type</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;mousewheel&quot;</span> <span style="color: #009900;">&#41;</span> 
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">event</span> <span style="color: #339933;">&amp;&amp;</span> window.<span style="color: #660066;">event</span>.<span style="color: #660066;">wheelDelta</span> <span style="color: #009900;">&#41;</span> 
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">return</span> window.<span style="color: #660066;">event</span>.<span style="color: #660066;">ctrlKey</span> <span style="color: #339933;">?</span> <span style="color: #003366; font-weight: bold;">false</span> <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And in the &lt;body&gt;-tag:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;body onmousewheel=&quot;return catchCtrlMouseWheel()&quot;&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.bagonca.com/blog/2009/04/22/ie7-ctrl-mousewheel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use cacheAsBitmap correctly &#8211; or not at all</title>
		<link>http://www.bagonca.com/blog/2009/04/17/use-cacheasbitmap-correctly-or-not-at-all/</link>
		<comments>http://www.bagonca.com/blog/2009/04/17/use-cacheasbitmap-correctly-or-not-at-all/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 15:03:37 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Flex/AS]]></category>
		<category><![CDATA[cacheAsBitmap]]></category>
		<category><![CDATA[Flex and ActionScript]]></category>

		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=155</guid>
		<description><![CDATA[Learn what problems cacheAsBitmap can cause and when it is correct to use it = nearly never.]]></description>
			<content:encoded><![CDATA[<p>You may have heard that the <code>cacheAsBitmap</code> functionality introduced in FlashPlayer 8 and available since Flex SDK 3 can sometimes help you improve performance. That is true, but only as long as the disply object is <strong>only moved</strong>.</p>
<ul>
<li>If you apply any other transformation on the display object, FlashPlayer will cache a new rasterised version of the object for each iteration of the transformation.</li>
<li>If you apply any filters to your object, two versions are cached, one &#8220;normal&#8221; and one for the filtered result.</li>
</ul>
<p>Both of these things may result in a higher than necessary load on your CPU and memory resources, <strong>when doing anything but only moving the display object</strong>.</p>
<p>Therefore, use <code>cacheAsBitmap</code> only on display objects that you know will only be moved around the stage, never on objects that will have any other sort of transformation.</p>
<p>An added problem with <code>cacheAsBitmap</code> is a known &#8220;bug&#8221; in the Mac version of the FlashPlayer where display objects that are using it can misunderstand their own redraw regions, resulting in a corrupted view. It seems rather rare though.</p>
<p>Also, when extending UIComponents &#8211; the default FlashPlayer behaviour is to heuristically try to find out if you usually <code>cacheAsBitmap</code>. If you look at the code in UIComponent of Flex 3 SDK you will find the following statement:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _cachePolicy<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = UIComponentCachePolicy.<span style="color: #004993;">AUTO</span>;</pre></div></div>

<p>To make sure that the default behaviour of all of your objects that inherit from UIComponent instead inherit from your own extension of UIComponent which could invoke</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">this</span>.setCachePolity = UIComponentCachePolicy.OFF</pre></div></div>

<p>There are many people out there who have opinions about the <code>cacheAsBitmap</code> functionality as it is implemented today. Two examples are:</p>
<ul>
<li><a title="by Actionscript guru Thibault Imbert " href="http://www.bytearray.org/?p=290" target="_self">Why cacheAsBitmap is bad</a></li>
<li><a title="by Actionscript guru Thibault Imbert " href="http://www.bytearray.org/?p=403">Vote for a new cacheAsBitmap behavior!</a></li>
<li><a title="by Jesse Warden" href="http://jessewarden.com/2008/11/flex-move-effect-messes-up-mask-alignment.html">Flex Move Effect Messes Up Mask Alignment</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bagonca.com/blog/2009/04/17/use-cacheasbitmap-correctly-or-not-at-all/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MouseWheel Event on Mac</title>
		<link>http://www.bagonca.com/blog/2009/04/14/mousewheel-event-on-mac/</link>
		<comments>http://www.bagonca.com/blog/2009/04/14/mousewheel-event-on-mac/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 10:32:41 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Flex/AS]]></category>
		<category><![CDATA[Flex and ActionScript]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[MouseWheel]]></category>

		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=129</guid>
		<description><![CDATA[MouseWheel Events do not trigger properly in flex applications on Mac OSX. Thanks to Gabriel at Pixelbreaker there is a nicely implemented workaround for this]]></description>
			<content:encoded><![CDATA[<p>When working with Adobe Flex you may have encountered trouble when trying to get mousewheel functionality to work on Mac OSX. Even though Flex natively supports the MouseWheel event it does not trigger in the browsers that I have tried on Mac (Safari and FF3) &#8211; this is probably due to the OS or the browser &#8220;stealing&#8221; the MouseWheel event for its own purposes.</p>
<p>The solution for this is to get JavaScript to communicate with your Flex application and &#8220;forward&#8221; the MouseWheel event.</p>
<p>Gabriel @ <a title="Pixelbreaker" href="http://blog.pixelbreaker.com" target="_blank">Pixelbreaker</a> has solved this with a really nice little implementation that he calls SWFMacMouseWheel. <a title="MouseWheel on Mac solution" href="http://blog.pixelbreaker.com/flash/as30-mousewheel-on-mac-os-x/" target="_blank">Read all about it here</a>.</p>
<p><strong>Step 1</strong><br />
Download the &#8220;source and demo&#8221; code found below the post. Move the file <code>com.pixelbreaker.ui.osx.MacMouseWheel.as</code> to your Flex 3 project.</p>
<p><strong>Step 2</strong><br />
Create a folder called &#8220;js&#8221; in your html-template folder. Move the files <code>swfmousewheel2.js</code> and <code>swfobject.js</code> to that folder.</p>
<p><strong>Step 3</strong><br />
In the html-template folder edit the <code>index.template.html</code> file to correspond with the file included in the zip you downloaded. It should contain roughly the following:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> vars <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> params <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> scale<span style="color: #339933;">:</span><span style="color: #3366CC;">'noScale'</span><span style="color: #339933;">,</span> salign<span style="color: #339933;">:</span><span style="color: #3366CC;">'lt'</span><span style="color: #339933;">,</span> menu<span style="color: #339933;">:</span><span style="color: #3366CC;">'false'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> attributes <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> id<span style="color: #339933;">:</span><span style="color: #3366CC;">'testObject'</span><span style="color: #339933;">,</span> <span style="color: #000066;">name</span><span style="color: #339933;">:</span><span style="color: #3366CC;">'testObject'</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// give an id to the flash object</span>
swfobject.<span style="color: #660066;">embedSWF</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;test_as3.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;flashContent&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100%&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;100%&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;10.0.0&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;playerProductInstall.swf&quot;</span><span style="color: #339933;">,</span> vars<span style="color: #339933;">,</span> params<span style="color: #339933;">,</span> attributes <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
swfmacmousewheel.<span style="color: #660066;">registerObject</span><span style="color: #009900;">&#40;</span>attributes.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Don&#8217;t forget to include the two javascript files you copied to the js-folder.</p>
<p><strong>Final step</strong><br />
In your application startup code invoke the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> com.pixelbreaker.ui.osx.MacMouseWheel;
MacMouseWheel.setup<span style="color: #000000;">&#40;</span> <span style="color: #004993;">stage</span> <span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>And you should be set to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bagonca.com/blog/2009/04/14/mousewheel-event-on-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Triggering a Save File Dialogue from Flex</title>
		<link>http://www.bagonca.com/blog/2009/04/06/triggering-a-save-file-dialogue-from-flex/</link>
		<comments>http://www.bagonca.com/blog/2009/04/06/triggering-a-save-file-dialogue-from-flex/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 15:54:19 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Flex/AS]]></category>
		<category><![CDATA[FileReference]]></category>
		<category><![CDATA[Flex and ActionScript]]></category>
		<category><![CDATA[open file]]></category>
		<category><![CDATA[save file]]></category>

		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=63</guid>
		<description><![CDATA[Ever wanted to save a file directly from a Flex application to your local hard drive?]]></description>
			<content:encoded><![CDATA[<p>With the recent release of the <a title="Official Flex Team Blog" href="http://blogs.adobe.com/flex/archives/2009/03/flex_sdk_33_released_1.html" target="_blank">Adobe Flex SDK 3.3</a> comes the fantastic new <a title="API docs for FileReference" href="http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html" target="_blank"><code>FileReference</code></a> class. Now, anybody who has ever worked in Flex must have been very annoyed with the fact that you actually sometimes have to write server side operations to be able to trigger normal loading and saving of files.</p>
<p>With <code>FileReference</code> it&#8217;s as simple as this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> myFileReference<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">FileReference</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">FileReference</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
myFileReference.<span style="color: #004993;">save</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;i just put some string data here lol&quot;</span>, <span style="color: #990000;">&quot;filename.txt&quot;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>and you&#8217;re done!</p>
<p>To get access to this functionality you will need to <a href="http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_sdk.html#installation" target="_blank">download the Flex 3.3 SDK</a>.</p>
<p>If you are using FlexBuilder:</p>
<ul>
<li>install the sdk in the &#8220;sdks&#8221; directory of your FlexBuilder installation</li>
<li>in Windows &raquo; Preferences &raquo; Flex &raquo; Installed Flex SDKs: Add the new SDK by simply pointing to the SDK path (and set it as default)</li>
<li>make sure that your project&#8217;s preferences is set to use the new SDK</li>
<li>Finally, set your project to demand at least Flash Player 10 from users (if you plan on using any of the new Classes)</li>
</ul>
<p>A very slight drawback for this simple but fantastic feature is that the code triggering the <code>FileReference</code> has to be initiated by a user <code>Event</code>.  For security reasons of course.</p>
<p>This feature made me very happy and saved our project from at least a day of writing serverside crap.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bagonca.com/blog/2009/04/06/triggering-a-save-file-dialogue-from-flex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HandCursor problems in Flex</title>
		<link>http://www.bagonca.com/blog/2009/03/31/handcursor-problems-in-flex/</link>
		<comments>http://www.bagonca.com/blog/2009/03/31/handcursor-problems-in-flex/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 15:36:57 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Flex/AS]]></category>
		<category><![CDATA[Flex and ActionScript]]></category>
		<category><![CDATA[handcursor]]></category>

		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=14</guid>
		<description><![CDATA[Why doesn't the hand cursor activate over my flex component! wtf!!]]></description>
			<content:encoded><![CDATA[<p>Many times you will want any given component in Adobe Flex to use the hand cursor when you are hovering it, to indicate that you can click it. But on some components you will have to go through a few more steps than is intuitive.</p>
<p>Take for example the <code>Label</code> component. You may assign it as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">myLabel.<span style="color: #004993;">useHandCursor</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
myLabel.<span style="color: #004993;">buttonMode</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;</pre></div></div>

<p>And hope that your are done.</p>
<p>WRONG!</p>
<p>You will need to set the property mouseChildren to false for it to work. Like such:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">myLabel.<span style="color: #004993;">useHandCursor</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
myLabel.<span style="color: #004993;">buttonMode</span> = <span style="color: #0033ff; font-weight: bold;">true</span>;
myLabel.<span style="color: #004993;">mouseChildren</span> = <span style="color: #0033ff; font-weight: bold;">false</span>;</pre></div></div>

<p>And now you are done, incidentally this will work for most Flex components. <img src='http://www.bagonca.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bagonca.com/blog/2009/03/31/handcursor-problems-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DragScrollingCanvas &#8211; from the wonderful flexlib</title>
		<link>http://www.bagonca.com/blog/2009/03/31/dragscrollingcanvas_-_from_the_wonderful_flexlib/</link>
		<comments>http://www.bagonca.com/blog/2009/03/31/dragscrollingcanvas_-_from_the_wonderful_flexlib/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 13:51:47 +0000</pubDate>
		<dc:creator>Jon</dc:creator>
				<category><![CDATA[Flex/AS]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[DragScrollingCanvas]]></category>
		<category><![CDATA[Flex and ActionScript]]></category>
		<category><![CDATA[flexlib]]></category>
		<category><![CDATA[projectplace]]></category>

		<guid isPermaLink="false">http://www.bagonca.com/blog/?p=1</guid>
		<description><![CDATA[Modding of DragScrollingCanvas to allow floating of components.]]></description>
			<content:encoded><![CDATA[<p>At Projectplace we are currently in the process of developing an exiting thing: a fast and easy to use planning tool (working name: Yap)! You can read more about that at <a href="http://www.projectplacelabs.com" target="_blank">Projectplace Labs</a>.</p>
<p>The reason for this little post however  is to promote the open source project <a href="http://code.google.com/p/flexlib/" target="_blank">flexlib</a> and more specifically a component contained therein, the DragScrollingCanvas. <a href="http://www.bradrice.com/drupal/flexScrollingCanvas" target="_blank">Brad Rice covers the basics of this component</a>.</p>
<p>We&#8217;ve had much use of this little component in our early development of our timeline view, and whatever your Flex needs might be, you are sure to find tons of helpful components in flexlib.</p>
<p>One thing that we were lacking was the ability to make some components contained in a DragScrollingCanvas move together with the view port. Basically, we wanted a few components to be able to &#8220;float&#8221; on top of the Canvas, keeping its relative position at all times. We solved this by dispatching an event from within the DragScrollingCanvas itself. So, first we typed up a little Event (the below event only allows relative positioning vertically).</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> com.projectplace.<span style="color: #004993;">graphics</span>.events
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> DragScrollEvent extends <span style="color: #004993;">Event</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> static const DRAGSCROLLED<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;dragscrolled&quot;</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> _y<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> DragScrollEvent<span style="color: #000000;">&#40;</span><span style="color: #004993;">type</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>, <span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">type</span>, <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>._y = <span style="color: #004993;">y</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

</blockquote>
<p>and within DragScrollingCanvas we dispatched this event as soon as some scrolling occured, in the <code>systemManager_mouseMoveHandler</code> function. Last in this function we added:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">dispatchEvent</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> DragScrollEvent<span style="color: #000000;">&#40;</span>DragScrollEvent.DRAGSCROLLED, <span style="color: #0033ff; font-weight: bold;">this</span>.verticalScrollPosition<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</pre></div></div>

<p>This allowed us to be able to listen for the event in the application, and move whatever component within the canvas to a new position on the canvas, while the user is scrolling. If you&#8217;re crafty you can easily expand this functionality to the horizontal axis as well. Anyway, this is the result, so far. Notice how the date bar on top, follows your scrolling vertically <img src='http://www.bagonca.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><iframe src="http://www.bagonca.com/yap/" width="570" height="500"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bagonca.com/blog/2009/03/31/dragscrollingcanvas_-_from_the_wonderful_flexlib/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
