Freaky fscommand issues in Flash Player 9 and as2 project

Author: seven June 8, 2008

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:

Author
seven
CEO/CTO at Nivas®
Neven Jacmenović has been passionately involved with computers since late 80s, the age of Atari and Commodore Amiga. As one of internet industry pioneers in Croatia, since 90s, he has been involved in making of many award winning, innovative and successful online project. He is experienced full stack web developer, analyst and system engineer. In his spare time, Neven is transforming retro-futuristic passion into various golang, Adobe Flash and JavaScript/WebGL projects.

    One thought on “Freaky fscommand issues in Flash Player 9 and as2 project”

  • Leave a Reply

    Your email address will not be published. Required fields are marked *