Flash work slow when the page is in background of browser

I'm developing a game during which a clock which states that every three seconds a soldier will be added to the screen , and another clock that moves the soldier from the left to the right side of screen every 20 milliseconds .
Everything works correctly, until the game rises locate the air. If the user chooses to leave the game for a few minutes and messing with another page in browser , the watches of the Flash game starts to work very slow , which is why the soldiers are moving at low speed and thus accumulate masses of soldiers on screen, while they were supposed to be gone long .
I'm trying to create a " self timer " , instead of dealing with flash clock ( Timer ) , but I got involved with recursion fills the cartridge and creates StackOverFlow error.
I can not use the event Event.ENTER_FRAME etc. , because also this event work slow when the game is in the background
What to do ? Who can help me?

Thank you!
I solved it, similar to what you suggested, through the ACTIVATE event is linked to the stage.  That:
                    private function stageDeactivate(e:Event)
                              if (stage != null)
                                        stage.removeEventListener(Event.DEACTIVATE, stageDeactivate);
                                        stage.addEventListener(Event.ACTIVATE, stageActivate);
                                        stopSoldiers();
                    private function stageActivate(e:Event)
                              if (stage != null)
                                        stage.removeEventListener(Event.ACTIVATE, stageActivate);
                                        stage.addEventListener(Event.DEACTIVATE, stageDeactivate);
                                        playSoldiers();

