memory usage when removed from the scene

Hello

I was wondering what solution is best with regard to the use of the memory: to remove the component from the stage or to make null?

this.removeChild(myComponent);

or

this.myComponent = null;

I know that it depends on if I'm going to use this component in the future, and in my situation, the component will be used rarely.

Is a component that is removed from the scene, uses a lot of memory?

A component can use a bit less memory when not on stage.  If you come

set to null without removing from the scene that it won't change your memory usage to

all.  The only way to recover the memory is both out of the scene

and remove all other references to it.

Tags: Flex

Similar Questions

  • removeEventListener when removed from the scene?

    I'm sorry if this is a really basic question, but how d code as3 to remove an event listener when the current frame (in my case, the section of my site) is no longer on the scene?

    Consider the following code as an example:

    function onClick(event:MouseEvent):void

    {

    doSomething();

    }

    MC1.addEventListener (MouseEvent.CLICK, onClick);

    MC2.addEventListener (MouseEvent.CLICK, onClick);

    MC3.addEventListener (MouseEvent.CLICK, onClick);

    How I would remove these event listeners when the user leaves this section of the site?  Being limited in my knowledge in as3, all I can find is:

    function removeListeners(event:Event):void

    {

    MC1. RemoveEventListener (MouseEvent.CLICK, onClick);

    MC2. RemoveEventListener (MouseEvent.CLICK, onClick);

    MC3. RemoveEventListener (MouseEvent.CLICK, onClick);

    }

    parent_mc.addEventListener (Event.REMOVED_FROM_STAGE, removeListeners);

    where "parent_mc" is the main scenario for the section of the current Web site

    Of course, this isn't the right solution, because it makes no sense to add an event listener just to remove others.  In regard to best practices, how do I remove event listeners in the 'section' in which they are used is no more on the scene?

    use:

    function onClick(event:MouseEvent):void

    {

    doSomething();

    }

    MC1.addEventListener (MouseEvent.CLICK, onClick);

    MC2.addEventListener (MouseEvent.CLICK, onClick);

    MC3.addEventListener (MouseEvent.CLICK, onClick);

    function removeListeners(event:Event):void

    {

    MC1. RemoveEventListener (MouseEvent.CLICK, onClick);

    MC2. RemoveEventListener (MouseEvent.CLICK, onClick);

    MC3. RemoveEventListener (MouseEvent.CLICK, onClick);

    parent_mc. RemoveEventListener (Event.REMOVED_FROM_STAGE, removeListeners);

    MC1 = null;

    MC2 = null;

    MC3 = null;

    }

    parent_mc.addEventListener (Event.REMOVED_FROM_STAGE, removeListeners);

  • TypeError: Error #1006 - MovieClip to remove from the scene

    I have a clip that is called to the scene and when the movieclip is finished, it calls a function that removes from the scene. The code works, but I get an error message about 4 seconds after the music ends.

    Here is the error message:

    TypeError: Error #1006: exitWordMicroscopic is not a function.

    to ASvocabulary_microscopic / frame110 () [ASvocabulary_microscopic::frame110:1]

    Here's the code in step:

    Removes the movieclip on the stage and allows the highlight *.

    function exitWordMicroscopic (): void

    {

    bnt_vocab_microscopic.mouseEnabled = true;

    removeChild (word_Microscopic);

    }

    //******************************Stage buttons**************************************

    stage.addEventListener (MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);

    function goButtonsHomeRead_1(event:MouseEvent):void

    {

    Buttons of vocabulary

    If (event.target is bnt_vocab_microscopic)

    {

    bnt_vocab_microscopic.mouseEnabled = false;

    SoundMixer.stopAll ();

    addChild (word_Microscopic);

    word_Microscopic.x = 47;

    word_Microscopic.y = 120;

    }

    }

    Here is the code inside the clip. That's what the error message is referring to:

    Calls to withdraw from the scene function *.

    Object (parent) .exitWordMicroscopic ();

    What I am doing wrong?

    There is a more OOP good way to do this, but for now, you can use...

    Object (parent.parent) .exitWordMicroscopic ();

    function exitWordMicroscopic (): void

    {

    bnt_vocab_microscopic.mouseEnabled = true;

    mc_EmpytMovie_Micro.removeChild (word_Microscopic);

    }

  • Put automatically the laptop to sleep when removed from the base?

    Hello

    Many members of our society are using portable computers. However they all use docking stations when in the office. Nature from home they all simply press the eject button on the docking station and put the laptop in their bag. As you know that the laptop stays on since there is no action in the Power Options, simply what happens when "I close the lid.

    Some have killed cell phones in this process, it is recommended to put the computer to sleep manually start before removing from the dock menu and go about your day, but naturally not everyone follows this process.

    So is my question there a framework built in Windows 7 that will put the computer to sleep automatically in case the laptop lid is closed under power and is suddenly disconnected from the power?

    I have searched through ACPI configurations but came empty-handed.

    Any help would be appreciated!

    In addition, we are a boutique HP and use their cell phones of class business.

    I think that implementing standby when the lid is closed so that hip will probably solve it. Unfortunately I can't imagine a way to detect if it is not connected to the dock because as much as I know Windows doesn't support that.

    Apologies, I couldn't help-maybe someone knows if it is possible?

  • Enemies do not removed from the scene if clicked with the mouse.

    I encountered another problem, I wrote the code for when I click on an enemy, it does not add one point to the score and it does not remove the enemy, I have a textfield called messageDisplay which is linked to the clickEnemy function.

    Here is the piece of code.

    stage.addEventListener (MouseEvent.CLICK, clickEnemy);
    function clickEnemy(event:MouseEvent):void
    {
    If (Cursor.hitTestObject (enemyAppear))
    {
    Note ++
    messageDisplay.text = String (score);
    enemyAppear.parent.removeChild (enemyAppear);
    }
    }
    stage.removeEventListener (MouseEvent.CLICK, clickEnemy);

    Any help is appreciated, thanks Casey.

    you remove your click listener so that it never works.  Difficulty to fix your problem.

  • HP HDX 18 - Win 7 Home Premium (64-bit) CPU is palpable when the charger is removed from the laptop/notebook computer

    I currently have a problem where my CPU stands at 90% to 100% when the charger is removed from the laptop. He immediately rises despite no process running. When the charger is placed back in the CPU of the laptop is usually highest at 2%-5%.

    The operating system is Win 7 Home Premium (64-bit).

    Corrections or suggestions would be very appreciated.

    SOLVED

    Go to control panel > hardware and audio > power options > change settings > change advance power settings > managent processor power > political cooling system > set to battery for 'Active' option if it is selected as a liability.

    sas84_HeavyHitR wrote:

    I currently have a problem where my CPU stands at 90% to 100% when the charger is removed from the laptop. He immediately rises despite no process running. When the charger is placed back in the CPU of the laptop is usually highest at 2%-5%.

    The operating system is Win 7 Home Premium (64-bit).

    Corrections or suggestions would be very appreciated.

  • No not removed from the external interface access-list access list?

    PIX515

    customer wanted to modify the access list (add a new line)

    so he has first publish no access-list command can

    apply the change to the access list, but the access list has been

    removed from the interface outside

    is this a normal behavior? on routers access list stay connected

    for the event of the interface if you issue no access-list command

    Thanks in advance for any comments

    JYP

    Hi Thibault-

    No, it is not a normal behavior, sounds more like an error by the customer. It's always a good idea to copy the required ACL on a text editor (Notepad) do not forget to include "access-group command" i.e. "access-group interface inside inside' or 'access-group out in interface outside' - when copying the required ACL and then issues a 'no access-list inside' or 'no access-list outside' the first line in the ACL copied on your notebook before copy you it to the PIX , also make sure that you are using the config and make an "m wr" (write memory) after the ACL modified have been applied on the PIX.

    Hope this helps-

  • don't print from firefox, file is automatically removed from the queue

    I try to print from the web browser firefox or a pdf document and files will not be not print and are removed from the queue after about 30 seconds. I tried the browser google chrome and they print well from there. This problem just started today.

    Make sure that you do not print in a file selected and the correct printer is selected. You can see these settings in the "native print dialog" window when you do {Ctrl + P}.

  • all of my photos in icloud were removed from the restoration (and did not find the album recently removed to icloud)



    all of my photos in icloud were removed from the restoration (and did not find the album recently removed to icloud)

    The opposite happened to me - in the opposite direction! I found all my pictures from Nokia mobile in icloud on my iPad a few days ago, had no blue cogwheels devices! The two devices + home phone is all about wireless internet of the contract with ORANGE in Europe! They will not help,

    I think my router - put in place by an expatriate for me - is hacked because of the problem. I didn't ask him to change my contract or warn of my move when I did 2 years ago - but he went ahead and made Orange disclose no information telling me his "confidential".

  • Is it possible to have Txt Mssgs removed from the iWatch, during the deletion on the iPhone?

    Is it possible to have removed from the iWatch, txt mssgs once they have been deleted on the iPhone?

    Hello

    Delete the message is not synchronized on devices (and there is no way to enable this). Messages must on the contrary be deleted separately on each device (this is also how the app works through additional Apple devices, like a computer, iPad,...).

    The mirror that my iPhone for Apple Watch determines how you will be informed about new messages. If you choose custom, for example, you can decide if your watch watch alerts, audio or haptic alerts are provided and if (including the number of times), alerts are repeated when you receive new messages.

  • Como puedo restore my hotmail account * address email is removed from the privacy * send me information to * address email is removed from the privacy *.

    I'm looking for my account * address email is removed from the privacy *. I am well hard to start in my acount. Please send information to * address email is removed from the privacy *. Thnk you.

    Hotmail
    I'm looking for my account

    Unfortunately, this forum is not for Hotmail - they have a forum dedicated to issues where you will receive the best assistance. When you start a new thread on their forum, you can copy and paste your question above.

    Hotmail support:

    http://windowslivehelp.com/product.aspx?ProductID=1

  • want to cancel Windows Live; cannot get into my msn email account * address email is removed from the privacy *.

    I signed up for Windows live on Facebook. MY MISTAKE!   How can I cancel it?  I had my email account: * address email is removed from the privacy * for many years.  NOW I CAN'T ACCESS IT.    Now, he asks me my password which I do not remember.  When I press the line (do not remember the password), he asks security question "what is the name of your favorite pet" that I have NEVER BEEN ASKED.  Then he said: I'm wrong.  WHEN YOU SAY YOU EMAIL, THE ANSWER WILL REMEMBER, I CAN'T ACCESS MY MSN ACCOUNT.

    I want to just my old e-mail account back and none of the Windows Live JUNK!

    I'm about to switch to Gmail.

    Hello

    You must include other information such as the make and model of the computer, the mail provider
    (Hotmail or WLM - probably Hotmail since you said MSN) and other relevant information.

    How to ask a question
    http://support.Microsoft.com/kb/555375

    =================================

    Answers is a peer group supported and unfortunately has no real influence on Hotmail or MSN.

    HotMail has its own Forums, so you can ask your questions there.

    Windows Live Solution Center - HotMail - HotMail Forums Solutions
    http://windowslivehelp.com/
    Hotmail - Forums
    http://windowslivehelp.com/forums.aspx?ProductID=1

    Hotmail - Solutions
    http://windowslivehelp.com/solutions.aspx?ProductID=1

    How to contact Windows Live Hotmail Support
    http://email.about.com/od/hotmailtips/Qt/et_hotmail_supp.htm

    Windows Live Hotmail Top issues and Support information
    http://support.Microsoft.com/kb/316659/en-us

    Compromised account - access unauthorized account - how to recover your account
    http://windowslivehelp.com/solution.aspx?SolutionID=6ea0c7b3-1473-4176-b03f-145b951dcb41

    Hotmail hacked? Take these steps
    http://blogs.msdn.com/b/securitytipstalk/archive/2010/07/07/Hotmail-hacked-take-these-steps.aspx

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • The ethernet adapter has been removed from the program. How to restore the adapter ethernet to the program?

    Ethernet adapter - deleted.

    the ethernet adapter has been removed from the program.  How to restore the adapter ethernet to the program?

    Thank you

    Ed

    Hi Ed,

    When you deleted the program, program who are you referring?

    You can try to perform a system restore and see if it helps.

    You can try to perform a restore of the system to a prior restore point you have been affected by the issue.

    Note: When you perform the system restore to restore the computer to a previous state, programs and updates that you have installed are removed.

    To run the system restore, you can consult the following link:

    How to restore Windows XP to a previous state

  • restiore audio sound-Email to * address email is removed from the privacy * goes looking for answers

    Restore the email sounds Audio response to-* address email is removed from the privacy *.

    Hello

    · Were there any changes made on the computer before the show?

    · You receive an error message or error code when you play sounds on the computer?

    You can try the steps listed in the link: no sound in Windows: http://windows.microsoft.com/en-US/windows/help/no-sound-in-windows

  • I've been locked out my email is a temporary to return to me email * address email is removed from the privacy *.

    I've been locked out my e mail * address email is removed from the privacy * I tried resetting my password twice please help me I need my email back, I made a temporary email, so you could get back to me it's * address email is removed from the privacy *.  Also on this page only when I try to type the at sign in an e-mail address, it comes out like that "instead of one with the circle around it so if using my address please put a one with the circle around it where theres a". Thank you

    Hello

    I'm sorry, but we cannot help with hotmail problems in these forums in response to vista

    Please repost your question in hotmail in the hotmail link below forums

    http://windowslivehelp.com/product.aspx?ProductID=1

Maybe you are looking for