Author Topic: Scrollbars and Zoom Problem  (Read 675 times)

MegaMan

  • Newbie
  • *
  • Posts: 12
Scrollbars and Zoom Problem
« on: March 09, 2010, 07:19:17 am »
Ok here's somethign that is driving me crazy:

You have an swf with some content and scrollbars and you zoom in. Now if you try to drag the scrollbar it also drags the page.
Is there a way for it to ignore the drag page when you are clicking on active content?

Thanks!

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: Scrollbars and Zoom Problem
« Reply #1 on: March 19, 2010, 03:39:38 pm »
Only if the active content stops the event propagation, using the stopPropagation / stopImmediatePropagation functions.
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

MegaMan

  • Newbie
  • *
  • Posts: 12
Re: Scrollbars and Zoom Problem
« Reply #2 on: March 24, 2010, 11:33:29 am »
Hi Florian,

From where should I call this function - any classes I have to import?

IE if i call stopPropagation() in my swf I'm pretty sure it wont work.
Btw just bought my commercial license today, Hans did a really good job with the credit card integration :)

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1985
  • MegaZine3 Developer
    • MegaZine3
Re: Scrollbars and Zoom Problem
« Reply #3 on: March 27, 2010, 02:43:31 pm »
Well, that depends on the scrollbar implementation, I guess. If you have access to the
actual MouseEvent handler the scrollbar uses, put it in there (this is a function provided
by the Event class, so you call it on event objects).
If you don't, try adding a mouse listener on the scrollbar object manually, with a little
lower priority (to guarantee the scrollbar will still work), and call it in there. E.g.
something like this:
Code: (actionscript3)
  1. var scrollBar:DisplayObject = ...; // your scrollbar
  2. scrollBar.addEventListener(MouseEvent.MOUSE_MOVE,
  3.    function(e:MouseEvent):void { e.stopPropagation(); });

No guarantee this will work, though, just an idea ;)
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.