removeChild to clip that was added in another function?

Hello everyone.  I have 3 different functions for my preloader.  I have an Event.OPEN and a ProgressEvent.PROGRESS Event.COMPLETE.  In the event. Opening function, I create a new variable that is typed the name of class of my preloader I put in its data property dialog box.  It's just an animation simple circle.  Here is my code for this:

function addPreloader(event:Event):void
{
var myPreloader:mcPreloader = new mcPreloader();
myPreloader.x = stage.stageWidth / 2;
myPreloader.y = stage.stageHeight / 2;
myPreloader.width = 75;
myPreloader.height = 75;
addChild (myPreloader);
}

My looks of function ProgressEvent.PROGRESS as follows:

function preloadImages(event:ProgressEvent):void
{
var p: Number = Math.round (event.bytesLoaded/event.bytesTotal * 100);
percent_txt. Text = % + '% ';
}

and my Event.COMPLETE function looks as follows:

function imageLoaded(event:Event):void
{
var myLoadedImage:Loader = Loader (event.target.loader);
addChild (myLoadedImage);

new Tween (Strong.easeIn, 0, 1, 0.5, myLoadedImage, "alpha", true);

event.target.loader.removeEventListener (Event.OPEN, addPreloader);
event.target.loader.removeEventListener (ProgressEvent.PROGRESS, preloadImages);
event.target.loader.removeEventListener (Event.COMPLETE, imageLoaded);
}

The only problem is that when it's done loading, I would remove the myPreloader from the scene.  Because it is declared in the function Event.OPEN, I can not connect with him via my Event.COMPLETE function.  How can I successfully remove from the scene once he's done loading?  Thank you!


Jesse

Declare it outside your function.  you don't need to create or add to the scene until the auditing function is called.

Tags: Adobe Animate