Similar Messages

  • Using NetConnection not working .pause when the page changes (Is this a FLASH PLAYER PROBLEM?)

    I am having trouble troubleshooting my interactive USB.
    Here it goes:
    (1) I have 5 buttons which are dynamically loaded
    (2) With the 5 buttons, I have 5 change-page. On my 4th and 5th buttons, this is where my NetConnection is placed. Below is my code on page 4.
    var connection:NetConnection = new NetConnection();
    var stream:NetStream;
    var video:Video = new Video(470,376);
    var metaObj:Object = new Object();
    function onMetaData1(data:Object):void
    connection.connect(null);
    stream = new NetStream(connection);
    stream.client = metaObj;
    metaObj.onMetaData = onMetaData1;
    video.attachNetStream(stream);
    addChild(video);
    stream.play("video/FILM_4.f4v");
    stream2.pause();
    (3) Now, when I try publishing it in .exe file, the videos added are working fine. The problem is when go to page 1,2,3,5 it changes the page but the audio sometimes stop and sometimes not.

    Hi Ysong,
    Please try posting your question to the ActionScript 3 forum: http://forums.adobe.com/community/flash/flash_actionscript3. It's the most appropriate forum for your question. You might also try the forums for Flash, Flash Builder, or Flex, depending on the authoring environment you are using to write your ActionScript code.
    Thanks,
    KALTechWriter

  • I created a word document with hyperlinks. When my default browser is Chrome the hyper links work. When the default browser is Safari, the hyperlinks bring to pages that just lines and lines of symbols. I need these links to work in both browsers.

    I created a word document with hyperlinks. When my default browser is Chrome the hyper links work. When the default browser is Safari, the hyperlinks bring to pages that just lines and lines of symbols. I need these links to work in both browsers. Any ideas?

    version 10.6.8

  • Cascading LOV not working when the page is public

    Hi ,
    I have a cascading LOV in a tabular form which I have built using Denes Kubicek example from
    http://apex.oracle.com/pls/otn/f?p=31517:176:2702932664861989:::::
    Thanks to this wonderful examle I was able to make my cascading lov work.
    However when I make the page public , the second lov(which is based on the first one) does not work.
    Inorder to debug i changed get.get('XML') to get.get() and put an alert on it; to check if the select list string is being returned correctly by the application process - it returns null. The same alert returns the select list string when I put the authentication back on the page.
    Also I noticed when the page is public the application item (TAB_CASCADING_ITEM) is not getting populated with the value of the first select list.
    has anybody encountered the same issue ?
    Appreciate any suggestions?
    Thanks,
    Dippy

    One of the parameters in the htmldb_get is the page the process runs on. You should change that to the current page or make page 0 public as well.

  • How do I stop a query from running when the page is loaded

    Hi All,
    I'm using JDeveloper 10.1.3.4. I have a JSPX page that is used to collect search parameters and then when a button is clicked uses those values to run a query and then populate a table on the same page. The problem is that when the page is loaded the system attempts to run the query. The query is a method in a session bean. I can keep the method from running the query code by wrapping it in an 'if' statement and checking the parameters for null (or other value). Once the parameters are collected the query is invoked but it looks like the method is running twice, once with the parameters (here I've checked that the result actually has rows in the list) and then again where the parameters are null and the method returns null.
    What is the best way to do what I want here? From the buttons action method I am called the session beam method and returning null to stay on the same page. I think that is why the method is running the second time and returning null.
    TIA,
    Dave

    Have a look at these screen casts from Steve Muench and see if one of these techniques works for you, or gives you the clue you need.
    Creating Three Simple Search Pages with ADF Business Components and ADF Faces (JSF)
    Part 1: Web-Style Search Form
    Part 2: Oracle Forms-Style EnterQuery/ExecuteQuery Mode Page
    Part 3: Search Form Using View Object with Named Bind Parameters
    I had trouble viewing these with Firefox, but they worked in Internet Explorer.

  • How do I invoke an ActionListener on a page when the page initially loads?

    How do I invoke an ActionListener on a page when the page initially loads?
    Page 1: A user clicks on a h:commandButton and is navigated to Page 2.
    Page 2: When the page loads and goes through RESTORE_VIEW, APPLY_REQUESTS and RENDER_RESPONSE, I need to call an ActionListener in the managed bean for Page 2.
    However, if the user comes in from any other page than Page 1, the ActionListener cannot be invoked intially when the page loads. The user has a choice to click on the h:commandButton on Page2 to invoke the ActionListener.
    What is an example of invoking a method with the ActionListener signature in Java code?
    Where would I put the code to invoke the ActionListener, in a beforePhase or afterPhase, constructor?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Interesting. You're right. It doesn't happen when I click away from this site and then return. Maybe I'm barking up the wrong tree. Maybe it's the specific website I was thinking of and not Firefox. Unfortunately, I have to use that site all the time for work. I'll try contacting their webmaster. Thanks for your help.

  • My ipod is working slow when i type in something it just type too slow

    my ipod is working slow when i type in something it just type too slow

    Close apps in the multitasking bar.
    Restart/Reset/Restore your iPod.

  • Working in illustrator the page just shifts over or up for no apparent reason

    When I'm working in illustrator the page just shifts over or up for no apparent reason. It goes up, down to the left or right when
    I'm in the middle of working. I've been on the phone with the geek squad and they are not helpful at all.  Has this ever happened to anyone?
    Any idea why and how I can make it stop. It's so annoying and driving me crazy. Please advise it's beyond annoying.  Thanks!

    I think this has been brought up here a couple of times and IIRC always had sth. to do with a graphic tablet. Do you have one? And of course the usual stuff: system version, Illustrator version etc.

  • Oracle Discoverer very slow when switching page items

    Hi guys,
    I'm working on a report(Discoverer Plus) which returns some product information. Parameters are a product id or a product name.
    The report has three page items.(typically these would have between 3 and 10 entries in each).
    If I run the report for our busiest product id the report completes in about 5secs.
    If I then chose something from the page item the report can then take up to 20mins to complete, doesn't seem to matter what I pick.
    I notice that if I instead refresh the report and enter a product id with little data, change the page items there and then refresh and enter the the product id of our busiest product that the report will complete in about 5secss, returning the same data as the report that will take 20 mins.
    I am new to Discoverer and have discussed this with some colleagues but they are not sure, so I'm left scratching my head.
    So I'd appreciate any insight that peeps might have in to this.
    I would have thought that once I enter a product ID all data is returned from the DB and indexed for page items, I just can't see what Discoverer is doing for 20 odd mins.
    Yours confused!
    David

    Hi Rod,
    I had the Discovery admin check oem and he can see that when the page item is selected that the cpu is busy processing the data for the 15-20 mins, no additional call is made to the database.
    I installed Discovery Desktop today and the same report changes tabs almost instantaneously through it, so I'm left scratching my head.
    I do see occasional warnings about low heap memory on the AS but on Discovery Desktop with even a 15k memory cache the report only took a few seconds to switch pages.
    The admin has advised to raise an SR with Oracle but I'd be interested in any areas to check.
    Edited by: dobrien_ie on Jun 1, 2012 3:40 PM

  • Why the menu to move from one page to another is not seen when the page is online?

    On my web, I have different pages like 'Homepage' or 'Contact' but when I publish my web I can not see the menu.
    why the menu to move from one page to another is not seen when the page is online?
    Thank you,
    Roger.

    Where are you publishing and how are you uploading the files?

  • ADF how can i execute a query with parameters when the page renders

    hi
    i am using ADF web 11g
    i need to execute a query with parameters when the page renders
    thanks

    hello,
    I'm a fan of Java code, I really am.
    But when you use ADF, you decided to move to a more declarative environment.
    So why not do it declarative, the adf way?
    In your pagedef insert a action binding.
    This can be anything, a call to the application module, a call on the iterator(Like executeWithparams, etc.)
    Create an invokeAction in your pagedef and set the condition.
    This example refreshes(Action 2 is execute query) the data.
    First the method binding:
        <action IterBinding="PersoonIterator" id="Execute" InstanceName="LSAppModuleDataControl.Persoon"
                DataControl="LSAppModuleDataControl" RequiresUpdateModel="true" Action="2"/>And the invoke action
        <invokeAction Binds="Execute" id="refreshData"/>This always refreshes the data on page entry, but anything is possible, you can set condictions for the invokeAction.
    -Anton
    PS Yes I know that pagedefs become backing beans in the end and yes that is Java code, but if you wanna play the ADF way, the goal is the reduction of Java code and the increased performance of declarative programming.

  • Why is Fault Policy working only when the BPEL's transaction is requiresNew

    Hi All
    I've defined Fault policy & fault bindings files for faults in my BPEL process. I'm using Oracle SOA Suite 11g.
    But the fault management framework is properly working only when the transaction property(bpel.config.transaction) of the BPEL is set to "requiresNew" in composite.xml
    When i modify it ot required, its not working, i.e. it is waiting for some period and erroring out. I could not manage these errors from the EM as we do for those in Fault Management Framework.
    Why is this behavior?
    I went thru this article, but could not understand it
    Transaction and Fault Propagation Semantics in BPEL Processes(http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/soa_transactions.htm)
    Can someone pls explain this.
    Regards
    RaviKiran.

    Please refer http://docs.oracle.com/cd/E21764_01/integration.1111/e10224/soa_transactions.htm
    Thanks,
    S

  • My home button only works occasionally when the iPod is llocked, and not at all when unlocked. How can I fix this?

    I just got this iPod 36 hours ago, and it is already broken. I'm really frustrated because this is the fifth time a replacement device has broken right out of the box, and I have to reboot to switch between apps. once i get in an app, I'm stuck there. I think it's a software issue, because the home button works inconsistently when the device is locked. Please help ASAP!

    Hello,
    I am currently an owner of an Ipod Touch 4th generation. I see you are having problems with your Ipod Touch, so I will try to find a solution to your problem.
    Hold down the Sleep/Wake and Home buttons for at least 10sec. or until Apple logo appears (Nothing will be lost, this is just a "Hard Reset")
    Hope that helps!
    If none of the above solutions work, can you please respond back ASAP as I will try to find another solution to your problem (This might even help others with the same problem!)
    Cheers!
    Pizza98704

  • Which components of jsp are worked right before the page sent to server

    hello
    In a jsf application
    I want to know in java bean which components of jsp are worked right before the page sent to server.
    how can I do that ?
    regards

    So you want to know which component was activated to cause the request to be submitted. If you use an action listener, you will have the ActionEvent which contains the source component.

  • Fireforx cannot find web page when the page address is correct

    How do I solve the message that Firefox cannot find the page when the page address is correct?

    Do you want to do a Google search instead?
    You can check the <b>keyword.enabled</b> on the <b>about:config</b> page and if necessary then you can toggle this pref to true via a double-click.
    *https://support.mozilla.org/kb/Location+bar+search
    See also:
    *http://kb.mozillazine.org/Error_loading_websites

