Good way to eliminate a display with the children & listeners object

It is my function that creates a display object with several children, one is an event listener.

function makeIt (): void {}

var spriteA:Sprite = new Sprite();

var spriteB:Sprite = new Sprite();

spriteB.addEventListener (MouseEvent.CLICK, myCallback);

var spriteC:Sprite = new Sprite();

spriteA.addChild (spriteB);

spriteB.addChild (spriteC);

stage.addChild (spriteA);

}

Let's say that I'm done with it. What is the right way to dispose of it so that it uses more memory? I do all this?

spriteB.removeChild (spriteC);

spriteB.removeEventListener (MouseEvent.CLICK, myCallback);

spriteA.removeChild (spriteB);

stage.removeChild (spriteA);

I read that some people say that you must also assign things to null, then maybe like this? :

spriteB.removeChild (spriteC);

spriteC = null;

spriteB.removeEventListener (MouseEvent.CLICK, myCallback);

spriteA.removeChild (spriteB);

spriteB = null;

stage.removeChild (spriteA);

spriteA = null;

And I have a few questions:

1. what happens if I just removeChild (spriteA) when I'm done with him and call makeIt() later when I need it? Are the same variables being reassigned, so there is no need to clean up after them?

2. If this display object will be frequently used and removed, would it be better to simply turn spriteA.visible?

Also, I am familiar with the weak event listeners, but I prefer not to use them.

removeChild is not deleting anything, whether it is simply detached from the display list... it could very well known as setting the visible property of the object to be both Visual false... the object is still there and can be targeted with the code in both cases.  If you want things get out and be ready for garbage collection, you must remove all references to them and objects Dummies.  If you know that an object is often reused so you probably want to go the road visible from true/false, although using addChild/removeChild can work as well.

Tags: Adobe Animate

