Remove child within a movieclip

Hi guys,
Does anyone know the actionscript 3.0 parameters in removing the child within a movieclip?
This is my scenario:
1. I have two (2) languages which play on the main timeline. Each languages are movieclips.
2. I have a movieclip which has buttons. These buttons are added dynamically using "stage.addChild(main_menu)"
3. I have a go back button together with the main timeline.
How can remove a child on a timeline?
For example when I choose the language A: it will play through by a movieclip and the buttons will be added dynamically [the dynamically added buttons are inside this movieclip; also the AS3 is inside that movieclip]. I wanted to remove the added child when the go back button is pressed and return to certain frame on the main timeline. The go back button is not included in the said movieclip--it is within the same timeline of languages and I wanted the script to be on the main timeline.
Hope someone could help me. Thanks a lot.
YSONG

http://mtrinitaria.com/mykhel/as3-tips-of-the-day-removechild/
http://mtrinitaria.com/mykhel/as3-tip-of-the-day-removechild-problems-and-solutions/
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectConta iner.html

Similar Messages

  • Remove child on the root timeline from within a movieclip

    Hi
    How do I remove a child from the root timeline from within a separate movieclip?
    I've tried
    MovieClip(parent).removeChild(mc1);
    But I get this error
    1120: Access of undefined property mc1.
    I could write a function in the root timeline that just removes child and then run that from within the movieclip but is there a better way?
    Thanks in advance.

    Thanks for replying.
    I asked on Kirupa but I couldn't access the site so I asked here.
    I guy answered with this
    MovieClip(parent).removeChild(MovieClip(parent).getChildByName("mc1"));
    It works fine, is this the best way to do it?
    Not sure if I understand what you meant?
    Just to be clear I have to movie clips on the stage mc1 and mc2 and i want to remove mc1 from within mc2's timeline.
    Thanks again

  • Need help removing child

    Sorry to bring problems but i am trying to learn some as3 and so far i can not resolve this situation ,,,,,,
    this is the script i am using ,,,,,,,,,,,,,,
    Ent.buttonMode = true;
    Bio.buttonMode = true;
    ent.addEventListener(MouseEvent.CLICK, goEnt);
    function goEnt (e:MouseEvent):void
    var new Ent:MovieClip = new firstIntro();
    this.addChild(newEnt);
    newEnt.x = 659;
    newEnt.y = 428;
    Bio.addEventListener(MouseEvent.CLICK, goBio);
    function goBio (e:MouseEvent):void
    var newBio:MovieClip = new bioIntro();
    this.addChild(newBio);
    newBio.x = 659;
    newBio.y = 428;
    the problem is that when i click on first button the Movie Clip does load ok but when i click on second button the first movie cliip is visible ,,,, i have try everything i have read here but no luck ,,,,,,, i want to learn how to remove first child and allow only the second child to show up ,,,,,,, i am looking forward to add more buttons so the remove child should be for multiple buttons ,,,,, i am learning and so far did purchase a online tutorial but did not help me with this situation ,,,, thank you all in advance ,,,,,

    Create a variable to hold a reference to any child object that is added to the display list, then when any given button is used to add a new movieclip to the display list, use removeChild to get rid if any existing movie clip that was added through the reference in the variable. After the new movie clip is added to the display list, add a reference to that movie clip to the variable so that it can be used when the next movie clip will be added.
    Ent.buttonMode = true;
    Bio.buttonMode = true;
    // create a variable to hold a reference to the currently added child, if any...
    var currentChild: MovieClip;
    ent.addEventListener(MouseEvent.CLICK, goEnt);
    function goEnt (e:MouseEvent):void
    var new Ent:MovieClip = new firstIntro();
    // remove any child object currently in the display list...
    if(currentChild != null) {
    removeChild(currentChild);
    this.addChild(newEnt);
    // put a reference to the added child to the variable...
    currentChild = newEnt;
    newEnt.x = 659;
    newEnt.y = 428;
    Bio.addEventListener(MouseEvent.CLICK, goBio);
    function goBio (e:MouseEvent):void
    var newBio:MovieClip = new bioIntro();
    // remove any child object currently in the display list...
    if(currentChild != null) {
    removeChild(currentChild);
    this.addChild(newBio);
    // put a reference to the added child to the variable...
    currentChild = newBio;
    newBio.x = 659;
    newBio.y = 428;

  • How do I use a button within a movieclip to go to the root?

    Hi there, I am new to flash and AS3 and need some help
    getting my buttons to work.
    I made a script for the file that i am working with that has
    buttons located within 2 movieclips. I want that button to load and
    image into a UILoader (problemLoader_mc) that I placed on the stage
    on the main timeline (the timeline that contains WeekBar_mc). The
    problem is that I don't know how to get to the root of the file to
    start a new directory to tell my function to load the image i want.
    I have tried multiple approaches including:
    MovieClip(root).problemLoader_mc.source = problemArray[0]
    MovieClip(parent).problemLoader_mc.source = problemArray[0]
    root.problemLoader_mc.source = problemArray[0]
    parent.problemLoader_mc.source = problemArray[0]
    (root as MovieClip).problemLoader_mc.source = problemArray[0]
    If anyone can help me out with this, I would greatly
    appreciate it, I am banging my head against a wall at the moment.
    (Also, please excuse my vague descriptions, I am still learning the
    official terms.)
    Here is the code that I have written that pertains to this
    problem:

    I have a mental block for reasoning things out as far as
    assigning the listener to an object two mc's away from the main
    timeline while having the function in the main timeline, so I may
    play with that on my own for awhile. One thing you didn't do
    though, was to pay the same attention to the problemArray[0]
    assignment in that function, which I assume also lives in the root.
    But here's what I'd do for the moment.
    Take all that code except the array and plant it in the
    timeline where WEEK1btn lives, modifying it as follows....
    WEEK1_btn.addEventListener(MouseEvent.CLICK, pload1);
    function pload1(event:Event)
    MovieClip(this.parent.parent).problemLoader_mc.source =
    MovieClip(this.parent.parent).problemArray[0];
    I haven't utlized root myself yet, so I am not comfortable
    offering you a solution that attempts it.

  • Help!how remove child's node in tree.

    I think remove child's node of tree in run times.
    thanks

    Hi!
    Try to look this:
    http://blogs.sun.com/winston/entry/creating_dynamic_table
    Maybe it will be helpful for You.
    Thanks,
    Roman.

  • Calling a function from within a movieclip

    How do I do this, and Is it wrong to do it this way?
    I have a movieclip on the timeline and within that movieclip
    it has buttons which I've placed listeners. I'm doing it this way
    rather than putting the code in the document class because the
    buttons don't appear right away in the movieclip (not until around
    frame 10). The function is defined in the document class because it
    is used with other movieclips.
    Anyone have an idea on how to properly do this?

    Well, I'm at least not getting an error - however, nothing is
    happening when I click the button to call the function (which is
    indeed public). Inside the function is a simple trace. I've even
    added a param to the function just for fun, and there's no error
    when calling the function from the button.

  • Hello. I have two version of Office for Mac. 2008 and 2001. I want to delete the 2008 version. If I use the removal tool within the Offie 2008 folder, is there any danger of the 2001 version being removed too.  Thanks Dave UK

    Hello. I have two version of Office for Mac. 2008 and 2001. I want to delete the 2008 version. If I use the removal tool within the Offie 2008 folder, is there any danger of the 2001 version being removed too.  Thanks Dave UK

    Do you mean Office 2008 and 2011 or do you really want Office 2001? I think you mean 2011 since Office 2001 wouldn't make much sense.
    The Office uninstaller should be able to identify there are two versions and allow you to delete either one or both.

  • JSFL - Refreshing a Textfield within a Movieclip?

    I'm making a script that updates text within several movieclips in a Flash document. Loading object names and new copy from a text file is working, opening those objects and replacing their embedded textfields' text is working, and everything looks great when you publish the SWF.
    However - the IDE only sometimes updates the text that appears in the textfield from the main timeline. So if a title is supposed to say 'New Title' instead of 'Title', it will read as 'Title' when I'm looking at the project from the root level. When I double-click on the symbol instance to view its embedded textfield, it changes to 'New Title'. Then when I return to the root, it reverts to 'Title'. It's only a cosmetic problem, but it makes it appear as though the tool does not work.

    quote:
    Originally posted by:
    kglad
    you must wait until the contents of that frame are rendered
    before trying to reference the contents. flash has a render event
    you can use for that purpose.
    Thanks for the reply. I did a little googling and it looks
    like I'm screwed:
    http://www.actionscript.org/forums/showthread.php3?t=143158
    Because my attached MC uses different frames for different
    dialog boxes (that share elements, hence on the different frames)
    there is no guarantee that it'll work.
    I did a test on my own and the Event.RENDER wasn't even
    firing at all :(

  • How to remove  child query link from parent query for RRI

    Hi Floks,
    Long back we have created one RRI report(which is having parent child relation).Currently i wanted to remove this link or relation (i.e remove child report) between them.
    I tried From  t-code RSBBS but i could n't.  Please give me some inputs to fix this.
    Regards,
    Satya.

    Hi Satya,
    In the TCode RSBBS ,did u try deleting the assignments itself ..........save it and transport it ...........
    Rgds
    SVU123

  • Removing child records

    Hi,
    I am using below code to delete the child records for a particular parent record in the Controller:
    But the problem is, it is going in the loop and says deleting records...but data is still present in detail table.
    Please help!
    if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
    MollyAMImpl am = (MollyAMImpl)pageContext.getApplicationModule(webBean);
    MollyUserDetailsVOImpl voChild = am.getMollyUserDetailsVO1();
    String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    System.out.println("ROW Reference =="+rowReference);
    MollyUsersVORowImpl voRow = (MollyUsersVORowImpl)am.findRowByRef(rowReference);
    String parentID = "" + voRow.getId();
    System.out.println("The Id value to be removed from child table is "+ parentID);
    voChild.setWhereClause("");
    voChild.setWhereClause("ID =" + parentID);
    System.out.println("Child VO Query to execute : "+voChild.getQuery());
    voChild.executeQuery();
    System.out.println("Remove - Child Query was sucessfull");
    int childRecords = voChild.getRowCount();
    System.out.println("Remove - child records to delete: "+ childRecords);
    Row childRow=voChild.first();
    for(int i=1;i<=childRecords;i++)
    childRow.remove();
    System.out.println("Deleting child record "+ i);
    childRow=voChild.next();
    am.getTransaction().commit();
    System.out.println("committed.....");
    System.out.println("All child deleted successfully");
    }

    Hi Gyan,
    Thanks for the reply. Please find below SOP values. I have checked the Query, Ids is correct there...
    ROW Reference ==MollyAM.MollyUsersVO1:MollyUsersVO1{74}
    The Id value to be removed from child table is 74
    Child VO Query to execute : SELECT MollyUserDetailsEO.ID, MollyUserDetailsEO.PKG_NAME, MollyUserDetailsEO.PKG_CASE, MollyUserDetailsEO.CREATION_DATE, MollyUserDetailsEO.CREATED_BY, MollyUserDetailsEO.LAST_UPDATE_DATE, MollyUserDetailsEO.LAST_UPDATE_LOGIN, MollyUserDetailsEO.LAST_UPDATED_BY, MollyUserDetailsEO.DETAIL_ID FROM XXE_FXX_USER_DETAILS MollyUserDetailsEO WHERE (ID =74)
    Remove - Child Query was sucessfull
    Remove - child records to delete: 5
    Deleting child record 1
    Deleting child record 2
    Deleting child record 3
    Deleting child record 4
    Deleting child record 5
    committed.....
    All child deleted successfully

  • Forms Designer - Unable to remove Child Table from the form

    Hello,
    While testing adding additional attributes, I have assigned an additional child table to the form. However I am not able to remove it. I get an error message: "This version has been made active. Add/Update/Delete not allowed."
    I tried creating new version and making it active to remove 'active' status from the form I modified, but still getting the same error. What am I doing wrong? Thank you in advance.

    creating new version and making it active to remove 'active+'
    Make new version then remove child form and then make version active..
    You are making version active b4 removing child table.
    Don't change the sequence which I have written above.

  • Remove Child does clean momery?

    Hi.
    I know that if you remove childs previously added with addChild to the stage they tend to stick in memory and thus reducing performance. For instance if i use a for statement every time i want to populate a list and remove them while i close the list do they remain in memory and thus doing more add and remove of different childs would clutter the memory? Because every time i would create new childs and then add them with addChild so i presume they stick in memory.
    Is there a way to safely remove them so that i free up memory every time  i remove Childs?
    Thank you.

    Take a look at this wonderful article about Resource Management in AS3.
    http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html
    Regards,
    CaioToOn!

  • HT5973 Is there any way to remove labels within Maps app?

    Is there any way to remove labels within Maps app?

    No - just don't upgrade until Google release there maps app.  I wish I could go back to yesterday and give myself this advice.

  • In LiveCycle Designer ES4 how do you remove tabs within a page once they have been created?

    In LiveCycle Designer ES4 how do you remove tabs within a page once they have been created?

    Emma,
    Take a look at the troubleshooting tips on this page from the Infosemantics website:
    http://www.infosemantics.com.au/adobe-captivate-widgets/drag-and-drop/troubleshooting-widg et-issues
    Pay particular attention to the section entitled: "My drag and drop question works correctly sometimes, but not other times. "
    From the appearance of your slide, it looks like you may have removed some of the components from the quiz slide that are necessary for it to function correctly.  Try the test that this section of the troubleshooting suggests so that you can see if this is the case.  If it turns out that you have deleted some items, you'll need to recreate your quiz slide to get them back again.
    Hope this helps.

  • OIM 11g R2  - Issue while removing child data

    Hi,
    We are facing the following issue when we try to submit a "Modify Account" request by removing all the child form data.The issue is there only if the child form contains attributes which are of type integer ,date etc (non-string).
    Steps followed
    ==========
    1.Create a Parent process form with an attribute ( For e.g Firstname)
    2.Create a Child process form with 3 attributes ( EmpID --> Integer , Date of Joining --> Date, Address --> String )
    3.Created a resource object
    4.Created a process definition and attached this resource object and parent form
    5.Created some process tasks (Create user,Child Data insert etc) and attached tcCompleteTask
    6.Provision this resource object to an user with one entry for child data.Since tcCompleteTask is attached,the status of the account now is "Provisioned"
    7.Click on "Modify Account" button and remove the child entry (so that there is no child entry presents ) and click on submit
    8.Getting an error in the UI saying "IAM-2050061:Type mismatch for the attribute EmpID.The type passed is string but the corresponding type in dataset is integer".
    Any idea onhow to solve this issue?.Thanks.

    This could be a bug. Try raising an SR. Also more logs if you can.

Maybe you are looking for

  • How to update fields in multiple tables ?

    Dear all, What is the fastest way to update fields in multiple tables... from a single change table...as below is my code to update the fields but it is taking long time to update as i need to keep log file if any one update fails.... CREATE OR REPLA

  • Can I adjust size of the photos on front page of the photo album template?

    When I am working on a Photo Album page, how can I make the "front page" photos larger? I am talking about the photos arranged in rows, not the photos that show in the slide show carousel. Is it a set size in the Photo Album template or is it a conse

  • Planning Layout: Environment-Specific Attributes

    Hello, In the following link, I find information about attributes in a planning layout: http://help.sap.com/saphelp_sem60/helpdata/en/38/021c0d3a5c473392a7147b941541b6/frameset.htm Does somebody know where I could change these attributes? Thanks for

  • Can not sign in on Android-viewer

    According to the DPS Bug Fix Release Notes, this issue is supposed to be solved: "Issue resolved in which the "Sign In" button does not appear in Entitlement viewers that do not have "Send App ID and Version" selected in Viewer Builder." http://helpx

  • Installing photoshop after having already installed premiere elements 11

    I have already installed premiere elements 11 and have tried to install photshop. throuble shoot told me to delete the two files and retry. I follow the directions exactly and delete the two files I was directed to and then try to reinstall photoshop