<?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; MouseWheel</title>
	<atom:link href="http://www.bagonca.com/blog/tag/mousewheel/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>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>
	</channel>
</rss>
