error #2025: addChaild and removeChild
Hi all
I have the app, but I had a problem
ArgumentError: Error # 2025: the supplied DisplayObject must be a child of the caller.
at flash.display: DisplayObjectContainer / removeChild)
to xxxxx_fla: MainTimeline / hitPoint)
my code
import flash.events.Event;
import flash.events.MouseEvent;
var pencilta:Shape = new Shape();
var activeColor:uint = 0 x 000000;
var aaa: a = new a();
AAA.x = 0;
AAA.y = 0;
addChild (aaa);
var bbb:c1 = new c1();
BBB.x = 308;
BBB.y = 108;
addChild (bbb);
var ccc:c2 = new c2();
CCC.x = 265;
CCC.y = 175;
addChild (ccc);
var ddd:c2 = new c2();
DDD.x = 235;
DDD.y = 260;
var eee: c2 = new c2();
EEE.x = 200;
EEE.y = 355;
bbb.addEventListener (MouseEvent.MOUSE_DOWN, hta1drag);
bbb.addEventListener (MouseEvent.MOUSE_UP, hta1drop);
bbb.addEventListener (Event.ENTER_FRAME, hitPoint);
function drawingta()
{
addChild (pencilta);
pencilta.graphics.lineStyle (10, activeColor);
}
function drawPencilta(e:MouseEvent):void
{
pencilta.graphics.lineTo (bbb.x, bbb.y);
e.updateAfterEvent ();
}
function hta1drag(e:MouseEvent):void
{
e.target.startDrag ();
pencilta.graphics.moveTo (bbb.x, bbb.y);
stage.addEventListener (MouseEvent.MOUSE_MOVE, drawPencilta);
drawingta();
}
function hta1drop(e:MouseEvent):void
{
stopDrag();
stage.removeEventListener (MouseEvent.MOUSE_MOVE, drawPencilta);
}
function hitPoint(e:Event)
{
If (bbb.hitTestPoint (ccc.x, ccc.y, true))
{
removeChild (ccc);
addChild (ddd);
}
ElseIf (bbb.hitTestPoint (ddd.x, ddd.y, true))
{
removeChild (ddd);
addChild (eee);
}
on the other
{
trace ("Benoit lah");
}
}
Thank you
use:
import flash.events.Event;
import flash.events.MouseEvent;
var pencilta:Shape = new Shape();
var activeColor:uint = 0 x 000000;
var aaa: a = new a();
AAA.x = 0;
AAA.y = 0;
addChild (aaa);
var bbb:c1 = new c1();
BBB.x = 308;
BBB.y = 108;
addChild (bbb);
var ccc:c2 = new c2();
CCC.x = 265;
CCC.y = 175;
addChild (ccc);
var ddd:c2 = new c2();
DDD.x = 235;
DDD.y = 260;
var eee: c2 = new c2();
EEE.x = 200;
EEE.y = 355;
bbb.addEventListener (MouseEvent.MOUSE_DOWN, hta1drag);
bbb.addEventListener (MouseEvent.MOUSE_UP, hta1drop);
bbb.addEventListener (Event.ENTER_FRAME, hitPoint);
function drawingta()
{
addChild (pencilta);
pencilta.graphics.lineStyle (10, activeColor);
}
function drawPencilta(e:MouseEvent):void
{
pencilta.graphics.lineTo (bbb.x, bbb.y);
e.updateAfterEvent ();
}
function hta1drag(e:MouseEvent):void
{
e.target.startDrag ();
pencilta.graphics.moveTo (bbb.x, bbb.y);
stage.addEventListener (MouseEvent.MOUSE_MOVE, drawPencilta);
drawingta();
}
function hta1drop(e:MouseEvent):void
{
stopDrag();
stage.removeEventListener (MouseEvent.MOUSE_MOVE, drawPencilta);
}
function hitPoint(e:Event)
{
If (bbb.hitTestPoint (ccc.x, ccc.y, true))
{
{if (CCC.stage)}
ccc.parent.removeChild (ccc);
CCC = null;?
}
addChild (ddd);
}
ElseIf (bbb.hitTestPoint (ddd.x, ddd.y, true))
{
{if (DDD.stage)}
ddd.parent.removeChild (ddd);
DDD = null;?
}
addChild (eee);
}
on the other
{
trace ("Benoit lah");
}
}
Thank you
Tags: Adobe Animate
Similar Questions
-
ArgumentError: Error #2025 - I can't removeChild?
function urunlergelsin (e:MouseEvent): void {}
var urunlermenum:urunlermenu = new urunlermenu();
bg.solurunmenusu.addChild (urunlermenum); / / Added a new
var geridonbuton:geridon = new geridon();
BG.geridonus_mc. AddChild (geridonbuton);
BG.geridonus_mc.addEventListener (MouseEvent.MOUSE_DOWN, geridon_f);
}
function geridon_f(e:MouseEvent):void {}
bg.urunbtn.removeEventListener (MouseEvent.MOUSE_DOWN, urunlergelsin);
BG.geridonus_mc. RemoveEventListener (MouseEvent.MOUSE_DOWN, geridon_f);
var urunlermenum:urunlermenu = new urunlermenu();
bg.solurunmenusu.removeChild (urunlermenum); / / But when I try to delete ro it does not work
}Hello
When I try to removeChild I get this error how can I solve this problem?
ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at avas_fla::MainTimeline/geridon_f()Your problem likely to be is to declare the object inside a function. It will be only worn within this function when you do this. I see where you create a new instance of the object in the function where I guess you are trying to remove the first class... the second is the only one seen at this point here, and it has not been added. Try the following:
var urunlermenum:urunlermenu; Declare it outside any function
function urunlergelsin (e:MouseEvent): void {}
urunlermenum = new urunlermenu();
bg.solurunmenusu.addChild (urunlermenum); / / Added a new
var geridonbuton:geridon = new geridon();
BG.geridonus_mc. AddChild (geridonbuton);
BG.geridonus_mc.addEventListener (MouseEvent.MOUSE_DOWN, geridon_f);
}function geridon_f(e:MouseEvent):void {}
bg.urunbtn.removeEventListener (MouseEvent.MOUSE_DOWN, urunlergelsin);
BG.geridonus_mc. RemoveEventListener (MouseEvent.MOUSE_DOWN, geridon_f);var urunlermenum:urunlermenu = new urunlermenu(); remove this
bg.solurunmenusu.removeChild (urunlermenum);}
-
Error 2025 and children with an ItemRenderer
Try to determine whether to add another element of custom to a list (using an itemRenderer) component depending on whether the list item clicked is in the last position
The component code
private void addPanel(event:Event):void {}
If {(event.target.selected)
this.parentApplication.addASWB (this);
}
}
The code in the application:
public void addASWB(aswb:ASWBox):void
{
var idx:int = getIdx (aswb as DisplayObject);
If (idx == (targetData.length - 1)) {}
var aswb2:ASWBox = new ASWBox();
targetData.push (aswb2);
cmp.dataProvider.refresh ();
}
}
public void getIdx(item:DisplayObject):int
{
Return cmp.getChildIndex (item);
}
I get the following error:
#2025: the supplied DisplayObject must be a child of the caller.
Is this a problem with the help of an itemRenderer for a list? Positions and index not accessible because of this or get an imperfect understanding of lists, the data suppliers and ItemRnderers?"... Positions and not accessible indexes... "Correct. You must work with the dataProvider only, you never can programmatically access an instance of point rendering engine. Well, you can, but it will be without any value.
Tracy -
Table 2D and removechild problem
Hello everyone
I have a problem with the removal of the children of moving table 2d (right to left). When the collision is detected chart repersenting the element disappears, but space is always busy, the collision occurs again. I get error 2025
The creation and removal of the table is lower at:
I have create table 2d:
Bricks = new Array();
brickContainer = new Sprite();
for (var cols: int = 0; passes < numCol; passes ++)
{
Bricks.push (new Array();
}
for (var col: int = 0; col < numCol; col ++)
{
for (var row: int = 0; line < numRow; line ++)
{
addBrick (col, row);
}
}
public void addBrick (int col, row: int)
{
var newBrick:Brick = new Brick();
newBrick.col = col;
newBrick.row = row.
newBrick.type = Math.ceil (Math.random () * 3);
newBrick.x = col * spaceX + offsetX;
newBrick.y = line * spaceY + offsetY;
newBrick.gotoAndStop (newBrick.type);
brickContainer.addChild (newBrick);
Bricks [col] [row] = newBrick;
}
addChild (brickContainer)
I move the items to the right on the left:
public void moveBricks(e:Event)
{
for (var row: int = 0; line < numRow; line ++)
{
for (var col: int = 0; col < numCol; col ++)
{
Brick .x-= [col] [rank] 5.
If (bricks [col] [line] .x + bricks [col] [rank] .width/2 < 0)
{
Bricks [col] [row] = rank there * spaceY + offsetY;
Bricks [col] [line] .x = (numCol-1) * spaceX + offsetX
}
}
}
}
And I check the collision
for (var row: int = 0; line < numRow; line ++)
{
for (var col: int = 0; col < numCol; col ++)
{
If (ball.hitTestObject (Bricks [Row] [col]))
{
If (ball.x + ball. Width/2 > = Bricks [col] [Row] .x-Bricks [col] [Row]. Width/2)
{
changes of ballDX * = - 1
}
If (ball.x + ball. Width/2 < = Bricks [col] [Row] .x + Bricks [col] [Row]. Width/2)
{
changes of ballDX * = - 1
}
If (ball.y + ball. Height/2 > = Bricks [col] [Row] there-Bricks [col] [Row]. Height/2)
{
ballDY * = - 1
}
If (ball.y + ball. Height/2 > = Bricks [col] [Row] there + Bricks [col] [Row]. Height/2)
{
ballDY * = - 1
}
brickContainer.removeChild (Bricks [row] [col]); The line throwing error 2025
}
}
}
You can assign this element in the table to be null. Then, before you pass through the hit test check if the brick is null or and only contiue to treat it if it is not null.
You could also let the single table and check if the child is in the use of brickContainer
{if (brickContainer.Contains (Bricks [Row] [col]))}
do all the hitesting and whatnot
-
question of action script 3: addChild and removeChild on the same key?
I'm doing a button when you click once, the movieclip is removed and second time to return to the stage, etc...
somehow I get this error
==================================
ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
at flash.display:DisplayObjectContainer/removeChild()
at sample_fla::MainTimeline/btnClick()
==================================
Can someone help me with this, because I do a web interactive for the customer and the deadline is close... Thanks in advance.
Here is my code:
///////////////////////////////////////////////////
Stop();
var swf:MovieClip;
var loader: Loader = new Loader();
var defaultswf:URLRequest = new URLRequest("./newSwfImport.swf");
default SWF loading
Loader.Load (defaultswf);
Add to the scene
allSwfLoadHere.addChild (loader);
var boolean: Boolean = true;
function btnClick(event:MouseEvent):void {}
if(boolean == true) {}
allSwfLoadHere.removeChild (loader);
Boolean == false
}
if(Boolean ==False) {}
allSwfLoadHere.addChild (loader);
Boolean == true
}
}
newSwfImport.addEventListener (MouseEvent.CLICK, btnClick);
//////////////////////////////////////////////////////
at least, you have two errors:
1. you don't have to use an if-else and
2. When you try to re - assign your boolean, you have tested. That is to say, you used == when you use =. Thus, your boolean is true. Then when you run the 2nd time, you try and delete something that has already been removed.
use:
var swf:MovieClip;
var loader: Loader = new Loader();
var defaultswf:URLRequest = new URLRequest("./newSwfImport.swf");
default SWF loading
Loader.Load (defaultswf);
Add to the scene
allSwfLoadHere.addChild (loader);
var boolean: Boolean = true;
function btnClick(event:MouseEvent):void {}
{if (Boolean)}
allSwfLoadHere.removeChild (loader);
} else {}
allSwfLoadHere.addChild (loader);
}
Boolean =! Boolean;
}
newSwfImport.addEventListener (MouseEvent.CLICK, btnClick);
//////////////////////////////////////////////////////
-
Gallery of images - ArgumentError: Error #2025
Hi guys,.
I'm new to flash cs3 and action script 3.0. I did 3 galleries of images, all work fine by themselves, however I recently tried to link them to a central flash file and I get the error:
ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at home_fla::MainTimeline/gotoHome()
I enclose the code for the central/home flash below file.
Basically, all I'm trying to achieve is to add the client_images.swf like a child when the customer images button is clicked and then listen to a click on the button home client_images and remove the child. This works if I click on the home button immediately. If I click on the home button with in 3 seconds, I get the error.
I had a good look for a solution to this problem and did not have much luck. Any help would be greatly appreciated. I can send the .fla if you need more information.
See you soon,.
Paul.
you are repeatedly executing the code in Image1 House and who is initially two instances of clientsLoader (among others) to exist. When you try to delete the most recently created one, it is not added to the display list, so it cannot be deleted.
to remedy this, put a stop() in frame 1 of the home.fla.
-
ArgumentError: Error #2025:
Hi, I created a game called Piggy Attack.
I am trying to remove some video clips off the stage.
I also tried adding them to the stage using as3, but it is not successful.
They all upward with the error code:
****************************************************************************************** *************
ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at Piggy_Attack_fla::MainTimeline/fl_st() [Piggy_Attack_fla. MainTimeline::frame3:67]****************************************************************************************** *************
Here's the code by removing...
If (p4.x < 90)
{
Speed = 0;
Speeda = 0;
speed3 = 0;
SPEED4 = 0;
mySound.stop ();
removeChild (p1);
removeChild (p2);
removeChild (p3);
removeChild (p4);
gotoAndStop (4);If anyone knows anything please please answer.
No, just that if you are using an ENTER_FRAME listener, you need to delete under this code, you have demonstrated to stop his execution. So, if you have a line of code somewhere that assigns this listener, similar to something like...
"SomeObject". addEventListener (Event.ENTER_FRAME, someFunction);
Then in the code you showed that you must include a line to remove it while it does not continue to try to remove the abducted children...
"SomeObject". removeEventListener (Event.ENTER_FRAME, someFunction);
-
addChild and removeChild with MouseEvent
Hello
I have a problem with addChild and removeChild.
I would like to add a child when a button is pressed and remove the child even when another button is pushed.
The code I'm working with does not work. (see attached code)
and this is the error message that I'll be back.
1120: access of undefined property Gallery.need to keep a reference to the Gallery outside the service
-
Unable to get Netflix on Firefox 39. says "unknown Player error" already uninstalled and re-installed silverlight
Thank you for the presentation of reports. HTTPS Everywhere is a great idea, but many sites that are not designed for HTTPS, it causes these mysterious problems.
-
Error in partition and data loss
While trying to partition my disk of 120 GB, that an error has occurred and my mac restarted and said, there was a mistake. Once it restarted, it showed that my drive is now 80 GB and 120 GB not and the other partition is not found.
OS X Terminal, please after the release of
Cs diskutil list
-
I can't download IOS 9.3.1 the download starts but then an error message appears and it stops. I have enough storage, so don't know why this is happening?
Does anyone else have this problem?
It often happens when the screen times out and goes to the lock screen, when I connect to my phone that the error message is re-appeared?
I have the same problem!
-
My iPad has completely turned off and cannot be restarted connect to iTunes on my Mac. He comes up with an error 3014 overtime and so can't do anything. Any ideas on what it takes then please.
Looks like you have jailbroken your iPad.
You must restore like new with another computer.
-
Error code = 16600 and error code = 17110
Error code = 16610 and error code = 17110
The child's account cannot check e-mail.
Your account is not ready.
It seems that your mother has finished setting up parental control for your account settings. Click "Access the parental control settings" to complete the process and access your account.Hotmail Setup incomplete.
Sorry there was a problem to apply your parental control settings to your Hotmail account. Try again later, go to your Hotmail account and follow the instructions.
Parent cannot delete the account:
Colton: Sorry, the service is not available now. Please try again later. Error code = 17110.
Colton: Your child Hotmail can not change immediately. We can send you a link to change the Hotmail settings, or you can try again later. Error code = 16600.
Family safety is NOT installed.
Primary school/Parent = account * address email is removed from the privacy *
Child account = * address email is removed from the privacy *
Does not work below:
When you remove your child from the parental control, your child's Hotmail settings could not update. We are sorry for this topic.
Update your child's Hotmail settings:
1. ask to connect with their Microsoft account.
2. ask to go to https://familysafety.microsoft.com/krl/hmnotify.aspx?p=OmaCuA3IIiM8WtcicpmFoCHjiR6rsa1 * oDgqRar4GKA6vMBO % 5EsudS % % 5EXf3ZQHYe 5Ep and follow the instructions on the screen.
If your child cannot always use Hotmail, please wait a few minutes and try again.
Thank you for using parental controls.
Hello
Please ensure that you use the latest version of the parental controls of Windows (16.4.3505.0912) for the child's computer. You can download the latest version in the link below:
http://Windows.Microsoft.com/en-us/Windows-Live/Essentials-home
Please let us know if the problem persists after you have installed the client.
Thank you!
-
What is error code 138266 and 0F00:0244 and 0F00:1F44 messages
the old computer crashed and comes with a blue screen saying reboot in safe mode, but that does not work. the analysis bed error code 138266 and two messages from 0F00:0244 and 0F00:1F44 indicating a block is inoperative. Does this mean the computer is more repairable or is there a way to address these problems. Thank you.
Hello
1. have there been recent changes to the computer before the show?
2. what operating system is installed on your computer?
Method 1: I suggest you try the steps from the link, which will help you resolve stop (blue screen) error in Windows 7
http://Windows.Microsoft.com/en-us/Windows7/resolving-stop-blue-screen-errors-in-Windows-7
(For Windows Vista)
Method 2: How to fix a computer that does not start.
http://Windows.Microsoft.com/en-us/Windows-XP/help/Setup/how-to-fix-computer-that-will-not-start
(For Windows XP)
Hope this information is useful.
-
I get the following error message when you try to access one of my hotmail accounts:
Internal Server Error - read the server has encountered an internal error or misconfiguration and was unable to respond to your request. Reference #3.269102cc.1330033628.4ef0aa7f.What is this error and how to fix it?Thanks EllieI get the same message... must be a problem with hotmail.
Maybe you are looking for
-
Mobile Firefox is unable to filter the results of google by date
I have mobile Firefox installed on my Nexus 4 side by side with Google Chrome browser. When I do a search on google in mobile Firefox I can't filter results by date, but I can't in Google Chrome browser. What Miss me? The function to filter the resul
-
The settings on my iPhone6 is frozen
Try checking out for the mail server but parameters is frozen. Unable to send mail. the answer read the user name or password is incorrect.
-
Toshiba virtual Store account Reset - 16291
HelloReset personal account 16291Thank you!
-
How can I use the speed dial on my Motorola W490?
How can I use the speed dial on my motorola W490? I have followed the instructions on the manual book, but did not work. The result, I received the screen is "unauthorized." Pls help. THX.
-
BlackBerry 10 Telus email settings for phone with T-Mobile SIM
Hello I have a Q10 which is normally on the Telus network. Spend time in TX I unlocked the Q10 and installed a T-Mobile SIM. Large. Got a TX, phone number and BBM and navigation work perfectly. But. Although my Telus email accounts allow all inco