{"id":310,"date":"2008-06-08T17:07:31","date_gmt":"2008-06-08T15:07:31","guid":{"rendered":"http:\/\/www.nivas.hr\/blog\/?p=310"},"modified":"2008-06-08T17:07:31","modified_gmt":"2008-06-08T15:07:31","slug":"freaky-fscommand-issues-in-flash-player-9-and-as2-project","status":"publish","type":"post","link":"https:\/\/www.nivas.hr\/blog\/2008\/06\/08\/freaky-fscommand-issues-in-flash-player-9-and-as2-project\/","title":{"rendered":"Freaky fscommand issues in Flash Player 9 and as2 project"},"content":{"rendered":"<p>I spent couple of hours trying to figure this one out, so at the end of my thorny journey I decided to share this with all of you. <\/p>\n<p>I have a lot of old standalone projector AS2 Flash 8 projects. Each one begins with fscommands that switch player to fullscreen and setup rest of the stuff.<br \/>\n[ftf w=&#8221;480&#8243; h=&#8221;250&#8243;]fscommand(&#8220;allowscale&#8221;,&#8221;false&#8221;);<br \/>\nfscommand(&#8220;fullscreen&#8221;, &#8220;true&#8221;);<br \/>\nfscommand(&#8220;trapallkeys&#8221;, &#8220;true&#8221;);<br \/>\nfscommand (&#8220;showmenu&#8221;, &#8220;false&#8221;);<\/p>\n<p>escKey = {};<br \/>\nescKey.onKeyDown = function(){<br \/>\n\tif(Key.getCode() == Key.ESCAPE){<br \/>\n\t\tfscommand(&#8220;quit&#8221;, &#8220;&#8221;);<br \/>\n\t}<br \/>\n};<br \/>\nKey.addListener(escKey);<br \/>\nfscommand(&#8220;trapallkeys&#8221;, &#8220;true&#8221;);[\/ftf]<br \/>\nWell, that worked just fine before Flash 9. But today I had to build a simple AS2 game and wanted to do the same &#8211; upon starting, goto fullscreen, send all key events&#8230; Upon publishing, my game didn&#8217;t want to go to fullscreen. To make things even more stranger &#8211; not even pressing CTRL+F didn&#8217;t switch to fullscreen! As it turned out, <\/p>\n<pre>fscommand(\"trapallkeys\", \"true\");<\/pre>\n<p> was causing problems. After commenting that line out everything worked fine&#8230; except capturing of key events &#8211; a major factor to my game.<\/p>\n<p>But, BEHOLD! Few hours later, a magical combination of TRUE, true, and false, FALSEs, finally worked out:<br \/>\n[ftf w=&#8221;480&#8243; h=&#8221;120&#8243;]fscommand(&#8220;allowscale&#8221;,&#8221;FALSE&#8221;);<br \/>\nfscommand(&#8220;fullscreen&#8221;, &#8220;TRUE&#8221;);<br \/>\nfscommand (&#8220;showmenu&#8221;, &#8220;false&#8221;);<br \/>\nfscommand(&#8220;trapallkeys&#8221;, &#8220;true&#8221;); [\/ftf]<\/p>\n<p>Why is this happening, I don&#8217;t, but I am glad I made it work. More people reported similar problems with fscommand in Flash 9:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.northcode.com\/blog.php\/2007\/09\/11\/FSCommand-and-getURL-Bug-in-Flash-Player-9\">FSCommand and getURL Bug in Flash Player 9 &#8211; Northcode Inc.<\/a><\/li>\n<li><a href=\"http:\/\/www.northcode.com\/blog.php\/2007\/08\/14\/FSCommand-EXEC-is-Broken-in-Flash-CS3\">FSCommand EXEC is Broken in Flash CS3 &#8211; Northcode Inc.<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I spent couple of hours trying to figure this one out, so at the end of my thorny journey I decided to share this with all of you. I have a lot of old standalone projector AS2 Flash 8 projects. Each one begins with fscommands that switch player to fullscreen and setup rest of the&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/310"}],"collection":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/comments?post=310"}],"version-history":[{"count":0,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/310\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/media?parent=310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/categories?post=310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/tags?post=310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}