Maybe you are looking for

  • How to set up notification email for Full CPU utilization on OEM12c?

    I have found a Oracle Doc,Is that's the way email notifications are setup?How can i check that after setting the notifications? 4.1.2.3 Subscribe to Receive E-mail for Incident Rules An incident rule is a user-defined rule that specifies the criteria

  • Processo de autorização ficou sem acesso pelo autorizador e o usuario

    Grupo, Me defontrei com um problema de autorização. Aconteceu o seguinte: Criamos um processo de autorização para limite de crédito no pedido de venda. Um usuario tentou gerar um pedido que estourava o limite de um cliente e o sistema gerou a autoriz

  • In address book, display address or other columns

    I cannot figure out how to display additional fields/columns in address book. I can adjust size of existing fields but adding new fields is a puzzler.

  • Extracting Pages and Error Message

    My Adobe works great. I couldn't ask for a better product. However I have received a PDF file from a customer and I need to extract pages and insert them into another PDF. When I go to extract the pages I get an error message "Adobe Acrobat 9.0 has e

  • Problem connecting 2nd PC to DVI port on a L171p

    I have an IBM Thinkpad T60 plugged to a docking station and connected to my LCD via VGA connection. I want to connect a second workstation via the DVI port. I got an adapter to connect my DVI cable to my VGA on the 2nd system (Lenovo ThinkCentre) por