rss twitter

Mousewheel with transparent WMODE

When you'll use the transparent WMODE in firefox while embedding flashmovies, the mousewheel ain't triggering in flash anymore. This is a short workaround showing how you'll still be able to use it anyway.

Actionscript:

Actionscript:
  1. import flash.external.ExternalInterface;
  2.  
  3. ExternalInterface.addCallback("mousewheelHandler", mousewheelHandler);
  4.  
  5. private function mousewheelHandler(val:String):void {
  6.     int(val) > 0 ? flowForward(null) : flowBack(null);
  7. }

Javascript (Mootools 1.2.3):

JavaScript:
  1. if (Browser.Engine.gecko && (flashContainer = $('flash'))) {
  2.     flashContainer.addEvent('mousewheel', function(event) {
  3.         flashContainer.mousewheelHandler(event.wheel);
  4.         event.stop();
  5.     });
  6. }

If you're not wanting to use Javascript you are only able to get this to work with taking another WMODE.

HTML:

CODE:
  1. <param name="wmode" value="window" />

5 Responses to “Mousewheel with transparent WMODE”

  1. SaWe says:

    Hi. Could you prease help me? I can't figure out how to implement the Script.

    Greetz
    Sarah

  2. Marvin Blase says:

    Hey Sarah,
    actually I think you don't need this script now any longer as the Firefox 3.6 did fix it by itself. Now the Chrome is having some troubles with this WMODE but I'm going to have a closer look at that and then update this post.

    But anyway - where do you stuck? On the Flashside or the script?

  3. Raul says:

    this is for AS3 or AS2?

  4. Really nice and impressive blog i found today from Bing.What can I say?I marked it and will come back later.

Leave a Reply

Powered by WordPress | Free T-Mobile Phones for Sale | Thanks to Palm Pre Blog, Video Game Music and Get Six Pack Abs