Copy link to clipboard
Copied
I'm using AS3 and created a MOUSE WHEEL EventListener. It works fine when testing in the Flash authoring program...but not in the browser.
(except In IE...which I found odd).
I have looked around in different forums and many people have this problem and explanations on why it doesn't work.
I believe the problem cannot be solved in Flash...but through JavaScript.
So my question is...does anyone have a JavaScript code that would make this work?
Thanks
appreciate it
Copy link to clipboard
Copied
are you using an html embedding file published by the flash program? if so, what's the url and what browser has a problem?
Copy link to clipboard
Copied
Yes...I used the Flash html file
here is the code. I tried it in FireFox (the most recent version) and in Google Chrome
<script language="JavaScript" type="text/javascript">
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0',
'width', '100%',
'height', '100%',
'src', 'test',
'quality', 'high',
'pluginspage', 'http://www.adobe.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'noscale',
'wmode', 'transparent',
'devicefont', 'false',
'id', 'test',
'bgcolor', '#ffffff',
'name', 'test',
'menu', 'true',
'allowFullScreen', 'false',
'allowScriptAccess','sameDomain',
'movie', 'test',
'salign', 'l'
); //end AC code
</script>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="100%" height="100%" id="test" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="test.swf" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param name="salign" value="l" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /> <embed src="test.swf" quality="high" scale="noscale" salign="l" wmode="transparent" bgcolor="#ffffff" width="100%" height="100%" name="test" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
Copy link to clipboard
Copied
what's the url of your embedding html?
Copy link to clipboard
Copied
Kglad,
I'm not sure what you mean by URL
when I publish the SWF..it outputs the html file as well..I was viewing it from my hard drive.
hope that answers your question.
Copy link to clipboard
Copied
Okay I found somewhat of a solution...
by using a
stage.addEventListener(MouseEvent.MOUSE_OVER, onOver);
and then my function
and then create another event listener inside the function such as
stage.addEventListener(MouseEvent.MOUSE_WHEEL, onWheel);
and you can't be in transparent mode either. You have to be in 'window mode'
but then the problems becomes if your browser ends up having a vertical scroll bar.
then the Mouse Wheel controls both the browser and the flash scroll bar.
I'll get back with you guys if I find a solution to this too.
Copy link to clipboard
Copied
Okay
here is the other half of the solution
it worked so far
http://www.spikything.com/blog/index.php/2009/11/27/stop-simultaneous-flash-browser-scrolling/
Find more inspiration, events, and resources on the new Adobe Community
Explore Now