{"id":15,"date":"2008-06-16T16:54:23","date_gmt":"2008-06-16T23:54:23","guid":{"rendered":"http:\/\/www.nayansavla.com\/blog\/?p=15"},"modified":"2008-06-16T16:55:41","modified_gmt":"2008-06-16T23:55:41","slug":"flexflash-fullscreen-problems","status":"publish","type":"post","link":"https:\/\/www.nayansavla.com\/blog\/?p=15","title":{"rendered":"Flex\/Flash Fullscreen problems"},"content":{"rendered":"<p>I have been playing with Fullscreen mode of Flash in Flex and had this annoying problem.<\/p>\n<p>My listener is setup,<\/p>\n<div class=\"codecolorer-container actionscript default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"actionscript codecolorer\">Application.<span class=\"me1\">application<\/span>.<span class=\"kw3\">stage<\/span>.<span class=\"me1\">addEventListener<\/span><span class=\"br0\">&#40;<\/span>Event.<span class=\"me1\">RESIZE<\/span>,stageResized<span class=\"br0\">&#41;<\/span>;<br \/>\n<br \/>\n<span class=\"kw3\">private<\/span> <span class=\"kw2\">function<\/span> stageResized<span class=\"br0\">&#40;<\/span>event:Event<span class=\"br0\">&#41;<\/span>:<span class=\"kw3\">void<\/span><span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; mx.<span class=\"me1\">controls<\/span>.<span class=\"me1\">Alert<\/span>.<span class=\"kw3\">show<\/span><span class=\"br0\">&#40;<\/span>Application.<span class=\"me1\">application<\/span>.<span class=\"kw3\">stage<\/span>.<span class=\"me1\">displayState<\/span><span class=\"br0\">&#41;<\/span>;<br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>and then I call the function which looks as follows,<\/p>\n<div class=\"codecolorer-container actionscript default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><div class=\"actionscript codecolorer\"><span class=\"kw3\">private<\/span> <span class=\"kw2\">function<\/span> fullScreenFunction<span class=\"br0\">&#40;<\/span>rect:Rectangle<span class=\"br0\">&#41;<\/span>:<span class=\"kw3\">void<\/span><span class=\"br0\">&#123;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span>Application.<span class=\"me1\">application<\/span>.<span class=\"kw3\">stage<\/span>.<span class=\"me1\">displayState<\/span> <span class=\"sy0\">!<\/span>= StageDisplayState.<span class=\"me1\">FULL_SCREEN<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#123;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Application.<span class=\"me1\">application<\/span>.<span class=\"kw3\">stage<\/span>.<span class=\"me1\">fullScreenSourceRect<\/span> = rect;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; Application.<span class=\"me1\">application<\/span>.<span class=\"kw3\">stage<\/span>.<span class=\"me1\">displayState<\/span> = StageDisplayState.<span class=\"me1\">FULL_SCREEN<\/span>;<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>Nothing wrong so far, the reason i am doing it this way is because i need to make different sections of Application full screen.<\/p>\n<p>This is the function call i make, my application is 1024&#215;768,<\/p>\n<div class=\"codecolorer-container actionscript default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"actionscript codecolorer\">fullScreenFunction<span class=\"br0\">&#40;<\/span><span class=\"kw2\">new<\/span> Rectangle<span class=\"br0\">&#40;<\/span><span class=\"nu0\">1<\/span>,<span class=\"nu0\">1<\/span>,<span class=\"nu0\">1022<\/span>,<span class=\"nu0\">766<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span>;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Above function call triggers the stageResized properly but,<\/p>\n<div class=\"codecolorer-container actionscript default\" style=\"overflow:auto;white-space:nowrap;width:435px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"actionscript codecolorer\">fullScreenFunction<span class=\"br0\">&#40;<\/span><span class=\"kw2\">new<\/span> Rectangle<span class=\"br0\">&#40;<\/span><span class=\"nu0\">0<\/span>,<span class=\"nu0\">0<\/span>,<span class=\"nu0\">1024<\/span>,<span class=\"nu0\">768<\/span><span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span>;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>doesn&#8217;t trigger the listener. <\/p>\n<p>I have no clue why it does that and also i haven&#8217;t bothered to find out because that one pixel isn&#8217;t that important to me. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have been playing with Fullscreen mode of Flash in Flex and had this annoying problem. My listener is setup, Application.application.stage.addEventListener&#40;Event.RESIZE,stageResized&#41;; private function stageResized&#40;event:Event&#41;:void&#123; &nbsp; &nbsp; mx.controls.Alert.show&#40;Application.application.stage.displayState&#41;; &#125; and then I call the function which looks as follows, private function fullScreenFunction&#40;rect:Rectangle&#41;:void&#123; &nbsp; &nbsp; if &#40;Application.application.stage.displayState != StageDisplayState.FULL_SCREEN&#41;&#123; &nbsp; &nbsp; &nbsp; &nbsp; Application.application.stage.fullScreenSourceRect = rect; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,3,7],"tags":[18,66,17],"class_list":["post-15","post","type-post","status-publish","format-standard","hentry","category-as-30","category-actionscript","category-flex","tag-flash","tag-flex","tag-full-screen"],"_links":{"self":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":0,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nayansavla.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}