Freaky fscommand issues in Flash Player 9 and as2 project
Posted by seven
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 stuff.
fscommand("allowscale","false");
fscommand("fullscreen", "true");
fscommand("trapallkeys", "true");
fscommand ("showmenu", "false");
escKey = {};
escKey.onKeyDown = function(){
if(Key.getCode() == Key.ESCAPE){
fscommand("quit", "");
}
};
Key.addListener(escKey);
fscommand("trapallkeys", "true");Well, that worked just fine before Flash 9. But today I had to build a simple AS2 game and wanted to do the same - upon starting, goto fullscreen, send all key events... Upon publishing, my game didn't want to go to fullscreen. To make things even more stranger - not even pressing CTRL+F didn't switch to fullscreen! As it turned out,
fscommand("trapallkeys", "true");
was causing problems. After commenting that line out everything worked fine... except capturing of key events - a major factor to my game.
But, BEHOLD! Few hours later, a magical combination of TRUE, true, and false, FALSEs, finally worked out:
fscommand("allowscale","FALSE");
fscommand("fullscreen", "TRUE");
fscommand ("showmenu", "false");
fscommand("trapallkeys", "true"); Why is this happening, I don't, but I am glad I made it work. More people reported similar problems with fscommand in Flash 9:










June 16th, 2010 at 13:28
thanks man,..