User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: SWF losing focus problem

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    SWF losing focus problem

    I have been trying to use the "Application has input focus" condition to pause my game when the application loses focus.

    I have a condition that says:

    +(NEGATE)Application has Input Focus
    + Only one action when event loops
    - (Run Pause game code)

    For some reason, when the frame loads initially, this code runs and the game pauses. But if I remove the negate, then the code doesn't run. I have a feeling the condition is doing the opposite of what it is supposed to. Or does the application not have focus at the start of frame?

  2. #2
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    2,996
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Re: SWF losing focus problem

    I believe that the .swf doesn't have the focus at the beginning, that's probably why the MMF generated HTML file says "MMF Flash Application. Click on the Application to set the focus.".

    I have reported this not so long ago:
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=245676#Post2456 76

  3. #3
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)

    Re: SWF losing focus problem

    I was trying some javascript to give SWF files focus when a page loaded but I got tired of browsers all being different.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Re: SWF losing focus problem

    The confusing thing here is that the code that looks for this condition is not the initial frame. I have a title screen frame that loads before it and requires a mouse click or keyboard button press to load the game frame. So, the game frame only loads based on the swf having focus (since you can't start the game frame without some input). It seems odd that the focus would be reset to false at the start of every frame, no?

    Is there some workaround that someone can suggest so that the condition check is ignored for one frame at the start of frame? Or can I force focus somehow?

  5. #5
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    2,996
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Re: SWF losing focus problem

    I can confirm the problem described by mobichan. I have a similar setup, a game with first a main menu where you have to click to play, and then a level where I test if the application has the focus, if not activate pause.
    Sometimes the pause activates right at the beginning of the level, yet I have clicked in the game window at least once.

    This doesn't happen everytime though. I can't tell why it happens but I was about to remove the code (since I am ).

    I am sure that it happens offline when I build/launch the app from MMF. But I have yet to make sure that it happens online on a server/webpage.

    Also I wonder if another (control?) object contained in the application could "steal" the focus of the application?

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Re: SWF losing focus problem

    I am also noticing that different browsers return focus differently when the swf page is loaded. Firefox seems to register the app is focused when it loads the page, but IE loads the swf page unfocused. T_T

    Also, running in debug has the annoying issue of focus being lost when you click on the debugger. Not sure if there is a workaround for this, but it usually means I have to disable all the focus related code when testing the game. And I need to build and run the swf when I want to really test this functionality.


  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,729
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: SWF losing focus problem

    My IE9 registers focused upon loading.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Re: SWF losing focus problem

    So, I am running into another focus issue, where having a button seems to be messing up the swf focus. I have a button that is created at runtime and I can not press it for some reason. It never registers a press. What is odd is that it only has this problem on the frame with the flash object in it. Other frames with no Flash object have working buttons.

    I swear this button worked for a long time, but as of today, it seems to be unclickable. Any ideas?

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: SWF losing focus problem

    Curiously enough, I've had a similar problem. Mine seemed to be a side effect of the Sandy3D object.

    My only workaround was to make the button an active.

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,281
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Re: SWF losing focus problem

    Thanks RickyRombo. I was afraid of that, but at least it isn't hard to convert it. I just need to adjust all my "On button clicked" code. T_T

    If this is a bug, hopefully it can be fixed in the future.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Problem with hero losing lives
    By calvinsabamf in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 1st November 2012, 02:17 PM
  2. Big focus problem
    By PandaExplosion in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 10th June 2011, 09:15 PM
  3. Please Help! Losing Mind, Parsing Question.
    By MikeB in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 6th May 2009, 02:29 AM
  4. active Objects losing data
    By Mazeman in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 25th November 2008, 05:32 PM
  5. Losing header bug?
    By Clicktastic in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 8th August 2006, 02:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •