Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problem after exit full screen mode

New Here ,
Mar 20, 2015 Mar 20, 2015

hi all

i have a simple actionscript project in the fb4.7,Just a simple animated movie clip is loaded into the stage,It runs good start,But run the following code, switching from full-screen mode back to normal mode, the frame rate dropped from 60 to 20.

if(stage.displayState == StageDisplayState.FULL_SCREEN_INTERACTIVE){

  stage.displayState = StageDisplayState.NORMAL;

}else{

  stage.fullScreenSourceRect = new Rectangle(0,0,stage.fullScreenWidth,stage.fullScreenHeight);

  stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

}

This only appears under wmode = 'direct'

This problem has troubled me for a long time,help.....

thanks

TOPICS
ActionScript
523
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2015 Mar 20, 2015

there's nothing there causing the problem.

use scout to profile your flash player's performance.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 20, 2015 Mar 20, 2015

hi kglad.thank you for your reply.

but my project is very simple,just some animated movieclip made in flash with no code,and load the swf into the stage.see the following picture

at the beginning

beginning.jpg

full-screen

fullscreen.jpg

back to normal

out fullscreen.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 20, 2015 Mar 20, 2015

when the frame rate droped to 20,the cpu usage does not exceed five percent

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2015 Mar 21, 2015

here's an excerpt from a book i published last year (Flash Game Development: In a Social, Mobile and 3D World).

Optimization Techniques

Unfortunately, I know of no completely satisfactory way to organize this information. In what follows, I discuss memory management first with sub-topics listed in alphabetical order. Then I discuss CPU/GPU management with sub-topics listed in alphabetical order.

That may seem logical but there are, at least, two problems with that organization.

  1. I do not believe it is the most helpful way to organize this information.
  2. Memory management affects CPU/GPU usage, so everything in the Memory Management section could also be listed in the CPU/GPU section.

Anyway, I am going to also list the information two other ways, from easiest to hardest to implement and from greatest to least benefit.

Both of those later listings are subjective and are dependent on developer experience and capabilities, as well as, the test situation and test environment. I very much doubt there would be a consensus on ordering of these lists.  Nevertheless, I think they still are worthwhile.

Easiest to Hardest to Implement

  1. Do not use Filters.
  2. Always use reverse for-loops and avoid do-loops and avoid while-loops.
  3. Explicitly stop Timers to ready them for gc (garbage collection).
  4. Use weak event listeners and remove listeners.
  5. Strictly type variables whenever possible.
  6. Explicitly disable mouse interactivity when mouse interactivity not needed.
  7. Replace dispatchEvents with callback functions whenever possible.
  8. Stop Sounds to enable Sounds and SoundChannels to be gc'd.
  9. Use the most basic DisplayObject needed.
  10. Always use cacheAsBitmap and cacheAsBitmapMatrix with air apps (i.e., mobile devices).
  11. Reuse Objects whenever possible.
  12. Event.ENTER_FRAME loops: Use different listeners and different listener functions applied to as few DisplayObjects as possible.
  13. Pool Objects instead of creating and gc'ing Objects.
  14. Use partial blitting.
  15. Use stage blitting.
  16. Use Stage3D.

Greatest to Least Benefit

  1. Use stage blitting (if there is enough system memory).
  2. Use Stage3D.
  3. Use partial blitting.
  4. Use cacheAsBitmap and cacheAsBitmapMatrix with mobile devices.
  5. Explicitly disable mouse interactivity when mouse interactivity not needed.
  6. Do not use Filters.
  7. Use the most basic DisplayObject needed.
  8. Reuse Objects whenever possible.
  9. Event.ENTER_FRAME loops: Use different listeners and different listener functions applied to as few DisplayObjects as possible.
  10. Use reverse for-loops and avoid do-loops and while-loops.
  11. Pool Objects instead of creating and gc'ing Objects.
  12. Strictly type variables whenever possible.
  13. Use weak event listeners and remove listeners.
  14. Replace dispatchEvents with callback functions whenever possible.
  15. Explicitly stop Timers to ready for gc.
  16. Stop Sounds to enable Sounds and SoundChannels to be gc'd.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2015 Mar 21, 2015

hi kglad,maybe I did not clearly described

step 1:run the project at normal-win mode,5 minutes later,the frame rate steady at 60 as well

step 2:click a button,call stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE to enter fullscreen mode,5 minutes later,the frame rate steady at 60 too

step 3:press ESC to exit fullscreen mode back to normal mode,the frame rate drop to 20

step 4:click the button to enter fullscreen mode again,the frame rate go back to 60 again.....

why at step.1 and step.4 the frame rate is good if there is some problem in my code

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2015 Mar 21, 2015

there are many possible reasons causing poor performance.  from you description you have none of them so your performance must be no different before and after going fullscreen.

but it's not.

so you need to start analyzing the problem.  i've given you all the help that can be given via a forum.  further help would require someone to download your fla and analyze the problem for you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 21, 2015 Mar 21, 2015

hi kglad,thank you for your patience.

i don't know how to add attachments,so there is my project source code here,which bulid in FB4.7,run debug mode,then click the stage enter fullscreen,then you can see the problem

thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2015 Mar 22, 2015
LATEST

i only offer free help via the forums, and don't download and correct files unless i'm hired.

someone else may do that however so if there's no rush, you may want to wait.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines