Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-11-2008, 04:08 PM   #1
Registered User
Join Date: Jul 2008
Location: Silver Spring, MD, USA
Posts: 1
Default Mouse Wheel Scrolls Web Page Instead of Flash (As2 vs As3)

I am working on interactive flash maps, where I like to let the
mousewheel control the map zoom when the map is in use, similar to
Google Maps. AS2 versions worked fine. But AS3 has focus problems,
here is a finished example showing Bars of Philadelphia:


The issue is the mouse wheel now scrolls the whole page even when the
flash element is on focus. So when using the mouse wheel to zoom in/
out of the map, you will also scroll the web page itself (this page
scroll will be visible if you set your browser window short enough to
get a horizontal scroll bar). This flash scroll + web page scroll at
the same time is strange to me and should be able to be controlled.
For example, when scrolling the textfield, the mousewheel performs the
scroll without scrolling the page, until it reaches the top or the
bottom, then the textfield freezes and scroll returns to the web page
+ map.

In short: why should AS3 flash embedding be different than AS2 flash
embedding when it comes to browser page mouse wheel event behavior? Is
that something that can be controlled through better "focus" settings
in the actionscript itself? Or through Swfobject?

Here's a quick comparison of AS2 vs AS3 illustrating the problem
(without swfobject).


I am looking for a method to keep the web page from moving when the
user is mouse wheeling on the flash, either through tweaks to AS code,
Swfobject, or external web page javascript hackery.
geocentric is offline   Reply With Quote
Old 07-25-2008, 01:11 AM   #2
Registered User
Join Date: Jul 2008
Posts: 18

Umm, I tried the first version you said was finished and the wheel worked just fine.

As of AS2 to AS3, its probable that there is different behaviors of the two. If that is the case, maybe use a "scroll bar" inside your swf instead and it'll work the same. That's what I would do at least...
papastiffy is offline   Reply With Quote
Old 08-10-2008, 03:57 PM   #3
Join Date: May 2008
Location: Halifax, NS, Canada
Posts: 82

Could be because I am on a mac but neither the AS2 or the AS3 worked for me (in terms of scrolling).
sixtyfootersdude is offline   Reply With Quote
Old 08-12-2008, 11:12 AM   #4
Registered User
Join Date: May 2008
Posts: 11

I just did a test with an instance of a TextField both on AS2 and AS3. They seem to behave similarly and just the way we wanted. I just hope we could take a peek on how the TextField class is being implemented so we can do it efficiently.
Project1.exe is offline   Reply With Quote
Old 08-14-2008, 12:22 PM   #5
Registered User
Join Date: Oct 2007
Posts: 6
Default Zoom and pan

Hi Geocentric,

I have been looking everywhere on the internet to do the zoom using mousewheel and can also use the hand cursor to pan the image. It seems that i cannot find anything.

I had a look at your example and it looks very nice.

Would it be possible for me to get hold of your file (as2) so i can learn about it please.



Last edited by jerome.chevreau; 08-14-2008 at 01:43 PM.
jerome.chevreau is offline   Reply With Quote
Old 09-09-2008, 02:20 AM   #6
Registered User
Join Date: May 2007
Posts: 5


I have this exact problem and its really frustrating... anyone have any solutions that are within flash, and not adding javascript on the outside? I don't have that luxury...
fucrate is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing variables from AS3 to an external web page AS3scott ActionScript 3.0 0 06-18-2008 08:36 PM
how to not scroll the web browser when using the mouse wheel over a flash app springframework ActionScript 3.0 8 04-21-2008 06:48 AM
Some Flash Video Converter Tools Compare terry117 Detention 7 05-18-2006 02:08 AM
Scrolling a page with the mouse wheel... boycraft ActionScript 2.0 2 01-12-2005 11:52 AM
Php, Javascript, and Flash 5 browser detect and more! Redline01 Server-Side Scripting 2 08-11-2001 01:09 AM

All times are GMT. The time now is 11:40 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.