Problem Removing Children

I'm having trouble removing some preloader movieclips I have inserted via AS3. The message I get is:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at btn5_fla::MainTimeline/thumbLoaded()
for every preloader a loaded, except the last one.
My code is:
import caurina.transitions.*;
var indexXML:XML;
var columns:Number;
var thumbWidth:Number;
var thumbHeight:Number;
var myThumbs:XMLList;
var totalThumbs:Number;
var preloader:LoaderAnim;
var container:MovieClip;
var xCounter:Number = 0;
var yCounter:Number = 0;
var xmlReq:URLRequest = new URLRequest("clientes.xml");
var xmlLoader:URLLoader = new URLLoader();
scrollbox.ch.client_info.autoSize = TextFieldAutoSize.LEFT;
scrollbox.ch.client_info.htmlText = "";
scrollbox.sb.visible = false;
scrollbox.sb.alpha = 0;
function urlLoaded(e:Event):void{
indexXML = new XML(e.target.data);
columns = indexXML.logos.@columns;
thumbWidth = indexXML.logos.@width;
thumbHeight = indexXML.logos.@height;
myThumbs = indexXML.logos.*;
totalThumbs = myThumbs.length();
scrollbox.ch.client_info.htmlText += indexXML.intro;
createContainer();
callThumbs();
function createContainer():void{
container = new MovieClip();
scrollbox.ch.addChild(container);
container.y = scrollbox.ch.client_info.height + scrollbox.ch.client_info.y + 20;
function callThumbs():void{
for(var i:Number = 0; i<totalThumbs; i++){
var thumbURL = myThumbs[i].@thumb;
trace("Loading "+thumbURL);
var thumbLoader = new Loader();
thumbLoader.load(new URLRequest(thumbURL));
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
thumbLoader.x = (thumbWidth+40)*xCounter;
thumbLoader.y = (thumbHeight+40)*yCounter;
if (xCounter+1 < columns){
xCounter++;
}else {
xCounter=0;
yCounter++;
preloader = new LoaderAnim();
preloader.name = "preloader"+i;
trace(preloader.name);
preloader.x = thumbLoader.x+30;
preloader.y = thumbLoader.y+30;
container.addChild(preloader);
function thumbLoaded(e:Event):void{
var thb:Loader = Loader(e.target.loader);
container.addChild(thb);
if(scrollbox.ch.height<scrollbox.masker.height){
scrollbox.sb.visible = false;
}else{
scrollbox.sb.visible = true;
Tweener.addTween(scrollbox.sb, {alpha:1, time:1});
container.removeChild(preloader);
xmlLoader.addEventListener(Event.COMPLETE, urlLoaded);
xmlLoader.load(xmlReq);

import caurina.transitions.*; 
var indexXML:XML;
var columns:Number;
var thumbWidth:Number;
var thumbHeight:Number;
var myThumbs:XMLList;
var totalThumbs:Number;
var i:uint=0;
var preloader:LoaderAnim;
var container:MovieClip;
var xCounter:Number = 0;
var yCounter:Number = 0;
var xmlReq:URLRequest = new URLRequest("clientes.xml");
var xmlLoader:URLLoader = new URLLoader();
scrollbox.ch.client_info.autoSize = TextFieldAutoSize.LEFT;
scrollbox.ch.client_info.htmlText = "";
scrollbox.sb.visible = false;
scrollbox.sb.alpha = 0;
function urlLoaded(e:Event):void{
indexXML = new XML(e.target.data);
columns = indexXML.logos.@columns;
thumbWidth = indexXML.logos.@width;
thumbHeight = indexXML.logos.@height;
myThumbs = indexXML.logos.*;
totalThumbs = myThumbs.length();
scrollbox.ch.client_info.htmlText += indexXML.intro;
createContainer();
callThumbs();
function createContainer():void{
container = new MovieClip();
scrollbox.ch.addChild(container);
container.y = scrollbox.ch.client_info.height + scrollbox.ch.client_info.y + 20;
function callThumbs():void{
//for(var i:Number = 0; i<totalThumbs; i++){
var thumbURL = myThumbs[i].@thumb;
trace("Loading "+thumbURL);
var thumbLoader = new Loader();
thumbLoader.load(new URLRequest(thumbURL));
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
thumbLoader.x = (thumbWidth+40)*xCounter;
thumbLoader.y = (thumbHeight+40)*yCounter;
if (xCounter+1 < columns){
xCounter++;
}else {
xCounter=0;
yCounter++;
preloader = new LoaderAnim();
preloader.name = "preloader"+i;
trace(preloader.name);
preloader.x = thumbLoader.x+30;
preloader.y = thumbLoader.y+30;
container.addChild(preloader);
function thumbLoaded(e:Event):void{
var thb:Loader = Loader(e.target.loader);
container.addChild(thb);
if(scrollbox.ch.height<scrollbox.masker.height){
scrollbox.sb.visible = false;
}else{
scrollbox.sb.visible = true;
Tweener.addTween(scrollbox.sb, {alpha:1, time:1});
container.removeChild(preloader);
i++;
if(i<totalThumbs){
callThumbs();
xmlLoader.addEventListener(Event.COMPLETE, urlLoaded);
xmlLoader.load(xmlReq);

Similar Messages

  • Problem removing children from within an event handler

    I'm trying to remove a movie clip from an onComplete handler.
    When I try to do this I get the following error
    "ArgumentError: Error #2025: The supplied DisplayObject must
    be a child of the caller."
    The point where my loader is complete is the time that I have
    to remove this movieclip.
    Would any body be able to tell me what the error means and
    help me with a way around it?
    Thanks
    dub

    You can always do it this way -- doesn't matter which display
    list the object is in.

  • Remove children of a branchGroup

    Hi,
    I have created a 3D scenary with Java3D. My problem is:
    For example, I create a 3D scenary which has 4 cube and I want two cubes dessapear if I click a button.
    To obtain it I have thought that when I click the button, execute removeAllChilldren function to remove the branchGroup with the 4 cubes. After add a new BranchGroup with only 2 cubes.
    But I have had capabilities problems (no capability to remove children) when I use removeAllChilldren function, maybe because if a BranchGroup has been compiled, it isn't posible to use that function.
    Anybody knows how I can obtain it? An easier way?
    Thanks in advance.

    You have to set the capability bits before the branchgroup is compiled (usually during instanciation?), then you should be able to remove and add elements to your heart's content.

  • Hi I am having problems removing mail from trash folder. Can anyone help please

    Hi I am having problems removing mail from trash folder. I can send mails to the folder but cannot delete them permanently from the trash folder. I am using Iphone 3G and anm up to date with OS. Can anyone help please

    Check that there isn't a different Trash folder to the one with the proper Trash symbol on it.
    If you see one in your list of folders rather than a separate one, highlight it, then click on Mailbox...Use this mailbox for...Trash

  • Problem removing a Exchange Federation Trust

    Hi, 
    I'm having a problem removing a Federation Trust.  I have removed the Organisation Relationship successfully. However when I go to remove the trust by Powershell  I get the following error
    [PS] C:\Windows\system32>remove-federationtrust "Microsoft Federation Gateway"
    Can't remove federation trust "Microsoft Federation Gateway". It's in use by the following organization(s): CN=Federation,CN=XXXXXX,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=XXXXX,DC=local
        + CategoryInfo          : InvalidOperation: (Microsoft Federation Gateway:ADObjectId) [Remove-FederationTrust], Or
       gsStillUsingThisTrustException
        + FullyQualifiedErrorId : A17E4A11,Microsoft.Exchange.Management.SystemConfigurationTasks.RemoveFederationTrusts
    I cant seem to make other changes to it either, I cant add a domain, remove domain.  I have seen references to delete the object in the Schema but dont really want to do that unless I know it wont cause other problems as I need to recreate this.
    Ian

    There are few things you need to make sure before you remove the federation, like permissions, TXT records etc.
    http://technet.microsoft.com/en-us/library/jj657500(v=exchg.150).aspx
    http://technet.microsoft.com/en-us/library/dd297972(v=exchg.141).aspx
    http://www.c7solutions.com/2012/03/fix-federation-trust-issues-after-html
    Cheers,
    Gulab Prasad
    Technology Consultant
    Blog:
    http://www.exchangeranger.com    Twitter:
      LinkedIn:
       Check out CodeTwo’s tools for Exchange admins
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Problem removing Zombie GS

    Hey all. Having a problem removing Zombie Gunship from my Game Center. Basically, I want to delete my current progress and start over, thanks to my nephew messing up my config.
    So, I've deleted Zombie GS and it prompts me to remove the data and that my progess will be removed from the leader boards. So I do all that, restart it, blah blah blah. After I've reinstalled the app, my old config/progress/money is still there.
    I've emailed the game company and of course no response. So what am I missing or doing wrong? Or is this a situation where I can never start over?
    Thanks in advance for the help.

    I've got the same problem. I am revisiting the game and I want to start again from scratch but it seems Game Center has other plans for me. Dammit Apple gestapo!

  • Problem removing files with CVS (JDeveloper 10.1.3 Preview)

    Hello,
    I've got a problem removing files from CVS :
    - I right-click on the file I want to remove -> Versioning -> Remove
    - The file is removed from local directory, and it appears in "Pending changes" view, on "Outgoing" tab. Its status is "scheduled for removal".
    - When I commit the file in the "Pending Changes" view, and click OK, then nothing happens. The file stay with "scheduled for removal" status, and it is not deleted on CVS server.
    I tried to commit the package or the project, but it's the same thing.
    Files additions and modifications work correctly.
    I'm using JDeveloper 10.1.3 Preview version.
    Is this a bug ? Or do I do something wrong ? Is there an other way to solve my problem ?
    Thanks.

    Here is the message displayed in the log window when I remove file (in Versioning menu) :
    C:\J2EE\Projets\budgetapptest\src\test\swm>
    $ <internal cvs client> remove -l Test_suppr_1.java
    cvs remove: scheduling `Test_suppr_1.java' for removal
    cvs remove: use 'cvs commit' to remove this file permanently
    Here is the message displayed in the log window when I COMMIT the "scheduled for removal" file :
    C:\J2EE\Projets\budgetapptest\src\test\swm>
    $ <internal cvs client> commit -F C:\DOCUME~1\19363~1.WIN\LOCALS~1\Temp\.jdevcvs_cmt22356.tmp Test_suppr_1.java
    cvs commit: Examining .
    Thanks.
    Message was edited by:
    user444728

  • Problem removing focused object from a table

    Hi.
    I have a problem removing a component that is focused from a table. The
    whole row is removed except a single component (JSpinner) in one row.
    My table has three columns, the first two are String fields
    (not editable) and the last is a JSpinner. Since there is no
    Default cell renderer or cell editor for JSpinner I had to
    create them.
    So, if no element of the row is focused then calling the function:
    public void clearTable() {
    setVisible(false);
    dataVector.removeAllElements(); // clear data vector
    setVisible(true);
    works just fine
    but if a spinner in a row is focused them that spinner is left alone "floating" on an otherwise empty table.
    Questions:
    1) Any one has an ideia of what might be the problem?
    2) Do I have to play with Focus to solve this? (hate the idea,
    since always been told to avoid messing with focus, because
    of the problems it normally brings)
    Thanks in advance for the help,
    Rgds,
    Jorge

    The problem is that you need to properly stop the editing operation first.if( myTable.isEditing() ) {
        // If you want to throw away any edits use...
        myTable.getCellEditor().cancelCellEditing();
        // If you want to apply any edits, then end use...
        myTable.getCellEditor().stopCellEditing();

  • Problem removing session attributes

    I have a problem removing session attributes
    I try w/ mysession.removeAttribute("key");
    but it still lives in memory. I've tried setAttribute("key", null) as the API states that will do the same thing, but it doesn't work.
    I can get mysession.invalidate() to work, but I want to keep some of the attributes there, while removing another.
    I get no exceptions and no errors.
    Help.
    Running Tomcat 4
    jre 1.3.1

    Actually,
    response.addHeader("Expires", "-1");should be enough.
    The browser should then contact the Web server for updates to that page via a conditional If-Modified-Since request. You don't want a cache disabling 'overkill', since you'd still want the page to remain in the disk cache and used in appropriate situations without contacting the remote Web server, such as when the BACK and FORWARD buttons are pressed...
    Anyway, try this first, and if it doesn't solve your problem, add the other cache-disabling headers, as outlined in the previous post.
    If you're using JSP, verify also that your page has
    <%@ page session="true"%>

  • Problem removing Listener Service in Clusterware 11g

    It appears that I already have a listener service as shown below, and I am having problem removing this service so that I can create another. I know that I can just add a new listener service for each node, though if anyone would share some insight on how I can remove this listener service ofr Oracle 11g Clusterware with two node cluster, I would appreciate your insight. Thanks
    rac1.respecti.com>./crs_resources.sh
    HA Resource Target State
    ora.rac1.gsd ONLINE ONLINE on rac1
    ora.rac1.ons ONLINE ONLINE on rac1
    ora.rac1.rac1.lsnr ONLINE ONLINE on rac1
    ora.rac1.vip ONLINE ONLINE on rac1
    ora.rac2.gsd ONLINE ONLINE on rac2
    ora.rac2.ons ONLINE ONLINE on rac2
    ora.rac2.rac2.lsnr ONLINE ONLINE on rac2
    ora.rac2.vip ONLINE ONLINE on rac2
    rac1.respecti.com>srvctl remove listener -n rac1 -l rac1
    PRKO-2203 : Listener is running on node: rac1
    rac1.respecti.com>srvctl stop listener -n rac1
    CRS-0210: Could not find resource 'ora.rac1.LISTENER_RAC1.lsnr'.
    rac1.respecti.com>

    Hi, Is there any tnslsnr process running on the node. To understand the problem better, enable the debug trace for the .lsnr resource. You can enable trace by executing the following command as root.
    crsctl debug log res "ora.rac1.LISTENER_RAC1.lsnr:5"
    crsctl debug log crs "CRSRTI:1,CRSCOMM:2,OCRSRV:4"
    Try to stop the listener.
    Examine the log files under CRS_HOME/log/$HOST/crsd/* and CRS_HOME/log/$HOST/racg/*
    Thanks & Regards
    -Harish Kalra

  • I am having problem removing sim from E51

    I have problems removing sim from my E51. it seems. its very tight there.

    Did you already try these steps?
    Restart the iPhone.
    Try another means of reaching the activation server and attempt to activate.
    Try connecting to a known-good Wi-Fi network if you're unable to activate using a cellular data connection.
    Try connecting to iTunes if you're unable to activate using Wi-Fi.
    Restore the iPhone.
    If you receive an alert message when you attempt to activate your iPhone, try to place the iPhone in recovery mode and perform a restore. If you're still unable to complete the setup assistant due to an activation error, contact Apple for assistance.
    copied from iOS: Troubleshooting activation issues

  • My HP2575 give's "Ink Cartridge Problem - Remove and check cartridge on right"-error

    Hello,
    I have a HP photosmart 2575 all-in-one. For just a couple of month's I use my black 339 cartridge and suddenly it give the error "Ink Cartridge Problem - Remove and check cartridge on right", with means the black cartridge. I always use original HP cartridges and have never filled them by myself or other people. Because the expire date is just a couple of weeks late, HP won't support me.  For now I put a new cartridge in the printer, with works fine. How can I solve this problem with my cartridge? It has enough ink for many prints to make, so I don't like to throw that away. I hope you can help me with tis matter.
    Thanks a lot.

    Hello Tom_Heitbrink. I have located a document you can follow to troubleshoot your issue. Let me know your troubleshooting results after following the document. I'm only here to help!
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c00427221&cc=us&dlc=en&lc=en&product=441240
    Mario
    I worked on behalf of HP.

  • Having problems removing tags from script.

    I'm not using the browser to run Adobe Story, but the Desktop version from my iMac.  Cmd + Double Click works, but once every 30 times.  Is anyone else having this problem removing tags from a script?

    There are other ways to remove tags from a script
    From Tagging Panel:
    - Open Tagging Panel from View Menu
    - Click on Edit button. Here you have the option to delete individual tag-items or remove all from the scene.
    From File Menu
    - Open File - Tagging menu
    Here you will find the options to delete all/manually added/automatically added tags.

  • JMS: problem removing JMSDestination

    I am having a problem removing and cleaning JMsDestination. I get an error "Error cleaning database during destination delete". Below youse the code
    Any thoughts?
    zbestquest
    Microsoft Windows 2000 [Version 5.00.2195]
    (C) Copyright 1985-1999 Microsoft Corp.
    D:\>cd j2sdkee1.3\bin
    D:\j2sdkee1.3\bin>j2eeadmin -listJdbcDatasource
    JdbcDatasource
    < JDBC Resource : jdbc/Cloudscape , jdbc:cloudscape:rmi:CloudscapeDB;create=true
    >
    < JDBC Resource : jdbc/DB1 , jdbc:cloudscape:rmi:CloudscapeDB;create=true >
    < JDBC Resource : jdbc/DB2 , jdbc:cloudscape:rmi:CloudscapeDB;create=true >
    < JDBC Resource : jdbc/InventoryDB , jdbc:cloudscape:rmi:CloudscapeDB;create=tru
    e >
    < JDBC Resource : jdbc/EstoreDB , jdbc:cloudscape:rmi:CloudscapeDB;create=true >
    D:\j2sdkee1.3\bin>j2eeadmin -listJmsDestination
    JmsDestination
    < JMS Destination : jms/Topic , javax.jms.Topic >
    < JMS Destination : jms/Queue , javax.jms.Queue >
    < JMS Destination : jms/Myqueue , javax.jms.Queue >
    < JMS Destination : jms/MyQueue , javax.jms.Queue >
    < JMS Destination : MyQueue , javax.jms.Queue >
    D:\j2sdkee1.3\bin>j2eeadmin -removeAllJmsDestination
    Error occurred: javax.jms.JMSException: Error cleaning database during destinati
    on delete
    D:\j2sdkee1.3\bin>j2eeadmin -removeJmsDestination jms/Queue
    Error occurred: javax.jms.JMSException: Error cleaning database during destinati
    on delete
    D:\j2sdkee1.3\bin>j2eeadmin -removeJmsDestination MyQueue
    Error occurred: javax.jms.JMSException: Error cleaning database during destinati
    on delete
    D:\j2sdkee1.3\bin>j2eeadmin -removeJmsDestination jms/Myqueue
    Error occurred: javax.jms.JMSException: Error cleaning database during destinati
    on delete
    D:\j2sdkee1.3\bin>

    Need help : Any JMS client I run, not able to send a message, I am suspecting there might be a problem with the JMSDestination. Any one run through this before?
    I am having a problem removing and cleaning
    JMsDestination. I get an error "Error cleaning
    database during destination delete". Below youse the
    code
    Any thoughts?
    zbestquest
    Microsoft Windows 2000 [Version 5.00.2195]
    (C) Copyright 1985-1999 Microsoft Corp.
    D:\>cd j2sdkee1.3\bin> D:\j2sdkee1.3\bin>j2eeadmin -listJmsDestination
    JmsDestination
    < JMS Destination : jms/Topic , javax.jms.Topic >
    < JMS Destination : jms/Queue , javax.jms.Queue >
    < JMS Destination : jms/Myqueue , javax.jms.Queue >
    < JMS Destination : jms/MyQueue , javax.jms.Queue >
    < JMS Destination : MyQueue , javax.jms.Queue >
    D:\j2sdkee1.3\bin>j2eeadmin -removeAllJmsDestination
    Error occurred: javax.jms.JMSException: Error cleaning
    database during destinati
    on delete
    D:\j2sdkee1.3\bin>j2eeadmin -removeJmsDestination
    jms/Queue
    Error occurred: javax.jms.JMSException: Error cleaning
    database during destinati
    on delete
    D:\j2sdkee1.3\bin>j2eeadmin -removeJmsDestination
    MyQueue
    Error occurred: javax.jms.JMSException: Error cleaning
    database during destinati
    on delete
    D:\j2sdkee1.3\bin>j2eeadmin -removeJmsDestination
    jms/Myqueue
    Error occurred: javax.jms.JMSException: Error cleaning
    database during destinati
    on delete
    D:\j2sdkee1.3\bin>

  • Adding and removing children with buttons

    So I've been following this tutorial (http://www.danfergusdesign.com/classfiles/oldClasses/VCB331-richMedia1/exercises/addingChi ldren.php) on how to add and remove children with buttons in order to create a popup box on the stage.
    The part I'm having trouble with is how I add the close button to the stage on top of the popup box.
    This is basically what I'm trying to do:
    Here's my code right now:
    var OrderPrepOnlineMenuInstance:OrderPrepOnlineMenu = new OrderPrepOnlineMenu();
    var mcOnStage:Boolean=false;
    loadOrderPrepOnlineBtn.addEventListener(MouseEvent.CLICK, loadMC);
    OrderPrepOnlineClose.addEventListener(MouseEvent.CLICK, removeMC);
    function loadMC(MouseEvent):void {
    addChild(OrderPrepOnlineMenuInstance);
    OrderPrepOnlineMenuInstance.x = 465;
    OrderPrepOnlineMenuInstance.y =230;
    mcOnStage=true;
    function removeMC(MouseEvent):void {
    if (mcOnStage ) {
    removeChild(OrderPrepOnlineMenuInstance);
    mcOnStage=false;

    Why not just make the close button part of the object you are adding.  You can assign it an event listener thru that object after it is created.

Maybe you are looking for

  • Cant launch SunMC windows JAVA console under Sun VirtualBox 2.0.0

    Hi, Has anyone managed to successfully launch the Java console under Sun VirtualBox? I'm using SunMC 3.6.1, Mac OS X 10.5.4 and Sun VirtualBox 2.0.0 When I attempt I get the usual messages "Connection establish. Authenticating user" "Login Successful

  • Not able to connect nokia lumia 510 with any other...

    Hi whenever I m connecting my Nokia lumia 51 with other mobile devices via Bluetooth it is showing not supported....please help me how can I connect to other mobile via Bluetooth

  • HT4623 My iPhone 5 crashed when doing an update to iOS 6.1!!!! What do I do???

    My phone shut off when updating to iOS 6.1 it won't turn back on!!!! It's been a while :-( help!!!!

  • KE30 Report - export

    Hi, I've created a report in KE31 with a form (KE34). 3 of columns are calculated. When I export the report to spreadsheet the last two columns are with empty values. If I export not all but a few characteristics these columns have values. Could it b

  • PGC error caused by subtitles

    I went to build a project and got the "PGC has an error at" error.  After re-encoding all the assets on the timeline and re-importing into Encore it built fine UNTIL i added the subtitles back into the mix.  I went to the time it said it had an error