I need to delete a variable containing a movie clip class and recreate it with a different movie clip class

Hello,
I am creating a program that is going to help students learn to read. In my project are pages of text with each word having a button that when pressed will display a movieclip presentation about that word (its pronounciation and spelling etc..). In the project I am working on now I have over 450 unique presentations of words to deal with. I don't want to have all of these hundreds of movie clips on the stage and tell them one at a time to stop and rewind and then have one play each time a word button is pressed. That seems to be very inefficient to me. So I want to do this with some code in Actionscript 3.
I know I can dynamically add movieclips to the stage using addChild(movieclipname) and remove them using removeChild(movieclipname) but there is a problem. I have hundreds of unique movieclips and I don't want to have to manage hundreds of variables containing the indivudual movieclip instancess. It is a real pain having to figure out what instance is still on the stage before i delete it.
In Adobe Director all I have to do is this:
on mousedown me
     sprite(me.spritenum).member = member("somenewmember:)
end
and that was it
But if I do this in actionscript 3:
removeChild(some_mc)
some_mc still exists in memory. And I have to know exactly what variable it is to remove or else the movie will fail with an error. If I try to be brutish about it and try to implicitly remove all 450 movieclip instance variables from the stage I will get at least 449 errors.
What I want to do is this:
removeChild(some_mc)
some_mc = void //or //delete some_mc
var some_mc:MovieClip = new someother_mc();
addChild(some_mc)
but this doesn't work
How am I going to remove one of 450 movie clips and add a new totally different movie clip without the code knowing exactly what the last movie clip was? I suppose if could remove a child from the stage based on a string name then I could hold that name in a variable for later disposal.Can I do this?
Thanks for any help you can give me. I am new to actionscript.

Hey I think I may have a solution:
//begin code
var myMC:MovieClip = new ball();
var starMC:MovieClip = new star();
var youpresseeditMC:MovieClip = new youpresseedit();
starMC.name = "star";
myMC.name = "ball";
youpresseeditMC.name = "youpresseedit"
addChild(myMC);
box.addEventListener(MouseEvent.MOUSE_DOWN, replaceball);
press_BTN.addEventListener(MouseEvent.MOUSE_DOWN, replaceballwithtext);
function replaceball(event:MouseEvent):void {
    trace(myMC.name)
    removeChild(myMC);
    myMC = starMC;
    addChild(myMC);
    trace(myMC.name)
function replaceballwithtext(event:MouseEvent):void {
    trace(myMC.name)
    removeChild(myMC);
    myMC = youpresseeditMC;
    addChild(myMC);
    trace(myMC.name)
///end code
This works. I see the ball object replaced  by the star and I am able to do this by manipulating just myMC. Is there anything I should be concerned with in this approach?
Thanks for your help

Similar Messages

  • HT1688 I need to delete my iCloud my email address has change and I don't know old password todelete

    I need to delete my iCloud my email address has change and I don't know old password todelete

    i cant active my iphone after restor and i forget my apple id and password
    can you active my iphone

  • How can I delete an Apple ID from one device and replace it with a different ID on that same device?

    How can I delete an Apple ID from one device and replace it with a different ID on that same device?

    Tthe brute force method: start with Settings > iCloud and turn off Find My (you will need the password), then change the iCloud ID, then go to the apps such as Messages, FaceTime, etc, and delete the Apple ID and enter the new one.

  • How do I do to use the same appleid on all my devices, I want to use the last one I have on my Ipad mini, do I deleta the one I have on my Iphone and reeinstall it with the Id I use on my Ipad..?

    how do I do to use the same appleid on all my devices, I want to use the last one I have on my Ipad mini, do I deleta the one I have on my Iphone and reeinstall it with the Id I use on my Ipad..?

    Hi john,
    Yes, you would sign out of iTunes & App Store: Settings>iTunes & App Store, click on the Apple ID, click on Sign Out. Then sign back on with the new Apple ID. Also, if you have an iCloud account with the other Apple ID, you would delete that iCloud account, and then sign on with your new ID: Settings>iCloud>Delete Account.
    Cheers,
    GB

  • I NEED TO SHARE MY LR CATALOGS FROM LAPTOP TO MAC AND EVEN IPAD WITH NO EXTERNAL DEVICES - I WOULD LIKE ANY EDIT I MAKE FROM ONE COMPUTER TO BE MADE ON THE OTHER - HOW DO I DO THIS ?? THANKS!!

    I NEED TO SHARE MY LR CATALOGS FROM LAPTOP TO MAC AND EVEN IPAD WITH NO EXTERNAL DEVICES - I WOULD LIKE ANY EDIT I MAKE FROM ONE COMPUTER TO BE MADE ON THE OTHER - HOW DO I DO THIS ?? THANKS!!

    All the info you do with your image files is stored in the Lightroom Catalog file. The Catalog file cannot be located on a network it must have a physical connection to the computer.
    While the Catalog is in use a LOCK file will be temporarily placed alongside which prevents its use by any other device.

  • I purchased an IPAD2 for my special needs daughter.  She only currently understands lowercase letters only and gets confused with the uppercase letters.  Is there a way to change the keyboard to display lowercase letters?

    I purchased an IPAD2 for my special needs daughter.  She only currently understands lowercase letters only and gets confused with the uppercase letters.  Is there a way to change the keyboard to display lowercase letters?

    There is no way for the keyboard itself to display only lower case letters. It doesn't display lower case letters at all for that matter.
    When you are using the keyboard - The other issue that you will have is with the shift key. Even with auto caps turned off you can still type capital letters if you tap the shift key and if you double tap it by mistake - it will turn into all capital letters so also turn off Caps Lock in the keyboard settings.
    Other than that, there is no way to ensure that you can type in lower case.
    Maybe an external bluetooth keyboard would be a better solution but I don't use one, and I have never even seen one in person so someone else will have to verify that for you.

  • Cannot delete email.  Selected edit. Selected email and red circle with white check appears.  BUT, options at bottom of screen do not appear.  Help.

    Cannot delete email.  Selected edit.  Selected email and red circle with white check apprears.  BUT, options at borrom of screen DO NOT APPEAR.  I just get a grey band across he bottom of the screen.

    Correction: the "Move" button is blue, not green.

  • Need to delete icloud account, but I changed my email and password

    I changed my iCloud login information to my new email address, and now I can't change my iCloud account on my iPhone because it's still using the old email address. When prompted for the password it fails because the ID/email address is no longer tied to my account and is no longer even a valid email address.
    How can I change my iCloud account without these credentials?

    If the old iCloud ID ("email address") is an earlier version of your current ID, temporarily recreate the old ID by going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • If I log out of iTunes and log in with a different account, will all my apps and data be deleted?

    This is not only a question for my computer but also for my phone and my iPad. My mom has an Apple account that both she and I use. Unfortunately, without turning on iCloud, all of my Safari bookmarks are transported to her phone and her notes go to mine. I want to get my own account so I can use iCloud and only MY stuff will be synced to MY devices, but I already have a lot of apps on my phone and iPad and computer that I don't want to lose.

    Welcome to Apple Support Communities
    Of course not. Apps are not deleted if you change your Apple ID on any of your devices. However, you will need the old Apple ID to update those applications, unless you download them with the new Apple ID.
    iCloud lets you choose if you want to delete or keep your data stored on iCloud. The only exception is for documents stored on iCloud, which are deleted if you change your iCloud account

  • I need help streamlining my email accounts. Can Apple Mail and iCloud work with comcast and gmail?

    I have been using Apple Mail to manage four email accounts. I want to consolidate the four email accounts: icloud, gmail, and 2 comcast accounts. And I want them to sync across my devices, iMac 2009, running Mavericks, ipad and iphone (both running IOS7). I have been using comcast for my work account(s), but they do not sync between devices.
    If possible, I would like to keep using Apple Mail as my main email client. I do not mind trashing some of the email accounts (which is probably a choice I need to make).
    In light of upgrading to Mavericks and ios7 what is the latest thinking on this issue?

    iCloud will only deliver mail from your iCloud account.  What you can do is set up email forwarding with your other accounts to forward incoming email to your iCloud address, then tell all your contacts to send email to your iCloud address.  (Comcast accounts are POP3 rather than IMAP so you won't miss these accounts.  I set up forwarding from Comcast to iCloud a long time ago.)

  • HT204053 i bought an used ipad and need to delete the former owner's apple id how and use mine?

    I bought a used iPad1 that has the former user's apple id. I have an apple id myself that i can use to purchase apps, etc.
    1. However, do i need to reset the device to use my ID? I've made purchases from my laptop and need to sync them to the ipad.
    2. My latop is authorized and all the connectivity tests etc are ok. I get the message do I want to erase my library when i sync. there was music that i like on the device when i got it. I don't want to lose it by  saying yes to deleting it. Oh yeah i don't think this music is in the itunes on the ipad. what can i do?
    Can't you see i don't know where to go, help me please!

    You should log out of the currently logged in account by tapping on the id in Settings > Store and you should then do Settings > General > Reset > Erase All Content And Settings to put it back to factory settings (which the previous owner should have done) - you can then sync your own content to it.

  • I need to delete over 1000 emails from my IPhone 6 and the previous suggestions don't work. Any ideas?

    How to I go about deleting all of these emails. Previous suggestion with using the move feature isn't working.

    Contact your carrier. VoiceMail is a feature managed by the carrier and not the iPhone.

  • I need to delete 6419 photos from my iphone 4s library and im finding it impossible. I am a technophobe so please keep it VERY VERY simple.

    I have almost no memory left because my iphone transfered all of my photos from my laptop to the photo library and now i cannot remove them.
    there are 6,419 photos to be removed to be exact and its driving me nuts.
    I am literally a complete technophobe so if anyone would be so kind as to explain to me in a language even your grandmother would understand, i would be very greatful.
    Thanks so much

    ihavenoclue wrote:
    Thank you for your reply. i don't seem to have any tab for photos on my itunes thats the problem.
    The Photos tab will only appear when the iPod/iPhone is connected. Click on iPod/iPhone (which also only appears when the ipod is connected) - not the eject arrow:
    and "on this iPhone" (see in my screenshot, it says "on this iPod" on the right side). Then click on Photos (that I've highlighted) and this pane appears...
    ...choose the folder you want or turn off the Sync Photos option.
    ihavenoclue wrote:
    I've never been able to view them.
    You do not view the photos in iTunes. You simply tell iTunes which folder of photos to put on the iPod. So this just takes them off again.

  • Loss the "Deleted Items" folder on Exchange 2007 WEB interface and any Outlook with any version.

    Hi, 
    My client had lost his "Deleted Item" folder in his outlook, and I try to used the WEB interface to help to check, also can't find out the "Deleted Item" folder.
    Then we're try to used outlook 2003,2007 and 2013 also can't find that.
    Could you mind let me know any solution we can solve this problem with my client?
    Thanks 

    I believe the Deleted Items folder was just hidden from view, as I don't think a user can delete their Deleted Items folder. Here's a KB for the fix: Contacts or other default folder hidden, but shortcut works with Open in New Window Article ID: 924226
    (http://support.microsoft.com/?scid=kb%3Ben-us%3B924226&x=12&y=12). In short, you need to change the PR_ATTR_HIDDEN value for the hidden folder, which in your case is the
    Deleted Items folder.

  • Help C# Hi, i have studying for 3 weeks and i need some help. How can i sort case 2 and display that with dinamic array?

      //Meny
                Console.WriteLine("\n HÄNGA GUBBE\n");
                Console.WriteLine(" 1) Lägg till ord");
                Console.WriteLine(" 2) Lista alla ord");
                Console.WriteLine(" 3) Spela");
                Console.WriteLine(" 4) Avsluta");
                int valet;
                Console.Write("\n\tVälj 1-4:  ");
                valet = int.Parse(Console.ReadLine());
                switch (valet)
                    case 1:
                        Console.WriteLine("\n lägg ett till ord! ");
                        break;
                    case 2:
                        Console.WriteLine("\n Lista med alla ord :\n");
          char[] array = { 'lev', 'skratta', 'gledje', 'gråt', 'njut'};  
                Array.Sort<char>(array);
                foreach (var c in array)
                    Console.WriteLine(c);
                Console.WriteLine("\n");
                        //List<string> list = new List<string>();
                        //Random r = new Random();
                        break;
                    case 3:
                        string guesses, bokstäver;
                        Console.Write("\n Hur många fel får man ha? ");
                        guesses = (Console.ReadLine());
                        Console.WriteLine(" Utmärkt, då spelar vi!\n");
                        Console.WriteLine(" Felgisningar :" + "0/" + guesses);
                        Console.Write(" Gissade bokstavär: \n" );
                        bokstäver = (Console.ReadLine());
                        Console.WriteLine("Aktuel ord");
                        Console.WriteLine("Gissa bokstav : "+bokstäver+" \n");
                        break;
                    case 4:
                        Console.WriteLine("\n  HEJ DÅ! \n");
                        Console.Beep();
                        break;
                    //avbryter while loopen, avslutar spelet

    You can do it like this;
    var text = Console.ReadLine();
    if(array.Contains(text)) // if exists do what ever you want
    Please mark it correct if you find the answer helpful and please start  a new thread if you have another question. Thanks.

Maybe you are looking for

  • How to scheduling a Report ???

    Hello dears, Can anyone tell me how to schedule a report so that the scheduled report can run as per the scheduled options. I tried it from Reports Queue Manager but it never worked. Please help me.. Regds. Suneel

  • External HD Won't Mount - Force Ejected it and now won't mount

    Hi All, I seem to remember this happening to me before. Isn't there somewhere in the filesystem that OSX writes a file if a drive was mounted? And if you ejected a USB disk incorrectly, it cannot ever mount again? I can't seem to find that fix anywhe

  • Can't Get Movies to Play!!!! Please Help!!!!

    I received a 32GB iPod Touch yesterday as a gift. I also recently bought the movie The Hangover and downloaded the Digital Copy into iTunes. I can watch the movie in iTunes, but it will not play on my iPod Touch. It shows that it is on my iPod Touch,

  • SQL file will not open in SSMS on double-click (or jump list)

    Hello, all. I am running SQL Server Management Studio 2008 on a Windows 7 Enterprise machine here at work.  I am not sure when this started happening, but now, for some reason, when I double-click on a SQL file in Explorer, or from the jump list for

  • Not all files copy on to DVD/CDs

    hello. i have a macbook running OS 10.5.8 i need some help... when i burn a DVD or CD to back up files, not all files are being burned. about 50% are burned. any thoughts? thanks!