{"id":842,"date":"2009-03-31T08:00:46","date_gmt":"2009-03-31T13:00:46","guid":{"rendered":"http:\/\/www.pixelwit.com\/blog\/?p=842"},"modified":"2009-08-15T20:09:07","modified_gmt":"2009-08-16T01:09:07","slug":"fullscreen-onmousemove-bug","status":"publish","type":"post","link":"https:\/\/www.pixelwit.com\/blog\/2009\/03\/31\/fullscreen-onmousemove-bug\/","title":{"rendered":"FullScreen OnMouseMove Bug"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.pixelwit.com\/blog\/wp-content\/uploads\/2009\/03\/stinkbug.jpg\" alt=\"stinkbug\" title=\"stinkbug\" width=\"100\" height=\"100\" class=\"alignleft size-full wp-image-848\" \/>Here&#8217;s an interesting fact: Going to FullScreen mode causes Flash to temporarily stop executing all onMouseMove events.<\/p>\n<p>I&#8217;m sure if someone from Adobe was pressed hard enough they might be able to provide some convoluted ~logical~ reasons why going into full-screen mode stops all onMouseMove events but I&#8217;m not buying it.  I wasted a few frustrating hours figuring this out and when I searched the web to confirm my suspicions I found no mention of this &#8220;feature&#8221; so I&#8217;m calling it what it is, a BUG.  <\/p>\n<p>Here, take a look at this ugly SWF (move your mouse around to draw a line whenever the OnMouseMove event is fired and then press the blue square to toggle fullScreen mode)<!--more-->.  All mouseEvents are halted until the &#8220;Press Esc to exit full screen mode&#8221; message fades out.<\/p>\n<div id=\"so_targ_fullscreenmousemove_01_1997084118\" class=\"flashmovie\">\n<p><a href=\"http:\/\/get.adobe.com\/flashplayer\/\"><img decoding=\"async\" src=\"https:\/\/www.adobe.com\/images\/shared\/download_buttons\/get_flash_player.gif\" alt=\"Get Adobe Flash player\" \/><\/a><\/p>\n<\/div>\n<p>This is all of the code used to create the above SWF:<\/p>\n<div class=\"codecolorer-container actionscript default\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><div class=\"actionscript codecolorer\"><span class=\"co1\">\/\/<\/span><br \/>\n<span class=\"co1\">\/\/<\/span><br \/>\n<span class=\"kw2\">function<\/span> toggleFullScreen<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">if<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw3\">Stage<\/span><span class=\"br0\">&#91;<\/span><span class=\"st0\">&quot;displayState&quot;<\/span><span class=\"br0\">&#93;<\/span> == <span class=\"st0\">&quot;fullScreen&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">Stage<\/span><span class=\"br0\">&#91;<\/span><span class=\"st0\">&quot;displayState&quot;<\/span><span class=\"br0\">&#93;<\/span> = <span class=\"st0\">&quot;normal&quot;<\/span>;<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><span class=\"kw1\">else<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw3\">Stage<\/span><span class=\"br0\">&#91;<\/span><span class=\"st0\">&quot;displayState&quot;<\/span><span class=\"br0\">&#93;<\/span> = <span class=\"st0\">&quot;fullScreen&quot;<\/span>;<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"co1\">\/\/<\/span><br \/>\n<span class=\"co1\">\/\/<\/span><br \/>\n<span class=\"kw3\">createEmptyMovieClip<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Box&quot;<\/span>, <span class=\"nu0\">10<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n<span class=\"kw3\">with<\/span><span class=\"br0\">&#40;<\/span>Box<span class=\"br0\">&#41;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw3\">beginFill<\/span><span class=\"br0\">&#40;<\/span>0x4080AA<span class=\"br0\">&#41;<\/span>;<br \/>\n&nbsp; &nbsp; <span class=\"kw3\">lineTo<\/span><span class=\"br0\">&#40;<\/span><span class=\"nu0\">50<\/span>, <span class=\"nu0\">0<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n&nbsp; &nbsp; <span class=\"kw3\">lineTo<\/span><span class=\"br0\">&#40;<\/span><span class=\"nu0\">50<\/span>, <span class=\"nu0\">50<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n&nbsp; &nbsp; <span class=\"kw3\">lineTo<\/span><span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span>, <span class=\"nu0\">50<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n&nbsp; &nbsp; <span class=\"kw3\">lineTo<\/span><span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span>, <span class=\"nu0\">0<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\nBox.<span class=\"kw3\">onPress<\/span> = toggleFullScreen;<br \/>\n<span class=\"co1\">\/\/<\/span><br \/>\n<span class=\"co1\">\/\/<\/span><br \/>\n<span class=\"kw3\">lineStyle<\/span><span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n<span class=\"kw3\">onMouseMove<\/span> = <span class=\"kw2\">function<\/span> <span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw3\">lineTo<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw3\">_xmouse<\/span>, <span class=\"kw3\">_ymouse<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n<span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"co1\">\/\/<\/span><br \/>\n<span class=\"co1\">\/\/<\/span><\/div><\/div>\n<p>If you think you know why Flash temporarily halts onMouseMove events while displaying the &#8220;Press Esc&#8221; message I&#8217;d love to hear it.  Until Adobe fixes this you should use an OnEnterFrame event or SetInterval to get around this particular bug when going full-screen in Flash.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Going to FullScreen mode causes Flash to temporarily stop executing all onMouseMove events.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[8],"tags":[23,28,49,42,37],"class_list":["post-842","post","type-post","status-publish","format-standard","hentry","category-flash","tag-actionscript","tag-adobe","tag-bug","tag-code","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/posts\/842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/comments?post=842"}],"version-history":[{"count":0,"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/posts\/842\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/media?parent=842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/categories?post=842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pixelwit.com\/blog\/wp-json\/wp\/v2\/tags?post=842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}