Similar Questions

  • What is the correct way to ask for help with the forum, rather than product, questions?

    I can't find the right way to ask a question about the forums themselves.

    PAGulley said

    I can't find the right part of the forum to ask questions about the forum itself and its features. I wonder what the right place and the way is to get help with the forum system itself. I can find the place to ask questions about specific Mozilla products very well.

    Look up where it says contributor tools and select Contributor Forums. Make sure that you scroll to the top or you'll get a bar with different links instead,

    The forum is https://support.mozilla.org/forums where you question would be better in the SUMO community discussions.

  • Using Vista Home Premium 64 x. In Windows Explorer how to group by name to display with the simple letters like A, B, C, D, etc. instead of A - H, P, Q - Z?

    Original title: group Windows Explorer by name

    Using Vista Home Premium 64 x.  In Windows Explorer how to group by name to display with the simple letters like A, B, C, D, etc. instead of A - H, P, Q - Z?  In XP, it could be sorted by simple letter, which makes it easier in a folder with many files.  Thanks in advance.

    Hi kmcmi,

     

    Welcome to Microsoft Answers Forums.

    Well this feature is not available in Windows Vista.

    It only works on Windows XP.

    I've added a useful link

    Behavior and change folder views

    http://windowshelp.Microsoft.com/Windows/en-us/help/3a3bfe59-5268-4FB3-81c5-7972c28939cd1033.mspx

    Hope this information is useful.

    Let me know if it worked.

    All the best!

    Thanks and greetings

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Is it possible to create the icon PDF format display with the cover of the document image, when sending via "Mail" on a mac?

    Is it possible to create the icon PDF format display with the cover of the document image, when sending via "Mail" on a mac?

    InDesign has no control on how Apple Mail displays a PDF it creates.

    My experience is that Mail displays a preview of a single PDF page, but not a multiple page PDF. In addition, for a single page PDF, the user may tip if the PDF shows a preview by right-clicking the icon/preview.

  • What is the problem with the conversion of objects with gradients to the gradient mesh?

    What is the problem with the conversion of objects with gradients to the gradient mesh?

    Radial gradients are special, and it could become difficult edit the gradient mesh resulting.

    Take the layer apnel and inspect your objects. You will find a clipping mask the cracks inside.

  • rMbp mid-2014, external display with the quality of the retina

    Hello!

    I buy a Dell 24 "external display to connect to my rMBP with QHD (2 560 x 1 440) resolution.

    http://www1.euro.Dell.com/content/products/ProductDetails.aspx/Dell-u2515h-monit or? c = en & l = en & s = dhs & cs = frdhs1

    I have connected the screen to my mbp with the mini display / port cable supplied with the display screen. It works well, but I don't have quality of retina at all (the images seems good but the text is terrible)

    The text have a bad record as a retina screen, and it makes a big difference when I spend my retina display to the external display which is not comfortable at all.

    I though that this kind of screen was OK to view the retina... but I was wrong. I try to connect with minidisplay / display and HDMI! HDMI made was worse than minidisplay. The res in the system report show was good 2 560 x 1 440. I even try the hack to force with the patch, but always bad RGB render text...

    More important, I want to, it's having the same record as retina on the text and images. What external display can be good for this?

    My budget is 450-€500

    Thank you

    The size in pixels of the screen is not mean much: a small display to 2560 x 1440 pixels seems much sharper than a widescreen 2560 x 1440 pixels.

    Your retina Macbook has something like 220 dpi (DPI in English), the Dell screen only 117. If you want the same sharpness, you will need to choose a display with 220 dpi. But then, everything on the screen will look much smaller. Here is a tool that allows you to get the idea: http://dpi.lv/

  • HP Pavilion Notebook e101sp 17: best way to charge 10 Windows with the laptop HP software (post regularly update 8.1-> 10)

    My HP Pavilion 17 - e101sp Notebook PC (ENERGY STAR) came with preinstalled Windows 8.1. I later upgraded to Windows 10.

    Although I had Norton Internet Security installed since the bootups earlier, I still have some virus infections from time to time (discovered through runnin ClamAV from a Linux Debian partition, I put in place on the same computer) laptop. After the expiration of the 1 year subscription NIS (I had lost confidence in it right here...) I played around with a few other sollutions.

    In the end, I now have a Windows essentially not fixable (infected) 10. It's not scary for me because Linux is my main OS 'at home' for 15 years now. However, being the standard Windows "de facto" is it much, I still would like to have a copy of own work, installed.

    My question is, in the current scenario, as I mentioned, which of the two is the best way to have 10 Windows installed with all the goodies of HP, alongisde, my Debian Linux system? And what care I would create throughout the process?

    1 reinstall 8.1 can I leave HP recovery disks that I made at the beginning (and hope that does not erase the Linux partitions, I created afterwards - I need more than "hope" in fact, I need evidence-based knowledge on this one!). And then upgrade to Windows 10.

    2 install a Windows 10 fees (from DVD created from the .iso file downloaded from Microsoft), hoping that it activates properly with the key contained in the UEFI BIOS (I think that this 'hope' is pretty much made to knowledge database) and then get all the goodies of HP... by a simple download from the HP site?

    I think option 2 is the safest (and fastest also!) but I'd well informed comment before that I have try.

    Thanks in advance.

    Hello:

    Option 1 is the only way you will get to keep the programs provided HP with your PC, and they reformat the hard drive, so you will lose everything.

    Option 2 will put a clean install of W10 on your C:\Drive and you will be able to leave everything intact, unless you format the hard drive.

    If your current installation of W10 has been successfully activated, W10 will automatically activate once you install it again once you're connected to the internet.

    To install W10 in this way, you select the "I don't have a product key option,' when you get to when Windows asks for the prouduct key.

    The only software and you will be able to install the drivers which will be available on the page of the driver and support for your laptop.

  • The best way to strip sound syncronise with the sound on a video track

    Hi, I recorded a concert. The sound was recorded separately for reasons of quality and imported into the soundtrack. The video has been added. I want to sychncronise the two. I am to find distinctive points to the audio track and trying these line up with the audio on the video track. Then I can remove this bad quality audio and use the best acoustics on the soundtrack. I use the mouse to drag the clip to try to do. But it's tedious with the mouse. There the keyboard controls can I use to move the video track through small steps to get to that right? Thanks Chris

    If you mean you want to move a Clip, 1 frame at a time, select the item in the timeline, hold down ALT, then press the cursor keys (arrows).

    Good luck

    Hunt

  • How can I create legends customized for each image (large) target displayed with the widget to the Gallery?

    Greetings!

    I'm having any joy with the thumbnails Gallery - with the exception of a customization widget, I would like to make.

    I would like to have descriptive legends custom unique each 'target' (large image) image displayed. I can see the legend box personalized, move, modify, etc, but this is fixed for all images in the gallery.

    How do I change each caption for each image of the target?

    Thank you very much

    JL

    Assuming you are talking "Vignettes" under "Slide shows" widget in the widget library, simply drag the widget on a page to insert it. Once inserted, make sure you have legends in reverse by clicking the widget inserted on the page, and then on the small blue arrow top right of the widget that appears once the widget itself is selected, and check the box called "Legends", this will add captions [Lorem Ipsum] to each photo, you can then at this point click or double-click the text "Lorem" on each photo and that you want it to be. I hope this helps.

  • Forms is displayed with the color when a form is called from a menu

    Hi all

    I've recently migrated all forms and menus of 6i to 10g As. Now, I have a menu with some menu items, and a special menu item called a form of it, and the called form has buttons which calls another form of it even.

    The problem is, when I call the shape of the menu item, the form is displayed with a color. I mean the text Element and push button are colorful. And of the shape called if I press a button that calls back a form, or even the 2nd form called appears the color. (Same color appears in all forms).

    But the Forms seem to be color when the form is called directly ( not through any form or Menu ) just passing form name in the URL.
    Also checked the property Palette and doesn't seem that any color specified anywhere.

    What could be the problem?
    And what all (in the property Palette) should I need to check this?

    Published by: Charlie on April 13, 2011 10:31

    and what color is? If it is gray, it sets with the gray of co.or?

  • Buy an iPod, reset it and knew I had to turn off find my iPhone. I have no way to get in touch with the owner login Apple ID account their child to do such, both parties assumed reseting it would be all that was necessary.

    As said, I recently bought a used iPod from the original owner, they had gotten their child a new iPhone and is more used to the iPod. When asked, they told everything what I need to do is to reset the iPod when I got home. Got home and went about resetting it, but when you attempt to set it upward and connect to iTunes, it says that I need their last ID. Apple I'm not able to get in touch with the original owner, I didn't to get any contact since I wasn't worried for their need (had taken as them all I would need to do is to put) to nine).

    Is it possible to fix this? I realized this is cause I have to disable find it my iPhone thing, I did not know was even a thing or would have done so before resetting the iPhone.

    Thank you for anyone who is able to help!

    I'm sorry.

    The iPod is useless until / unless previous owner deletes their iCloud account.

  • blurry display with the new update of windows 8.1

    my computer compaq presario CQ60, whose orinionally running vista) automatically updated windows and now the screen is fuzzy and the icons and the sign on the screen is too big for the screen.  It does give me an option to change the display changes the resolution.  is it possible to go back to an earlier version of windows 8 (I bought online when vista has stopped working) or someone has another solution?

    Thank you

    Hey @telbanks ,

    Welcome to the HP Forums!

    I see that your laptop screen became fuzzy after a recent Windows Update.

    I took a look at the specifications of your laptop and see that you are using the graphics card Intel GMA 4500. This card not a not the addition of drivers available for Windows 8 performance cannot be guaranteed.

    If this problem started after the update to Windows 8.1 form Windows 8, you will need to perform a system refresh. You can see how to do this here: How to refresh, reset, or restore your PC. The update will uninstall all the software on the laptop and back to Windows 8. A nice feature of this process, is that it records a list of programs uninstalled on the desktop, so you can easily re-install. This process does not delete your personal files.

    You can also follow these steps to prevent it happening again:

    1. Press the Windows Key + R.
    2. Type gpedit.msc , and then click OK. This opens the Local Group Policy Editor.
    3. Go to Computer Configuration > administrative models > Windows components > Store.
    4. Double-click disable the offer was updated to the latest version of Windows and set it on " Enabled".

    This should you return to Windows 8 where we are short of things well and prevent it from happening again.

  • Data are not displayed with the new responsibility

    EBS 12.1.3
    DB 11.2.0.2
    Windows 2003 R2

    Hi all

    I created a new responsibility 'ORG IQAMA DETAILS' associated with the Application of "human resources." I added the "Define person Extra Info" function in the menu
    When I give emp # to find any employee, new form is opening that shows only one name that lack data "type and details."

    Complete data are with Manager of Saudi HRMS.

    Please I need your help on this issue.

    Thank you!!

    Best regards
    Syed

    Hi Syed,

    When you create a new EIT, you must also assign to your responsibility to see.

    Please check the Note-
    Oracle HRMS information Types (EIT): [ID 70122.1] General & technical information

    See you soon,.
    Vignesh

  • page display with the jump to a named anchor

    until yesterday, that everything worked well. When I click on the link to an anchor named in another page, the other page opens suddenly, but its formatting is completely absent. It looks like a word doc! I tried from a new site to see if I made a mistake while twisting the original site I created. the same problem persists. in this case regardless of the browser that I use. I'm totally stumped!

    > http://www.efn.org/~sgp/test/index.html

    I don't want a descriptive roadmap on how to find the link with the
    problem.
    You do the work to find things.

    If this page:

    http://www.EFN.org/~SGP/test/HTML/doc_1.html

    and is this a link?

    Global link

    remove the forward slash. Slashes only go to end of top level domain names and
    folder names.

    doc 2.html #st4 exists.

    http://www.EFN.org/~SGP/test/HTML/doc%202.html#ST4

    --
    Alan
    Adobe Community Expert, dreamweaver

    http://www.Adobe.com/communities/experts/

  • With the help of objects with one fill to cut through another

    Sorry for clumsy description in the subject line. Do not know how to look for a solution to this, but it's probably pretty simple.

    This is Illustrator CS3 on Mac. Everything is on a single layer. I used the white alterations forms to fine tune black objects below. I would like to meet constantly so I can be left with the black forms (for a color simple screenshot). Is there a way to 'collapse', objects and constitute an Illustrator to eliminate white? I tried everything in the Pathfinder palette without results I'm after.

    Any suggestions?

    Thank you!

    Brad

    illustrator-problem.jpg

    a number of questions arise that I see your design:

    1. you send the file to someone to be "silkscreen"?

    2 - is any vector art?

    3. print the gray background?

    IF the gray background doesn't print - delete.

    IF all vector art - make sure that white objects are NOT defined for a recovery - make sure of course black objects are really black and not a RGB or CMYK build.

    IF you send files to someone ' one - after doing what I said above - save as PDF - using the parameters of "high quality print".

    send file

    to test the separations - try to print (assuming you have a connected printer)

Maybe you are looking for