actionscript 3 - Flash Stage Losing Focus -
I created this incredible spectacular scrolling thumbnail image viewer for the client in Flash ActionCapt 3. (Basically it only depends on the scroll up or down position of the mouse) It works so much (I can never get the percent correct, so that it can show the image at the top), but next to the point Is it really bothering me when I have my .swf open with a loaded browser window and I click on any other app on my desktop, stupid scrolling in the browser window Bnel the field starts to waste.
"Where is my mouse ??!?!?!?!" I think this is thinking.
Is there a platform? Can I tell my scrolling thumbnail area with STFU?
I also write some javascript to have a flash function, if this is a favorite technique thanks in advance.
Function Checkmospose (E: Event): Zero {if (mouseX> 145) {try {var sHeight: int = MovieClip (root) .stageHeight; } Hold (error) {trace ("phase not loaded"); } If (Mouse U & G; (SHHET / 2) + 100) {if (tHolder.y-50> gt; - (Comp-High-Wait)} {TVRatTV (THD, {Y: THD. I-90, Time: 1, Infection: "easeOutCubic"}); }} And if (mouse / u) - 100) {if (tHolder.y + 50 <80) {Tweener.addTween (tHolder, {y: tHolder.y + 90, time: 1) , Infection: "easeOutCubic"}); } Other {Tweener.addTween (tHolder, {y: 80, time: 1, transition: "resting otubebic"}); }}}}
-J
Window focus event sender and offoc () in javascript then sends a capable / inactive call to send the SWF file using ExtinInterFactory (). So inside your HTML you can do something like this (Swfobject thought here, but it is not necessary):
swfobject.embedSWF ("mySWF", "mySWF", "mySWFId", SWFWidth, swfHeight, "10.0.0", "", flashwars, parameters, attributes); Window.onblur = function (if {document.getElementById ("mySWFId"). DisableMouseScrolling) {document.getElementById ("mySWFId"). DisableMouseScrolling (); }} Window.onfocus = function () {if (document.getElementById ("mySWFId"). EnableMouseScrolling) {document.getElementById ("mySWFId"). EnableMouseScrolling (); }}
And to hook up the methods inside your SWF file, enter some equivalent external interface code:
Public class appears to be MyApication. .. {Public Function MyApplication (): Zero {ExternalInterface.addClallback ("disabled mousscrolling", disable mouse scrolling); ExternalInterface.addClallback ("disabled mousscrolling", enableMouseScrolling); ...} Disable Private Function Mouse Scrolling (): Zero {} Personal Function enableMouseScrolling (): Zero {} ...}
Hope this helps I get it IE8, Firefox Used with 3 and Crom 4.
Regards,
Comments
Post a Comment