Similar Questions

  • How can I use an ipod nano that was synched to another computer?

    My daughter gave me his 2nd generation ipod nano because it is no longer use it.  When I plugged in my USB to load, I got a message informing me that there is an update.  It would not be updated beause "ipod cannot be updated because it contains files that are used by another application."

    What should I do to be able to use this ipod nano?

    I don't think that this message is related to the iPod is synced to another computer...  It is usually other applications or processes on the computer (which is not iTunes) accessing the iPod for some reason if iTunes is not able to perform the update.  However, your question in the subject heading ("How can I use an ipod nano that was synched to another computer?") is valid, since the iPod was previously used by someone else, with a different iTunes library.

    If you want to start using this iPod with your iTunes library and put on your songs, instead of doing an Update, you need to restoreThis erases the iPod, reinstalled the latest version of the software, and sets it to the default settings.  The iPod gets a 'new beginning', as when it was new.  To resolve the problem with this "files in use by another application" error message, try restarting your computer.  Immediately after the computer finishes starting up, run iTunes, plug in the iPod (if it isn't already) and try to do the restore (or Update).  If you still get this error message, please after return.

    If you are restoring, you can configure it to sync with your iTunes library.  You can post back, if you need advice on options for the implementation.

  • Preview video clip that was created outside PP CS6

    I made a video that I would like to insert in my current project.  When I insert it and watch it on the program monitor, it's like the program monitor's zoom on video because I see only a small majority of the screen.  I filmed in HD.  This is the first project I did in PPCS6.  I have never worked in this program before.  I suppose that if I make the work area full that it will preview correctly but I'm not sure.  When I first created my project, I chose the widescreen HD version.  Can someone help me? Is it possible that I can use this video in my project where you will be able to see all of the screen?

    Thank you

    Lost in the forest...

    It simply means that the media and the sequence settings do not match. Right-click on an item in the project Panel, and then select "new sequence of the Clip.

  • How to remove a toolbar that was added when I downloaded a program?

    I use Firefox 7.0.1 and Microsoft Windows XP Professional version 2002 Service Pack 3. I would like to delete (to get rid of the NOT hide only) a toolbar that Firefox has been downloaded when I downloaded a program to print internet coupons. The toolbar is called 1001reductions.com.
    I read your article on the removal of toolbars, but this solution only applies to the toolbars you add Firefox buttons. I found no other articles that talk about remove toolbars downloaded.
    I want to delete this toolbar because it slows down Firefox because it constantly monitors the sites I visit, and it display coupons offerings or other stuff on this site.
    Is there a way to get rid of the toolbar? If not, reinstall Firefox would fix the problem? Thank you.

    I found the answer in the same site 1001reductions.com . Here is the link with the information to remove the toolbar pesky shopathome

    http://www.ShopAtHome.com/pages/FAQs.aspx#Gen13

    Don't forget to restart Firefox close and restart your computer

  • I've lost the ability to view a video Clip that was sent to me by email. I can play a CD of music without problem.

    I did not any changes that I know

    Hello Yllib1,

    Than you for your message.  What is the video format you are trying to play?  It could be that WMP is not suitable Codec to play the file.  To resolve this problem, you need to download a Codec that is able to read this file format.  Is this video, a link to a video on the internet?  If so, you need to maybe download and install the latest version of flashplayer.  Click on the link below to download it.
    Please let us know if it did or did not help to solve your problem.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • How to use a subscription that was paid on another computer

    I have a sub that is already paid and I need to enter on my new count

    Cloud license allows 2 activations http://www.adobe.com/legal/licenses-terms.html

    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0

    -Windows or Mac has no importance... 2 on the same operating system or 1 on each

    -Two activations may NOT be used at the same time (noted in the link above of the license)

    Remove the license on a computer http://forums.adobe.com/thread/1442423?tstart=0 can help

    -read http://helpx.adobe.com/x-productkb/policy-pricing/error-maxium-acitvation-exceeded.html

    -or https://helpx.adobe.com/x-productkb/policy-pricing/activate-deactivate-products.html

  • How to read data from the memory on the computer that was written by another program host

    Hi all

    This is my first post.

    I am very new to LabView and I just finished 1 Core and Core 2 with no experience of LabView.

    I have a card SilconSoftware acquisition with an FPGA card on it to capture and image of a CamerLink sensor processing. The FPGA is programmed to produce a 64-bit using DMA to the host PC image, and I know the address of the Image. The image consists of two pixels, I would read the pixels in LabView, so I can decode the information.

    How can I do this?

    Thank you _KAL

    I'm not familiar with this specific material, but the easiest is if the camera is compatible with IMAQ. Furthermore, the seller provides a DLL to access the images?

    Mike...

  • Is it possible to deploy bundle SOA on the custom MDS that was added manually?

    Hello Experts,

    I want to know the following scenario is possible.

    (1) create the new SDM repository using the remote control.

    (2) save the MDS in soa-field.

    (3) add the new partition in the MDS.

    (4) deploy some bundle SOA with WSDL, XSD and so on.

    (5) implement composite new services included in the bundle SOA of the MDS.

    1 ~ 3) seems possible.

    But I don't know how in the specific MDS which is not SDM - soa.

    Please check the script and let me know something wrong or how to deploy an SOA in MDS custom bundle.

    Thanks in advance,

    BmW

    I also got a response from the Oracle and share it here.

    "There is no way to have the mds shared between multiple areas of Soa." "You would have to maintain separate but equal mds copies (I mean just like xsd/wsdl metadata, not composites).

  • How to delet E-mail addrsses leave an e-mail that was sent to you before that transfer you it to another comeon

    How to delet E-mail addrsses leave an e-mail that was sent to you before that transfer you it to another comeon

    1. Click on transfer.
    2. Highlight addresses with the mouse cursor.
    3. Press DELETE.
  • In windows movie maker, how can I change my clips so that they all have the same duration after that I added the?

    Original title: Windows Movie Maker

    In windows movie maker, how can I change my clips so that they all have the same duration after that I added the?

    Hi Ashley44,

    You can use the trim function in Windows Movie Maker to change the duration of the film. See the link below for the steps

    To trim a video clip

    If you want more advanced features, you can use Windows Live Movie Maker

    http://explore.live.com/Windows-Live-Movie-Maker-stunning-in-seconds?OS=other

  • You can adjust the opacity in Adobe video? My goal is to have a clip playing on top of another, similar to a double exposure. If not, is there an iOS application that can?

    You can adjust the opacity in Adobe video? My goal is to have a clip playing on top of another, similar to a double exposure. If not, is there an iOS application that can?

    I dug around and found that imovie 9 will do, not elegant, but looks like it will work for this experience.1

  • I'm trying to install Acrobat 8 Std on a laptop computer that was in need of a restoration.  He asks the file AdobePDF.dll since my Vista CD - I do not have.  How can I get this file or another which will allow my Acrobat 8 work on this laptop with Win 8

    I'm trying to install Acrobat 8 Std on a laptop computer that was in need of a restoration.  He asks the file AdobePDF.dll since my Vista CD - I do not have.  How can I get this file or another which will allow my Acrobat 8 work on this laptop with Win 8.1, which she did before restoring?

    John,

    AdobePDF.dll is in the file Data1.cab. Mine is located in C:\Program Files (x 86) \Adobe\Acrobat8\Adobe Acrobat 8 Professional\ You need to extract the file "AdobePDF.dll_64" from the .cab file. You can do this with WinZip or 7-Zip. Everything you need to extract is this file, nothing else... Once you have extracted it, remove the _64, so the name of the file is AdobePDF.dll. Then place the file in any location you want and run the program it when asked. For a file location, I suggest to C:\Program Files (x 86) \Adobe\Acrobat8\

    Hope that helps.

  • can I assign a status of the child at a clip that is already placed on stage

    Hello

    Is it possible to add a State of the child to a clip that is already placed on stage
    I need to do so that I can move the movieclip at the top of the display list.

    Thanks for the help
    MT

    > bottomBox_mc (root), .addChild (telephone);

    When abeall told to MovieClip (root) .addChild (), he (she?) was not said the word 'MovieClip' with the name of your movieclip. That MovieClip (root) is make think Flash of 'root' as being a MovieClip, otherwise it could be interpreted as another type of variable.

    Another thing, you remove myLoader after it is added. I suppose you think that he will remember the layer it was, but it won't. When you addChild it later, it will be on top. Immediately after making an addChild of the loaded swf file previously, another addChild of the menu. In this way the menu will be on top again.

  • problem of collage of video clips from one film to another file

    I use the Director of microsoft with Windows 8.1.  I have many movies at home that I edited various movie maker project files.  I would like to take some of my favorite clips of different projects and paste them into a new project.

    This has not worked for me.  That's how I tried to do.  I open the project file with clip I want to copy and paste.  I clip on the clip and select copy.  I then open the movie maker project where I want to paste this, and I click on the Clipboard to paste highlighted at the top left of the screen.  When I do that, I just get some sort of error noise ding, and then function to paste the Clipboard is grayed out.

    Anyway, how can I copy the project one film to another machine?

    Thanks much for any help.

    Sorry to post what I finally understood how to do this!  In case anyone else has had problems, here's what I discovered.

    To paste me a clip from one file to another, the destination file should have at least a clip already on it.  So what I did was import a video in the file as if to edit it, and then I managed to stick a clip of another movie project in this file, place the new file alongside the existing clip.  I guess you must have at least a clip holding a place for the paste function to work.

  • Can I convert any FLA to a Clip? Or is there another solution?

    I have a Flash file, I created which is quite simple and has a bit of actionscript in it. This is a file that scrolls logos constantly on the rise and stops in some positions. Now, I was asked to keep this version, but have another with a header image static above of what I did.

    I would just do this in my HTML, but we need to be able to export all in a single .exe file so is not an option.

    I tried to slide my .swf file in another file Flash - that works - but then I lost my actionscript a reason any.

    So I wonder if I can somehow all convert in my original FLA file to a Clip that I can drag into another file so that everything I made will be kept.

    How can I do this - any suggestions? Bear with me, am learning I will.

    OK, so use the first suggestion:

    Shift-select all the images in your original film. Choose Edition > timeline > copy the images.

    In your new movie, create a new MovieClip. Inside the new MC, select the upper left frame, then select Edition > timeline > paste images. All of your content will be pasted with all labels intact timeline and actionscript.

Maybe you are looking for