SWFObject add-on: MouseWheel on Mac OS
I’ve had the mouse wheel working in flash on OS X for a while, and after seeing the SWFAddress add-on for deconcept’s SWFObject embedding system, I thought I’d add mousewheel functionality to SWFObject, rather than using my own “frankenstein” embedding system.
It’s straight forward to implement. Download SWFMacMouseWheel here.
Within ActionScript, you’ll barely notice any difference. Only that instead of using Mouse.addListener(), you’ll refer to my class instead.
Example code:
[as]
import com.pixelbreaker.ui.MouseWheel;
class Example
{
function Example(){
MouseWheel.addListener( this );
}
public function onMouseWheel( delta:Number ):Void
{
// do something with the delta value
}
}
[/as]
All the javascript is included in the zip, with an example html file.
You simply have to add one line of code to the javascript:
[js]
var so = new SWFObject(‘test.swf’, ‘website’, ‘100%’, ‘100%’, ‘8′, ‘#FFFFFF’);
so.useExpressInstall(‘js/expressinstall.swf’);
so.addParam(‘menu’, ‘false’);
so.addParam(’scale’, ‘noscale’);
so.addParam(’salign’, ‘lt’);
// CHANGE BELOW
if( so.write(‘flashcontent’) )
{
var macmousewheel = new SWFMacMouseWheel( so );
}
[/js]
72 Comments so far
Awesome, this is actually very useful… we have clients all the time that want mouse wheel support on macs.
Hi Geoff, glad it’s of use. I’ve also got a little class that allows flash movies to be 100% of the browser, but not go below a certain size, I’ll make that work along side SWFObject in the next week, I’ll let you know when it’s done.
[...] Extending Flash support in browser is the new black these days. Pixelbreaker adds a very welcome addition by extending support for the mouse wheel in Flash to the Macs with is own MouseWheel extension. Finally mouse wheel support is no longer Windows only! [...]
[...] ya puedes utilizar la ruedecita del rat
hi zokdok, I’ll get it done asap, just i’m finishing my current employment tomorrow, so big party tonight, gonna be a bit tricky to get anything done before sunday…
[...] pixelbreaker
It should work fine with Flash 7, you just have to be using ActionScript 2.0. The version available above will only work with SWFObject. I’ve not had any issues using SWFObject with different layouts.
Hi,
It seems it doesn’t run on Safari 2.0.4, flash Player 9
I’m running it on Safari 2.0.4 here, and it’s fine.
[...] Mac ScrollWheel Support [...]
With Safari, I get this message when opening the sample:
str:
onMouseWheel: [type Function]
$version: MAC 9,0,16,0
mouse_txt: _level0.mouse_txt
test_txt: _level0.test_txt
Using Firefox 2.0, I’m getting the “You need to upgrade your Flash Player!” message.
With Safari, I get this message when opening the sample:
str:
onMouseWheel: [type Function]
$version: MAC 9,0,16,0
mouse_txt: _level0.mouse_txt
test_txt: _level0.test_txt
Also, when using Firefox 2.0, I’m getting the “You need to upgrade your Flash Player!” message.
Dave, the flash detection is working in firefox 2.0 on Windows and OS X for me, maybe you should direct questions for that to deconcept (who made the detection scripts).
The message you see in safari is correct, that’s what my test movie shows… once you scroll the mouse wheel, you should see another textfield to the right, echoing some numbers,
[...] A couple of weeks ago pixelbreaker released a kick-ass add-on to SWFObject called SWFMacMouseWheel which enables the mousewheel support in Flash for OSX. I was a little bummed on their example code though… so I’ve created a little example of some scrolling textFields. It uses a simple hitTest to see if mouse is over the textField and then increments the vPosition accordingly. example [...]
Great work!
It works on safari 2.0.4 and OSX 10.4.8.
Hi, I too am getting the same response as Dave, I see the textfields on the top left but when I use the mouse scroller I don’t see anything changing, this happens when I use firefox or Safari. I’m running FP 9 in both cases.
Both the example SWF and my own attempts both fail to show output from the scrollwheel.
Any ideas?
Hi… I also had the same Problem lke Dave and Kev, using Saf 2.0.4 or Firefox 2.0…
LOCAL… it has to be online (on the Server) to work!!!
Thx, it’s great!
Pedro, you probably have to change your flash player security settings and allow “c:\” if you’re on PC or “Macintosh HD” if you’re on mac.
You might want to change the main() to init() or something when you’re used to work with mtasc (like me).
While working with Flex 2 on a AS3 project a textfield suddenly scrolled by wheel – and this on the MAC!!! standalone debug player. Also MouseEvent.MOUSE_WHEEL is broadcasted. Although the mac mouse wheel support is still missing in the flash plugin itself (9.28), it seems to be in the pipe now!
[...] Extending Flash support in browser is the new black these days. Pixelbreaker adds a very welcome addition by extending support for the mouse wheel in Flash to the Macs with is own MouseWheel extension. Finally mouse wheel support is no longer Windows only! [...]
[...] » Läs mer på pixelbreaker.com. [...]
[...] Part of eepmon version 3 allows the user to use their mouse wheel to scroll through content. Works great in Windows but no go on a MAC. So I’ve done a google search and stumbled upon pixelbreaker’s site where he has resolved the mouse wheel conflict. [...]
[...] Mac OSX Support [...]
[...] Get all the info here [...]
クロスプラットフォーム Flashスクロールクラス&JS Beta…
ジミーな研究。 ■Flash8のスクロール関係コンポーネントがどうも使いづらい。……
thenk you
I have desccovered a bug with this code with the undocumented scrollTarget parameter onMouseWheel event. Basically this param tells you what movieclip the mouse is currently over. The following code fixes this if this could be updated in the source it would be a good idea.
The solution is a bit of a hack but it works
private public static function externalMouseEvent(delta:Number):Void
{
var st:MovieClip = _root.createEmptyMovieClip(“st”, _root.getNextHighestDepth());
st.startDrag();
//
st.func = macBroadcaster.broadcastMessage;
st.scope = macBroadcaster
st.args = ["onMouseWheel", delta];
//
st.onEnterFrame = function() {
//
this._x = _root._xmouse;
this._y = _root._ymouse;
//
if (this._droptarget != “” && this._droptarget!= undefined) {
//
this.args.push(eval(this._droptarget));
this.func.apply(this.scope, this.args);
//
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
Sorry typo in the above change that first line from
private static function externalMouseEvent(delta:Number):Void
{
var st:MovieClip = _root.createEmptyMovieClip(“st”, _root.getNextHighestDepth());
st.startDrag();
//
st.func = macBroadcaster.broadcastMessage;
st.scope = macBroadcaster
st.args = ["onMouseWheel", delta];
//
st.onEnterFrame = function() {
//
this._x = _root._xmouse;
this._y = _root._ymouse;
//
if (this._droptarget != “” && this._droptarget!= undefined) {
//
this.args.push(eval(this._droptarget));
this.func.apply(this.scope, this.args);
//
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
[...] Now getting Scroll Wheel to work on Mac is a little trickier as Flash doesn’t have native support for this but there is a way to get this to work in Flash 8. The Javascript and Actionscript provided code from PixelBreaker as a SWFObject add-on allows you to do this. It’s pretty good but has one shortcoming and that is that it only provides the delta parameter and not scrollTarget, I have an Actionscript fix for this and it’s a bit of a hack but hey it works, I hope u find this useful. [...]
Great work man, you saved my ass!
I’m not such an experet, but i did it to work in a couple of hours.
Thanx again
hi_gui
Shane, good that you got scrolltarget working, I never use it, and creating _root movieclips is too hacked for my liking. By all means, publish your own version of the code.
cheers
[...] SWFMacMouseWheel [...]
[...] UPDATE As the Flash Player for Macs doesn’t have support for Mousewheel events, I have updated the source code with a mac version which uses a javascript workaround. You’ll also need to download the SWFMacMouseWheel class from pixelbreaker. I have tested it on Mac OS X Safari and Firefox, works fine. To install the class, copy the “com” folder and paste it into your Actionscript 2.0 class folder. Typical paths are Windows: Hard DiskDocuments and SettingsuserLocal SettingsApplication DataAdobeFlash CS3languageConfigurationClasses Macintosh: Hard Disk/Users/user/Library/Application Support/Adobe/Flash CS3/language/Configuration/Classes [...]
[...] This extra also showcases the use of the SWFMacMouseWheel javascript, by PixelBreaker. By using this javascript, MAC users can also scroll through the playlist with their mousewheel. [...]
I want to use vista.. but my os don’t support them!
youtube
mirc
radyo
mirc
sohbet
sohbet
Works great in Safari, but on Windows with IE, the scroll wheel doesn’t work until you click on something (activeX). The swfobject.js doesn’t work for the scrollwheel.
Wow, this is a great release. I won’t have that much use for the resizable columns, but the new feed navigation is really great for me!
Wow, this is a great release. I won’t have that much use for the resizable columns, but the new feed navigation is really great for me!!!
Murat Boz
I’ll be checking your blog a lot from now on, and I hope you have it sooner then next week, as I’m currently in the process of adapting the code… which would same me a some time and trouble.
(Or maybe you could send me the beta code, in which I can help test and bug hunt.)Sohpet
I’ll admit, I’m no actionscript pro so if anyone has used this fancy mousewheel stuff with a custom scrollbar such as this:.
Hi, I’m Turkish science communicator.I like very very much Nature Podcast.
Congratulations!
Hi. I found your site a while back when I was looking for existing solutions for OS X mouse wheel support, but found none that would be easily plugged to Flex/AS3 apps, so I implemented one myself. You can find it here:
http://hasseg.org/blog/?p=3
Hi. I also had the same Problem lke Dave and Kev, using Saf 2.0.4 or Firefox 2.0.
Local. it has to be online (on the Server) to work
thanx
[...] SWFMacMouseWheel [...]
Shane, good that you got scrolltarget working, I never use it, and creating _root movieclips is too hacked for my liking. B
[...] pixelbreaker : SWFObject add-on: MouseWheel on Mac OS I’ve had the mouse wheel working in flash on OS X for a while, and after seeing the SWFAddress add-on for deconcept’s SWFObject embedding system, I thought I’d add mousewheel functionality to SWFObject, rather than using my own “frankenstein” embedding sy (tags: actionscript javascript swfobject MouseWheel mac flash) [...]
[...] en ai profité pour utiliser le javascript swfmacmousewheel.js qui permettrait à la mousewhell mac de fonctionner sur flash (impossible de vérifier je suis sur [...]
[...] tried to use the fix to make the mouse wheel work in Flash when you use Mac OS X that can be found here. But that didn’t do it. My last option was to use the new technique from the makers of [...]
Top 6 Flash Development Tools…
1) Fuse Kit For movieClip tweening I’ve been using the Zigo Tween engine until I saw Moses Gunesch at the Flash Forward conference in Austin showing off this amazing set of classes. Fuse is built upon the Zigo engine and……
[...] Gabriel Bucknail created almost a year ago a SWFObject add-on to bring MouseWheel support to the Mac OS X Flash Player. Seems to be still up to date: Solution [...]
AS3でSWFMacMouseWheelを作ってみたよ。…
SWFMacMouseWheel がAS2にしか対応してないらしくて、
勢いでAS3に対応したヤツを作ってみたよ。
使い方はある程度真似てみたんだけれども、
AS2を知らないので何とも。
AS側の使い…
[...] (via FTween). There is a textpanel there, too. Sorry, no buttons on the scrollbar. You are using swfmacmousewheel, [...]
software gioco poker…
Still best credit card debt help telecharger poker superstars…
[...] UPDATE: I was curious, so I did a quick search and discovered that someone figured out how to get the Mouse Wheel to work in Flash on a Mac through SWFObject. BooYah. [...]
[...] AW: mousewheel mit Mac Hi, der genannte Threat von 1manni1 stammt ja von mir Damit das Mouserad auch auf dem Mac funktioniert brauchst du die zus
[...] Player 9 ….. a SWFObject add-on to bring MouseWheel support to the mac OS X flash Player. …http://blog.pixelbreaker.com/flash/swfmacmousewheel/Mac Classic Software Updates and Mac Classic Downloads – VersionTrackerListing current versions of [...]
[...] damit das am MAC funktioniert braucht mal wohl dieses add-on: http://blog.pixelbreaker.com/2006/11/08/flash/swfmacmousewheel/ das ist der beispiel code: PHP:1234567891011121314151617 [...]
[...] whole class is now relying on MacMouseWheel class from pixelbreaker [...]
MacでもFlashでホイール操作が出来るようにする (SWFMacMouseWheel)…
Flashコンテンツでマウスのホイールイベントを利用する場合、そのままではMa……
[...] hack for SWFObject called SWFMacMouseWheel. Apparently it’s been available in one form or another since 2006! Gotta remember to store that one in my brain parts for [...]
[...] http://blog.pixelbreaker.com/flash/swfmacmousewheel/ [...]
[...] Mac OS X Mousewheel Support in AS2 « Moderator: Taking Control Over Your WordPress Comments [...]
[...] the Flash Player. If you are interested in a work around for the mouse wheel issue, check out this post. Also, the longer the list of data, the better the animation effect because there is more data to [...]
[...] preloader/caching is handling the load. This version doesnt support mac wheels as it is not loading pixelbreakers excellent [...]
[...] PIXEL BREAKER.さんがAS3用、AS2用を作られています。 ・AS3 ・AS2 [...]
[...] Site de PixelBreaker : http://blog.pixelbreaker.com/flash/swfmacmousewheel/ [...]
[...] This post was Twitted by richardolsson [...]
[...] For those who want to know how you can use the MouseWheel for ActionScript 2.0 have a look at this post. [...]
[...] vielleicht bringt das ja was?! > http://blog.pixelbreaker.com/flash/swfmacmousewheel/ [...]
[...] This cross OS mouse wheel functionality is made possible with the use of the ‘MouseControl class’ from MrSteel and the SWFObject add-on: MouseWheel on Mac OS from pixelBreaker. [...]