thanx man .. it completely solved my problem.. but I needed to call doScroll Js function everytime, not only target was eq to undefined , so I removed the if statement and now it works perfectly!!

respect!! :)

kerem.

Muzak wrote:
When the flash movie has focus, it captures the mouse actions instead of the 
browser and vice versa

You can tell the browser, through javascript, to scroll from within you flash 
movie, using the ExternalInterface API.

=========================
in html page
=========================

<script language="javascript">
<!--
function doScroll(delta) {
 // alert('doScroll: ' + delta);
 window.scrollBy(0, delta*10);
}
//-->
</script>

========================
in flash
========================

import flash.external.*;

function onMouseWheel(delta:Number, target:String) {
 trace("Application ::: onMouseWheel");
 // only call JS if target is undefined
 if (target == undefined) {
  var reverseDelta:Number = (delta<0) ? Math.abs(delta) : 0-delta;
  ExternalInterface.call("doScroll", reverseDelta);
 }
}
Mouse.addListener(this);


Note that you have to reverse the delta (the amount to scroll).
For some reason flash uses the opposite from what the browser uses (scroll 
direction).

Also only perform the Javascript call if nothing else in the Flash movie is 
selected (target == undefined).
If you have a TextArea instance that has focus, you don't want to scroll the 
browser ;-)

regards,
Muzak

----- Original Message ----- From: "Kerem ISERI" <[EMAIL PROTECTED]>
To: <flashcoders@chattyfig.figleaf.com>
Sent: Wednesday, March 14, 2007 12:45 PM
Subject: [Flashcoders] page scrolling problem


Hi everyone,

I have finished a flash website which dynamically changes it's height by the 
help of small javascript.
the idea was to resize the height by the content's height and to use only browsers scrollbar. you can check the demo version on http://demo.trafo.com.tr/drbackup . now the problem is when you start an interaction on the flash, and try to scroll down the page by the mouse wheel,,, its not scrolling down. because the page height is longer then the browser size, scrolling up and down by the mouse wheel supposed to be happened naturally.
the whole page is left aligned and there is an empty space on the right side, 
which is not a flash area,.
in order to scroll down by mouse wheel, you are being have to click on that 
empty part of the page and its so unfriendly.

anybody has an idea about this problem??

i tried to make the flash transparent, then a bug occured on flash.. because the page is in turkish, special letters like " " didnt worked in my dynamic text fields, even they are embedded. i think thats an another another issue to talk about anyways.

thanx for your help.

kerem iseri.



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to