ArgumentError: Error #2025: the supplied DisplayObject must be a child of the appellant
I get this error and I think I understand, but I look at my code and the enemy doesn't seem to be on the stage. The error is on the last line of the Enemy.as. It cannot remove the enemy display object as it seems that the scene is not like a child.
Main.As (instantiated enemy: enemy)
Enemy.As (contains the problem code) it is basically saying that the scene is not the enemy of display object.
I'll post the parts where the enemy is mentioned.
Main.As
private var enemy: enemy = new enemy (Stadium, Heroes);
...
for (var i: int = 0; i < 5; i ++)
{
enemy = new enemy (Stadium, Heroes);
Enemy.x = 100 + offsetEnemy;
enemyVector [i] = enemy; populate the vector with enemies.
addChild (enemy);
enemy.cacheAsBitmap = true;
}
Enemy.As
package
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;
import flash.display.Stage;
SerializableAttribute public class enemy extends MovieClip
{
private var stageRef:Stage;
private var vy:Number = 1; Speed y
private var ay: Number =. 1; acceleration of y
private var target: Hero;
public void enemy (stageRef:Stage, target: Hero): void
{
this.stageRef = stageRef;
This.target = target;
x = Math.Random () * stageRef.stageWidth;
y =-5;
addEventListener (Event.ENTER_FRAME, loop, false, 0, true);
}
private void loop(e:Event): void
{
Vy += ay;
y += vy;
If (y > stageRef.stageHeight)
removeSelf();
}
private void removeSelf(): void {}
removeEventListener (Event.ENTER_FRAME, loop);
If (stageRef.contains (this))
stageRef.removeChild (this);
}
}
}
If I add the enemy in the main class, while I would like to remove the enemy in the main class.
If you want the enemy to refer to the scene, and then use an ADDED_TO_STAGE event listener in the instantiation function and have sound handler to deal with anything whatsoever from the scene for this instance of treatment.
Do not use the same name for different instances of variables. You're not going anywhere the assignment of a variable to itself ("this" is the most often useless in AS3)...
this.stageRef = stageRef;
This.target = target;
Tags: Adobe Animate
Similar Questions
-
#2025 error: The supplied DisplayObject must be a child of the caller.
Hi all
I would appreciate help with this.
I'm working on a piece of flash that will play 4 videos, according to the key pressed. First button will launch the first video, 2e-2e video and so on. Once the video is done playing, close_btn, learn_more_btn and replay_btn appear, plus a final image that is different for each of the videos (BoxLivePic, BoxSleepPic and BoxFeelPic). So - in fact 4 things appear after the movie stops playing and the last image depends on a user has clicked on the buttons...
My question is, when I click on the close button (andI'm sure even apply for the other 2 buttons), I get the error below:
ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
at AER1_r5_fla::MainTimeline/closeVideo()I understand is actually that it's because each image is not added to the display list, unless it has clicked the appropriate button... However, I don't know how to fix it! I hope that this will make some sence - here is my Code... Thanks a bunch:
import com.greensock;
com.greensock.easing import. *;
import com.greensock.easing.CustomEase;
import com.greensock.loading.VideoLoader;
import flash.display.Sprite;
import com.greensock.events.LoaderEvent;import flash.display.MovieClip;
to import flash.display.SimpleButton;
import flash.events.MouseEvent;Last buttons Variables
var close_btn:Button_close = new Button_close();
var learn_more_btn:Button_learn_more = new Button_learn_more();
var replay_btn:Button_replay = new Button_replay();Last Pic Variables
var BoxLivePic:Box_Live_Pic = new Box_Live_Pic();
var BoxFeelPic:Box_Feel_Pic = new Box_Feel_Pic();
var BoxSleepPic:Box_Sleep_Pic = new Box_Sleep_Pic();Video Variables
var Video_Breathe:VideoLoader = new VideoLoader ("Breathe_Video.f4v", {container:,})
x: 0, y:0});
var Video_Live:VideoLoader = new VideoLoader ("Live_Video.f4v", {container:,})
x: 0, y:0});
var Video_Sleep:VideoLoader = new VideoLoader ("Sleep_Video.f4v", {container:,})
x: 0, y:0});
var Video_Feel:VideoLoader = new VideoLoader ("Feel_Video.f4v", {container:,})
x: 0, y:0});Video complete event listeners
Video_Breathe.addEventListener (VideoLoader.VIDEO_COMPLETE, donePlaying_breathe);
Video_Live.addEventListener (VideoLoader.VIDEO_COMPLETE, donePlaying_live);
Video_Sleep.addEventListener (VideoLoader.VIDEO_COMPLETE, donePlaying_sleep);
Video_Feel.addEventListener (VideoLoader.VIDEO_COMPLETE, donePlaying_feel);
OverwriteManager.init (OverwriteManager.AUTO);Invisible buttons
breathe_mc.learn_btn. Visible = false;
breathe_mc.video_btn. Visible = false;
live_mc.learn_btn. Visible = false;
live_mc.video_btn. Visible = false;
sleep_mc.learn_btn. Visible = false;
sleep_mc.video_btn. Visible = false;
feel_mc.learn_btn. Visible = false;
feel_mc.video_btn. Visible = false;
Custom acceleration
CustomEase.create ("myCustomEase", [{s: 0, cp:1.14999, e:1.4}, {s:1.4, cp:1.65, e: 1}]);
CustomEase.create("myCustomEase2",[{s:0,cp:0.97,e:1.22},{s:1.22,cp:1.47,e:1}]);var timeline:TimelineLite = new TimelineLite({onComplete:showBreathe});)
addChild (removeChild (better_mc));TweenLite.to (better_mc, 2, {alpha: 1, y: 186.6, ease:Bounce.easeOut});})
timeline.appendMultiple([)
TweenLite.to (breathe_mc, 1, {alpha: 1, y: 117, ease:CustomEase.byName ("myCustomEase2")});
TweenLite.to (live_mc, 1, {alpha: 1, y: 117, y: 37, ease:CustomEase.byName ("myCustomEase2")});
TweenLite.to (sleep_mc, 1, {alpha: 1, y: 77, ease:CustomEase.byName ("myCustomEase2")});
[TweenLite.to (feel_mc, 1, {alpha: 1, y: 77, ease:CustomEase.byName ("myCustomEase2")})], 1, TweenAlign.START,. (2);function showBreathe (): void
{
breathe_mc.learn_btn. Visible = true;
breathe_mc.video_btn. Visible = true;
TweenLite.to (breathe_mc.learn_btn,.5, {alpha: 1});
TweenLite.to (breathe_mc.video_btn,.5, {alpha: 1});TweenLite.to (breathe_mc, 1, {y: 77, ease:CustomEase.byName("myCustomEase")});})
Display text
TweenLite.to (breathe_txt_mc, 1, {alpha: 1});
}Event listeners
breathe_mc.addEventListener (MouseEvent.MOUSE_OVER, breatheOpen);
live_mc.addEventListener (MouseEvent.MOUSE_OVER, liveOpen);
sleep_mc.addEventListener (MouseEvent.MOUSE_OVER, sleepOpen);
feel_mc.addEventListener (MouseEvent.MOUSE_OVER, feelOpen);
For the video game event listeners
breathe_mc.video_btn.addEventListener (MouseEvent.MOUSE_DOWN, breathe_play_video);
live_mc.video_btn.addEventListener (MouseEvent.MOUSE_DOWN, live_play_video);
sleep_mc.video_btn.addEventListener (MouseEvent.MOUSE_DOWN, sleep_play_video);
feel_mc.video_btn.addEventListener (MouseEvent.MOUSE_DOWN, feel_play_video);Event listener for the close video
close_btn.addEventListener (MouseEvent.MOUSE_DOWN, closeVideo);Functions of the buttons of the VIDEO and find OUT more
function breathe_play_video(event:MouseEvent):void {}
Video_Breathe.load ();
this.addChild (Video_Breathe.content);
}function live_play_video(event:MouseEvent):void {}
Video_Live.load ();
this.addChild (Video_Live.content);
}
function sleep_play_video(event:MouseEvent):void {}
Video_Sleep.load ();
this.addChild (Video_Sleep.content);
}
function feel_play_video(event:MouseEvent):void {}
Video_Feel.load ();
this.addChild (Video_Feel.content);
}
function closeVideo(event:MouseEvent):void {}
Video_Breathe.Unload ();
Video_Sleep.Unload ();
Video_Feel.Unload ();
Video_Live.Unload ();
removeChild (close_btn);
removeChild (learn_more_btn);
removeChild (replay_btn);
removeChild (BoxLivePic);
removeChild (BoxSleepPic);
removeChild (BoxFeelPic);
}
Finally breathe buttons added to the stage
function donePlaying_breathe(e:Event):void {}
addChild (close_btn);
addChild (learn_more_btn);
addChild (replay_btn)
close_btn.x = 313;
close_btn.y = 183;
learn_more_btn.x = 434;
learn_more_btn.y = 183;
replay_btn.x = 554;
replay_btn.y = 183;
}Last direct buttons
function donePlaying_live(e:Event):void {}
addChild (BoxLivePic);
addChild (close_btn);
addChild (learn_more_btn);
addChild (replay_btn)
close_btn.x = 43;
close_btn.y = 183;
learn_more_btn.x = 164;
learn_more_btn.y = 183;
replay_btn.x = 284;
replay_btn.y = 183;
}Last sleep buttons
function donePlaying_sleep(e:Event):void {}
addChild (BoxSleepPic);
addChild (close_btn);
addChild (learn_more_btn);
addChild (replay_btn)
close_btn.x = 313;
close_btn.y = 183;
learn_more_btn.x = 434;
learn_more_btn.y = 183;
replay_btn.x = 554;
replay_btn.y = 183;
}Latest sensation buttons
function donePlaying_feel(e:Event):void {}
addChild (BoxFeelPic);
addChild (close_btn);
addChild (learn_more_btn);
addChild (replay_btn)
close_btn.x = 313;
close_btn.y = 183;
learn_more_btn.x = 434;
learn_more_btn.y = 183;
replay_btn.x = 554;
replay_btn.y = 183;
}
Functions of breathing
function breatheOpen(event:MouseEvent):void
{
TweenLite.to (breathe_mc, 1, {y: 77, ease:Elastic.easeOut});})
TweenLite.to (breathe_mc.learn_btn,.5, {alpha: 1});
TweenLite.to (breathe_mc.video_btn,.5, {alpha: 1});
Live close
TweenLite.to (live_mc, 1, {y: 117, ease:Elastic.easeOut});})
TweenLite.to (live_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (live_mc.video_btn,.5, {alpha: 0});
Close the sleep
TweenLite.to (sleep_mc, 1, {y: 77, ease:Elastic.easeOut});})
TweenLite.to (sleep_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (sleep_mc.video_btn,.5, {alpha: 0});
Feel close
TweenLite.to (feel_mc, 1, {y: 77, ease:Elastic.easeOut});})
TweenLite.to (feel_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (feel_mc.video_btn,.5, {alpha: 0});
See photo
TweenLite.to (pic_breathe_mc,.5, {alpha: 1});
Hide other photos
TweenLite.to (pic_live_mc,.5, {alpha: 0});
TweenLite.to (pic_sleep_mc,.5, {alpha: 0});
TweenLite.to (pic_feel_mc,.5, {alpha: 0});
Display text
TweenLite.to (breathe_txt_mc, 1, {alpha: 1});
Hide other texts
TweenLite.to (live_txt_mc, 1, {alpha: 0});
TweenLite.to (sleep_txt_mc, 1, {alpha: 0});
TweenLite.to (feel_txt_mc, 1, {alpha: 0});
}Live functions
function liveOpen(event:MouseEvent):void
{
TweenLite.to (live_mc, 1, {y: 77, ease:Elastic.easeOut});})
live_mc.learn_btn. Visible = true;
live_mc.video_btn. Visible = true;
TweenLite.to (live_mc.learn_btn,.5, {alpha: 1});
TweenLite.to (live_mc.video_btn,.5, {alpha: 1});
Close to breathe
TweenLite.to (breathe_mc, 1, {y: 117, ease:Elastic.easeOut});})
TweenLite.to (breathe_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (breathe_mc.video_btn,.5, {alpha: 0});
Close the sleep
TweenLite.to (sleep_mc, 1, {y: 77, ease:Elastic.easeOut});})
TweenLite.to (sleep_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (sleep_mc.video_btn,.5, {alpha: 0});
Feel close
TweenLite.to (feel_mc, 1, {y: 77, ease:Elastic.easeOut});})
TweenLite.to (feel_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (feel_mc.video_btn,.5, {alpha: 0});
See photo
TweenLite.to (pic_live_mc,.5, {alpha: 1});
Hide other photos
TweenLite.to (pic_sleep_mc,.5, {alpha: 0});
TweenLite.to (pic_feel_mc,.5, {alpha: 0});
Display text
TweenLite.to (live_txt_mc, 1, {alpha: 1});
Hide other texts
TweenLite.to (breathe_txt_mc, 1, {alpha: 0});
TweenLite.to (sleep_txt_mc, 1, {alpha: 0});
TweenLite.to (feel_txt_mc, 1, {alpha: 0});
}
Sleep functions
function sleepOpen(event:MouseEvent):void
{
TweenLite.to (sleep_mc, 1, {y: 37, ease:Elastic.easeOut});})
sleep_mc.learn_btn. Visible = true;
sleep_mc.video_btn. Visible = true;
TweenLite.to (sleep_mc.learn_btn,.5, {alpha: 1});
TweenLite.to (sleep_mc.video_btn,.5, {alpha: 1});
Close to breathe
TweenLite.to (breathe_mc, 1, {y: 117, ease:Elastic.easeOut});})
TweenLite.to (breathe_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (breathe_mc.video_btn,.5, {alpha: 0});
Live close
TweenLite.to (live_mc, 1, {y: 117, ease:Elastic.easeOut});})
TweenLite.to (live_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (live_mc.video_btn,.5, {alpha: 0});
Feel close
TweenLite.to (feel_mc, 1, {y: 77, ease:Elastic.easeOut});})
TweenLite.to (feel_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (feel_mc.video_btn,.5, {alpha: 0});
See photo
TweenLite.to (pic_sleep_mc,.5, {alpha: 1});
Hide other photos
TweenLite.to (pic_feel_mc,.5, {alpha: 0});
Display text
TweenLite.to (sleep_txt_mc, 1, {alpha: 1});
Hide other texts
TweenLite.to (live_txt_mc, 1, {alpha: 0});
TweenLite.to (breathe_txt_mc, 1, {alpha: 0});
TweenLite.to (feel_txt_mc, 1, {alpha: 0});
}Feeling of functions
function feelOpen(event:MouseEvent):void
{
TweenLite.to (feel_mc, 1, {y: 37, ease:Elastic.easeOut});})
feel_mc.learn_btn. Visible = true;
feel_mc.video_btn. Visible = true;
TweenLite.to (feel_mc.learn_btn,.5, {alpha: 1});
TweenLite.to (feel_mc.video_btn,.5, {alpha: 1});
Close to breathe
TweenLite.to (breathe_mc, 1, {y: 117, ease:Elastic.easeOut});})
TweenLite.to (breathe_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (breathe_mc.video_btn,.5, {alpha: 0});
Live close
TweenLite.to (live_mc, 1, {y: 117, ease:Elastic.easeOut});})
TweenLite.to (live_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (live_mc.video_btn,.5, {alpha: 0});
Close the sleep
TweenLite.to (sleep_mc, 1, {y: 77, ease:Elastic.easeOut});})
TweenLite.to (sleep_mc.learn_btn,.5, {alpha: 0});
TweenLite.to (sleep_mc.video_btn,.5, {alpha: 0});
See photo
TweenLite.to (pic_feel_mc,.5, {alpha: 1});
Display text
TweenLite.to (feel_txt_mc, 1, {alpha: 1});
Hide other texts
TweenLite.to (live_txt_mc, 1, {alpha: 0});
TweenLite.to (sleep_txt_mc, 1, {alpha: 0});
TweenLite.to (breathe_txt_mc, 1, {alpha: 0});
}This error means that you are trying to access an object on the display (object) list is not there.
For example, if the instance of close_btn is not added as a child, the following line will throw this error:
removeChild (close_btn);
One of the ways to remedy this situation is to confirm that the object is added:
If (Contains (close_btn)) removeChild (close_btn);
-
Hello
I have some difficulty to the dynamic addition of user interface controls. For the most part with radio buttons.
Here is an example that illustrates my problem:
< s:Application
' xmlns:fx = ' http://ns.Adobe.com/MXML/2009 "
xmlns:s = "library://ns.adobe.com/flex/spark".
xmlns:MX = "library://ns.adobe.com/flex/mx".
creationPolicy = "all".
>
< fx:Script >
<! [CDATA]
Import mx.containers.Form;
Import mx.containers.Panel;
Import mx.controls.Label;
Import mx.controls.NumericStepper;
Import mx.controls.RadioButton;private var theChar:String = 'B ';.
protected function btnAdd_clickHandler(event:MouseEvent):void
{
var theForm:Form = new Form();
theForm.label = theChar;
1 label
var myLabel:Label = new Sun;
MyLabel.set_Text = "My Label";
myLabel.width = 120;
theForm.addChild (myLabel);
2. digital stepper
var myNumStepper:NumericStepper = new NumericStepper();
myNumStepper.id = "numPointHigh" + theChar;
myNumStepper.name = "numPointHigh" + theChar;
myNumStepper.minimum = 0;
myNumStepper.maximum = 120;
myNumStepper.width = 50;
myNumStepper.height = 30;
theForm.addChild (myNumStepper);
3. radio button
var myRadioButton:RadioButton = new RadioButton;
myRadioButton.id = "myRadioButton" + theChar;
myRadioButton.name = "myRadioButton" + theChar;
myRadioButton.label = "my button";
myRadioButton.selected = true;
theForm.addChild (myRadioButton);
4. expert group
var thePanel:Panel = new Panel();
thePanel.width = 300;
thePanel.height = 475;
thePanel.name = theChar;
thePanel.title = 'my profile sign ';
thePanel.setStyle ("backgroundColor", "blue");
Add the shape in the Panel
thePanel.addChild (theForm);
Add the Panel to the list control
myList.addChild (thePanel);
}
protected function btnClear_clickHandler(event:MouseEvent):void
{
var numChildren:Number = myList.numChildren;
for (var i: Number = numChildren - 1; i > - 1; i--) {}
myList.removeChildAt (i);
}
}
[]] >
< / fx:Script >
< mx:VBox width = "100%" >
< mx:List id = "myList" / >
< mx:Button id = "btnAdd" label = "Add a Panel" click = "btnAdd_clickHandler (event)" color = "black" / > "
< mx:Button id = "btnClear" label = "Clear" click = "btnClear_clickHandler (event)" color = "black" / > "
< / mx:VBox >
< / s:Application >^ Running. Click on the button "add a Panel." Then click on "delete". Then click again on the button "add a Panel." You will see the error:
ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/getChildIndex()
at mx.core::Container/getChildIndex() [E:\dev\4.0.0\frameworks\projects\framework\src\mx\core \Container.as:2833]
at mx.containers::Panel/getChildIndex() [E:\dev\4.0.0\frameworks\projects\framework\src\mx\co ntainers\Panel.as:1174]
at mx.controls::RadioButtonGroup/breadthOrderCompare() [E:\dev\4.0.0\frameworks\projects\fram ework\src\mx\controls\RadioButtonGroup.as:600]
at mx.controls::RadioButtonGroup/breadthOrderCompare() [E:\dev\4.0.0\frameworks\projects\fram ework\src\mx\controls\RadioButtonGroup.as:611]
at mx.controls::RadioButtonGroup/breadthOrderCompare() [E:\dev\4.0.0\frameworks\projects\fram ework\src\mx\controls\RadioButtonGroup.as:611]
to Array$ / _sort)
table / http://Adobe.com/AS3/2006/builtin:sort ()
to mx.controls::RadioButtonGroup / http://www.Adobe.com/2006/Flex/MX/internal:addInstance ([E:\dev\4.0.0\frameworks\projects \framework\src\mx\controls\RadioButtonGroup.as:465])
at mx.controls::RadioButton/addToGroup() [E:\dev\4.0.0\frameworks\projects\framework\src\mx\c ontrols\RadioButton.as:574]
at mx.controls::RadioButton/commitProperties() [E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\controls\RadioButton.as:514]
at mx.core::UIComponent/validateProperties() [E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
at mx.managers::LayoutManager/validateProperties() [E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
at mx.managers::LayoutManager/doPhasedInstantiation() [E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:730]
at mx.managers::LayoutManager/doPhasedInstantiationCallback() [E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]I don't understand why I can't add the option button? If you comment out the code for the button of the radio (comment #3 of the article) you can easily add the panels. It happens only when I have radio buttons is added to the form/Panel.
Why this is happening and how to fix it? Why is this only happening radio button? I thought that I had this problem
I have responded on the stack overflow. Make sure your Radio buttons are in a group of Radio buttons and your error disappears.
-
The supplied DisplayObject must be a child of the appellant please help!
Hi hope someone can help me with this.
IM child added to a bg MovieClip
----------------------------------------------
for (var i: int = 1; i < = cols; i ++)
{
for (int var q = 1; q < = lines; q ++)
{
var random_card = Math.floor (Math.random () * colordeck.length);
tile = new colors();
tile.width = widthvar;
tile.height = widthvar;
tile.col = colordeck [random_card];
colordeck.splice(random_card,1);
tile.gotoAndStop (9);
tile.x = (i +. 2) * xvar;
tile.y = (q + adjust) * yvar.
tile.addEventListener (MouseEvent.CLICK, tile_clicked);
bg.addChild (tile);
}
}
------------------------------------------
When I removeChild (bg) it does not remove its children and dear I addChild (bg) again
He adds more children on top.
How can I remove these BG?
I tried:
----------------------------------------
If (bg.contains (tile))
{
for (var i: int = 1; i < = cols; i ++)
{
for (int var q = 1; q < = lines; q ++)
{
bg.removeChild (tile);
}
}
}
---------------------------------
but get an error:
ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/removeChild()
If you can help id rly appriciate it
THX pavel
You can also use some methods such as:
for (i = mc.numChildren - 1; i > = 0; i--) {}
trace (MC.getChildAt (i). (Name)
mc.removeChildAt (i);
}
-
I have a button that creates mc what mouse downwards and remove it when the mouse upwards.
can someone tell me why I get this error and how to fix it.
the error only appears when I repeat the mouse down.
Thank you
import flash.events.Event;
brown.addEventListener (MouseEvent.MOUSE_DOWN, GB)
function createCircle (xx:Number, yy:Number, d: Number, color: number live: Boolean = true)
{
brown.addEventListener (MouseEvent.MOUSE_UP, goo)
var mc:MovieClip = new MovieClip
mc.addEventListener (Event.ENTER_FRAME, kav);
mc.addEventListener (MouseEvent.MOUSE_UP, goo);
MC.visible = live;
mc.buttonMode = true;
addChild (mc);
mc.graphics.beginFill (color);
mc.graphics.drawCircle (xx, yy, d);
function kav(e:Event) {}
MC.y-= 0.2
}
function goo (MouseEvent) {}
removeChild (mc)
}
}
function GB (MouseEvent) {}
createCircle (250,200,Math.random () * 40 + 10, Math.random () * 0xFFFFFF)
}
When you create an object, there is, and by using addChild it simply brings in the display list. Using removeChild removes it from the display list, but it's not the object disappear... it still exists, you just can't see. So the next time you make one event MOUSE_UP, you try to remove a child who has already been deleted.
When you work with listeners and dynamic objects, you should remove listeners when you delete objects.
Another thing, you shouldn't nest named within the functiions functions.
-
Hi guys, I'm fairly new to as3 and I'm doing a game where the player clicks on so-called onstage and 3 towers which I generated dynamically must pull the space. Everything works on the plane of rotation of the Tower, etc., but bullets will not be removed from the scene when I leave the level in another scene. Control of the border is fine, also.
Here is a part of the code in the Main.as file.
private function clickTower1(e:MouseEvent):void
{
for each (var tower1:mcTower1 in tower1Array)
{
var newLaser1:mcLaser1 = new mcLaser1();
newLaser1.rotation = tower1.rotation;
newLaser1.x = tower1.x + Math.cos(newLaser1.rotation * Math.PI / 180) * 40;
newLaser1.y = tower1.y + Math.sin(newLaser1.rotation * Math.PI / 180) * 40;
newLaser1.addEventListener(Event.ENTER_FRAME, laser1Handler);
tower1BulletArray.push(newLaser1); stage.addChild(newLaser1);
}
}
private function laser1Handler(e:Event):void
{
//Make laser move in direction of turret.
var newLaser1:MovieClip = e.currentTarget as MovieClip;
newLaser1.x += Math.cos(newLaser1.rotation * Math.PI / 180) * laser1Speed;
newLaser1.y += Math.sin(newLaser1.rotation * Math.PI / 180) * laser1Speed;
//Boundary checking if (newLaser1.x < -50 || newLaser1.x > 800 || newLaser1.y > 600 || newLaser1.y < -50)
{
newLaser1.removeEventListener(Event.ENTER_FRAME, laser1Handler); stage.removeChild(newLaser1);
tower1BulletArray.splice(0, 1);
}
}I have a function called exitLevel, coming out, as its name suggests, the level when a button is clicked. It worked perfectly before you start coding the bullets.
private function exitLevel(e:MouseEvent):void
{
stage.frameRate = 6;
gamePaused = false;
clearLevel();
gotoAndStop(1, 'exitLevel');
btnExitLevel.addEventListener(MouseEvent.CLICK, levelSelect1);
}
private function clearLevel():void
{
stage.removeEventListener(Event.ENTER_FRAME, update);
stage.removeChild(buttonCreep1); stage.removeChild(buttonCreep2);
for (var i = creep1Array.length - 1; i >= 0; i--)
{
removeChild(creep1Array[i]);
creep1Array.splice(i, 1);
//trace ("Creep1 Removed");
}
for (var j = creep2Array.length - 1; j >= 0; j--)
{
removeChild(creep2Array[j]);
creep2Array.splice(j, 1);
//trace ("Creep2 Removed");
}
for (var k = tower1Array.length - 1; k >= 0; k--)
{
removeChild(tower1Array[k]); tower1Array.splice(k, 1);
}
for (var l = tower1BulletArray.length - 1; l >= 0; l--)
{
stage.removeChild(tower1BulletArray[l]);
tower1BulletArray.splice(0, 1);
}
}After debugging, it is said that the error is at the end, where I'm trying to remove the child from the scene. What's wrong? Sorry, I'm a newbie to as3, so the answers could be gave... I'll try to learn and understand, however. Thank you!
I took the code out of a guide on the web, and I do not fully understand, then someone can explain to me what this code does as well? What is e.currentTarget? Thank you!
var newLaser1:MovieClip = e.currentTarget as MovieClip;
Here is the .as file full if someone wants to take a look. http://pastebin.com/5ff4BQa5
If fleas are still on the screen, you or the other
1. did you not run this code just before the change of scene or
2 Add bullets to the displaylist without adding to tower1BulletArray or
3. continue to add chips to the displaylist after this code executes
-
Hi guys I am pullying my hair since 2 days
Plese help me
Is my document class
package
{
import flash.display.MovieClip;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
/public class Main extends MovieClip
{
scrollerBg:ScrollerBg private var;
public void Main()
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP;
scrollerBg = new ScrollerBg();
addChild (scrollerBg);
scrollerBg.x = 39;
scrollerBg.y = 572;
}
}
}
My ScrollerBg is connect to this class
package com.elements
{
import flash.display.MovieClip;
import LeftArrow.
import RightArrow;
import flash.display.Sprite;
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.ProgressEvent;
import flash.events.IOErrorEvent;
import com.elements.PreloaderObject;
import com.greensock.TweenMax;
/public class Scrollercontainer extends MovieClip
{
leftArrow:LeftArrow private var;
rightArrow:RightArrow private var;
scrollerBg:Sprite private var;
scrollerMask:Sprite private var;
private var xmlPath:String = "xml/scroller.xml.
xmlLoader:URLLoader private var;
private var preloader: PreloaderObject;
public static var bgImage:Array;
public static var thumbImage:Array;
public static var labelArray:Array;
xmlData:XML private var;
public void Scrollercontainer()
{
addEventListener (Event.ADDED_TO_STAGE, onAddedtoStageHandeler, false, 0, true);
}
onAddedtoStageHandeler(evt:Event):void private function
{
scrollerBg = new Sprite();
scrollerBg.graphics.beginFill (0 x 000000, 1);
scrollerBg.graphics.drawRect (0,0,865,78);
scrollerBg.graphics.endFill ();
addChild (scrollerBg);
scrollerBg.x = 28;
scrollerBg.y = 13;
scrollerMask = new Sprite();
scrollerMask.graphics.beginFill (0 x 000000, 1);
scrollerMask.graphics.drawRect (0,0,865,78);
scrollerMask.graphics.endFill ();
addChild (scrollerMask);
scrollerMask.x = 28;
scrollerMask.y = 13;
scrollerBg.mask = scrollerMask;
left arrow = new LeftArrow();
leftArrow.x = 14;
leftArrow.y = 44;
leftArrow.buttonMode = true;
addChild (leftArrow);
right arrow = new RightArrow();
rightArrow.x = 901.
rightArrow.y = 44;
rightArrow.buttonMode = true;
addChild (rightArrow);
lodXMLinit();
}
private function lodXMLinit (): void
{
bgImage = new Array();
thumbImage = new Array();
labelArray = new Array();
xmlLoader = new URLLoader();
xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
xmlLoader.load (new URLRequest (xmlPath));
preloader = new PreloaderObject();
preloader.buildPreloader ();
}
xmlLoaded(evt:Event):void private function
{
xmlData = new XML (evt.target.data);
var xmlList:XMLList = xmlData.slide;
var point: XML;
/ / trace (xmlList.toXMLString ());
for each (xmlList)
{
bgImage.push (item.slide);
thumbImage.push (item.thumbImage);
labelArray.push (item.label);
}
/ / trace(thumbImage[1]);
buildThumbScroller();
}
private function buildThumbScroller (): void
{
for (var i: int = 0; i < thumbImage.length; i ++)
{
var thumbBackground:MovieClip = new MovieClip();
var thumbImgeBackground:Sprite = new Sprite();
thumbImgeBackground.graphics.beginFill(0xffffff,1);
thumbImgeBackground.graphics.drawRect (0,0,100,78);
thumbImgeBackground.graphics.endFill ();
thumbBackground.addChild (thumbImgeBackground);
thumbBackground.x (100 + 20) = * i;
thumbBackground.indexs = i;
thumbBackground.src = thumbImage [i];
thumbBackground.buttonMode = true;
var preloader: PreloaderObject = new PreloaderObject();
preloader.name = String (i);
preloader.buildPreloader ();
var imageContainer:Sprite = new Sprite();
var thldr:Loader = new Loader();
thldr.contentLoaderInfo.addEventListener (Event.OPEN, pairs loadStarted);
thldr.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);
thldr.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, showProgress);
thldr.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, onError);
thldr.load (new URLRequest (thumbBackground.src));
imageContainer.addChild (thldr);
thumbBackground.addChild (imageContainer);
scrollerBg.addChild (thumbBackground);
}
}
loadStarted(evt:Event):void private function
{
trace (this); Traces [object ScrollerBg];
this.addChild (preloader);
}
imageLoaded(evt:Event):void private function
{
}
showProgress(evt:ProgressEvent):void private function
{
/ / trace (this);
var percent: Number = (1.0 / evt.bytesTotal) * evt.bytesLoaded;
/ / trace (percent);
si (p == 1)
{
this.removeChild (preloader); Here's my problem when it draws traces [object ScrollerBg];
}
else
{
preloader.loadBar.width = stage.stageWidth * per cent;
}
}
onError(evt:IOErrorEvent):void private function
{
}
}
}
and my Preloader object class is the following
package com.elements
{
import flash.display.MovieClip;
import flash.display.Shape;
/public class PreloaderObject extends MovieClip
{
public var loadBar:Shape;
public void PreloaderObject()
{
}
buildPreloader(color:uint_=_0xffccdd,height:uint_=3):void of the public service
{
Gauge = new Shape();
loadBar.graphics.beginFill(color,1);
loadBar.graphics.drawRect (0.0,0.0,100,100);
loadBar.graphics.endFill ();
loadBar.width = 0.0;
loadBar.height = height;
addChild (loadBar);
}
}
}
Here, I want to show the preloader on each thumbloading processWhen tracing both parent show is the same but preloader does not work please help meThanks in advanceThis is not going to work.
you have a problem with your logic. you have a preloader. you have several objects that you load into a loop for. the first object will finish loading, preloader is removed and then the next object end of loading.
1. There is no preloader displaying prices charge when the first object is completed loading
2. the preloader first shows the load progress of the first object only, not the load course of whatever it is you want to load
3. the error of you know: preloader seeks to be removed, after it is already deleted.
If you don't like about 1 and 2 do not resolve your issue, use the code that I suggested in my first post:
{if (preloader.stage)}
this.removeChild (preloader);
}
If you want to display the load progress of the rest of the loop for loads, you will need to decide what exactly you want to display.
-
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);
-
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);}
-
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.
-
I'm bit confused about ANE generation, I'm already all direction, but the error always #3500 when I try to call the DONKEY.
I create NSAS using java android.
The tools I use: Flash Builder running on Win-64 win.7. I think I have to, right to the point, here, what I did first step by step;
1. I create the JAVA application first, with the senigo.extension.android package then I create 3 files, Sample.java, SampleContext.java, PassTextFunction.java
Code Source Sample.Java
package senigo.extension.android; import android.util.Log; import com.adobe.fre.FREContext; import com.adobe.fre.FREExtension; public class Sample implements FREExtension { @Override public FREContext createContext(String arg0) { // TODO Auto-generated method stub Log.i("Sample", "createContext"); return new SampleContext(); } @Override public void dispose() { // TODO Auto-generated method stub Log.i("Sample", "Dispose"); } @Override public void initialize() { // TODO Auto-generated method stub Log.i("Sample", "Initialize"); } }
Source code for SampleContext.Java
package senigo.extension.android; import java.util.HashMap; import java.util.Map; import android.util.Log; import com.adobe.fre.FREContext; import com.adobe.fre.FREFunction; public class SampleContext extends FREContext { public SampleContext() { Log.i("SampleContext", "constructor"); } @Override public void dispose() { // TODO Auto-generated method stub Log.i("SampleContext", "dispose"); } @Override public Map<String, FREFunction> getFunctions() { // TODO Auto-generated method stub Log.i("SampleContext", "getFunctions"); Map<String, FREFunction> functionMap = new HashMap<String, FREFunction>(); functionMap.put("passText", new PassTextFunction()); return functionMap; } }
Source code for PassTextFunction.Java
package senigo.extension.android; import com.adobe.fre.FREContext; import com.adobe.fre.FREExtension; import com.adobe.fre.FREFunction; import com.adobe.fre.FREObject; public class PassTextFunction implements FREFunction { @Override public FREObject call(FREContext arg0, FREObject[] arg1) { // TODO Auto-generated method stub FREObject result = null; try{ result = FREObject.newObject("Hello World"); }catch(Exception e) { } return result; } }
After all the files, I create the jar file using the right click on the tree > > export > > Jar file > > Sample.Jar (I already create jar file that contains just the src folder and after I got frustrated, I create the .jar file contains all the project folder as a whole but still did not work).
Okay, after that, I create project Flex Library Project, which is to contain the actionscript code to call the native and extension.xml, here the code.
Test Source code. As, FYI: I have already create the public function and the static function the error always the same #3500.
package senigo.extension.android { import flash.external.ExtensionContext; public class test { private static var extContext:ExtensionContext = null; public function test() { trace ("Test Constructor"); if (!extContext) { initExtension(); } } public static function get passText():String { trace ("Test Pass Text"); if (!extContext) { initExtension(); } return extContext.call("passText") as String; } private static function initExtension():void { trace ("Vibration Constructor: Create an extension context"); extContext = ExtensionContext.createExtensionContext("senigo.extension.android", null); } } }
extension source code. XML
FYI: Flex when I put the Native Extension, they said have Windows - x 86 so I already create 3 DONKEY, that contain Android-ARM, ARM Android contain by default, Android contain ARM, Default, and Windows - x 86, but still the same error. I don't have it where is the error.
<extension xmlns="http://ns.adobe.com/air/extension/3.1"> <id>senigo.extension.android</id> <versionNumber>1.0.0</versionNumber> <platforms> <platform name="Android-ARM"> <applicationDeployment> <nativeLibrary>Sample.jar</nativeLibrary> <initializer>senigo.extension.android.Sample</initializer> <finalizer>senigo.extension.android.Sample</finalizer> </applicationDeployment> </platform> <!-- <platform name="Windows-x86"> <applicationDeployment> <nativeLibrary>sample.jar</nativeLibrary> <initializer>senigo.extension.android.Sample</initializer> <finalizer>senigo.extension.android.Sample</finalizer> </applicationDeployment> </platform> --> <platform name="default"> <applicationDeployment/> </platform> </platforms> </extension>
After that I created, I copy the sample file of file and extension with the file Sample.jar .swc.
I have extracted the .swc file, copy the library.swf file Android-ARM, by default, Windows-86 and I create build.bat containing the command like this
adt -package -storetype PKCS12 -keystore senigo.p12 -storepass l10nk1ng -target ane senigo.extension.android.ane extension.xml -swc AndroidLib.swc -platform Android-ARM -C ./Android-ARM/ . -platform default -C ./default/ .
the I put the donkey for bending mobile project I created:
I run, but received the error #3500, I get really confused? What is wrong with my code? is there something that I have wrong or I just missed?
Please someone help me... and what is already donkey file I can debug in Flex Mobile project? I want to log.i code I wrote, but I confuse air how to the Levant in flash builder.
in the end, I want to said sorry if my English is not very goods and thank you, because want to see my problem and I appreciate it a lot if you can give me a solution
So you're saying that test.as I created belongs to android?
Exactly.
Okay, so then why when I put just ANE build contain Android-ARM, the error still appear?
Because that when you launch it engine running Windows AIR request use default implementation in this case. But looks like the default implementation, you use the same Android and default value.
is that what I have to put Windows-86 to run it on windows?
If you are creating applications / DONKEY for mobile platforms you don't need it.
I have to use another actionscript that does not ExtensionContext content?
Exactly!
For example, look at this: mesmotronic/air-full screen-ane · GitHub
record full screen-ane-android - Android app
full screen-ane-default - default implementation (for all other platforms exclude Android)
It is an excellent example. It's pretty simple, you understand how it works.
-
Error when the appellation newly created folder: this item is not found
Hello
I found the thread when people are struggling to remove the folder. However, I have the opposite problem.
When I create a new folder, type to replace the name "New folder" and then on enter, I get this error:
This item is not found
It is no longer in C:\folder1\folder2. Check the location of the item and try again.
Two options: retry and cancel.
I did Try Again and it works.
How can I fix it?
Thank you
Found the thread with replies
http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/renaming-folders-causes-item-not-found-error-in/e2cf38c7-9e77-4256-89DE-6308df53d5f9?page=1
-
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
-
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 -
ArgumentError: Error #2100 when opening adobe muse cc 2015
Hello, I'm an ArgumentError: Error #2100 when opening adobe muse cc 2015
Here is the log txt:
Logging ended at: my Sep 26 12:21:24 2015
12:21:31.007 [00:01:03.937] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m eta responseURL:eta https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m
12:21:31.008 [00:01:03.937] | Header: Server: openresty/1.7.4.1
12:21:31.008 [00:01:03.937] | Header: Date: Saturday, September 26, 2015 19:21:22 GMT
12:21:31.008 [00:01:03.937] | Header: Content-Type: application/json
12:21:31.008 [00:01:03.937] | Header: Content-Length: 15
12:21:31.009 [00:01:03.937] | Header: Connection: keep-alive
12:21:31.009 [00:01:03.937] | Header: Cache-Control: private
12:21:31.009 [00:01:03.937] | Header:-Access-Control-Allow-Origin: *.
12:21:31.009 [00:01:03.937] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
12:21:31.009 [00:01:03.937] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
12:21:31.009 [00:01:03.937] | Header: Access-Control-expose-Headers: location
12:21:31.010 [00:01:03.937] | Header: Access-Control-Max-Age: 99999
12:21:31.010 [00:01:03.937] | Data:
{"code": 104001}
12:21:31.052 [00:01:03.984] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta responseURL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta
12:21:31.052 [00:01:03.984] | Header: Server: openresty/1.7.4.1
12:21:31.053 [00:01:03.984] | Header: Date: Saturday, September 26, 2015 19:21:22 GMT
12:21:31.053 [00:01:03.984] | Header: Content-Type: application/json
12:21:31.053 [00:01:03.984] | Header: Content-Length: 15
12:21:31.053 [00:01:03.984] | Header: Connection: keep-alive
12:21:31.053 [00:01:03.984] | Header: Cache-Control: private
12:21:31.053 [00:01:03.984] | Header:-Access-Control-Allow-Origin: *.
12:21:31.053 [00:01:03.984] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
12:21:31.053 [00:01:03.984] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
12:21:31.053 [00:01:03.984] | Header: Access-Control-expose-Headers: location
12:21:31.053 [00:01:03.984] | Header: Access-Control-Max-Age: 99999
12:21:31.054 [00:01:03.984] | Data:
{"code": 104001}
12:21:37.711 [00:01:10.641] | EXCEPTION: [the ByteArray in Loader.loadBytes parameter] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.-stack the ByteArray parameter in Loader.loadBytes+Loader/_loadBytes+Loader/loadBytes+WebFontLoadController/registerFont+We bFontLoadController/processDownloadedFont + WebFontLoadController/onLoadedFontBytes + EventDis patch/dispatchEventFunction + EventDispatcher/dispatchEvent + MuseURLLoader/dispatchEvent + UR LLoader/onComplete + end
[00:01:10.641] AlertAndExit by: [setting the ByteArray in Loader.loadBytes] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.Logging in build 2015.0.2.4 started: my Sep 26 13:08:57 2015
========================================
13:09:28.688 [00:00:27.688] | Full recovery
13:11:17.349 [00:02:16.328] | Try opening the file ' C:\Users\jeff\Documents\shaw & co\shaw and co 14 SEPT. Muse with dimensions: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 2015
13:11:17.377 [00:02:16.359] | Opening file 'C:\Users\jeff\Documents\shaw & co\shaw and SEVEN 14.muse co' with status: success size: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 highestUID 2015: 5272
13:11:28.099 [00:02:27.078] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta responseURL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta
13:11:28.099 [00:02:27.078] | Header: Server: openresty/1.7.4.1
13:11:28.100 [00:02:27.078] | Header: Date: Saturday, September 26, 2015 20:11:19 GMT
13:11:28.100 [00:02:27.078] | Header: Content-Type: application/json
13:11:28.100 [00:02:27.078] | Header: Content-Length: 15
13:11:28.100 [00:02:27.078] | Header: Connection: keep-alive
13:11:28.100 [00:02:27.078] | Header: Cache-Control: private
13:11:28.100 [00:02:27.078] | Header:-Access-Control-Allow-Origin: *.
13:11:28.100 [00:02:27.078] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
13:11:28.101 [00:02:27.078] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
13:11:28.101 [00:02:27.078] | Header: Access-Control-expose-Headers: location
13:11:28.101 [00:02:27.078] | Header: Access-Control-Max-Age: 99999
13:11:28.101 [00:02:27.078] | Data:
{"code": 104001}
13:11:28.629 [00:02:27.609] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m eta responseURL:eta https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m
13:11:28.629 [00:02:27.609] | Header: Server: openresty/1.7.4.1
13:11:28.630 [00:02:27.609] | Header: Date: Saturday, September 26, 2015 20:11:20 GMT
13:11:28.630 [00:02:27.609] | Header: Content-Type: application/json
13:11:28.630 [00:02:27.609] | Header: Content-Length: 15
13:11:28.630 [00:02:27.609] | Header: Connection: keep-alive
13:11:28.630 [00:02:27.609] | Header: Cache-Control: private
13:11:28.630 [00:02:27.609] | Header:-Access-Control-Allow-Origin: *.
13:11:28.631 [00:02:27.609] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
13:11:28.631 [00:02:27.609] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
13:11:28.631 [00:02:27.609] | Header: Access-Control-expose-Headers: location
13:11:28.631 [00:02:27.609] | Header: Access-Control-Max-Age: 99999
13:11:28.631 [00:02:27.609] | Data:
{"code": 104001}
13:12:20.577 [00:03:19.563] | EXCEPTION: [the ByteArray in Loader.loadBytes parameter] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.-stack the ByteArray parameter in Loader.loadBytes+Loader/_loadBytes+Loader/loadBytes+WebFontLoadController/registerFont+We bFontLoadController/processDownloadedFont + WebFontLoadController/onLoadedFontBytes + EventDis patch/dispatchEventFunction + EventDispatcher/dispatchEvent + MuseURLLoader/dispatchEvent + UR LLoader/onComplete + end
[00:03:19.563] AlertAndExit by: [setting the ByteArray in Loader.loadBytes] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.Logging in build 2015.0.2.4 started: my Sep 26 13:25:10 2015
========================================
13:25:24.713 [00:00:13.359] | Full recovery
13:26:15.857 [00:01:04.500] | Try opening the file ' C:\Users\jeff\Documents\shaw & co\shaw and co 14 SEPT. Muse with dimensions: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 2015
13:26:15.871 [00:01:04.515] | Opening file 'C:\Users\jeff\Documents\shaw & co\shaw and SEVEN 14.muse co' with status: success size: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 highestUID 2015: 5272
13:26:33.277 [00:01:21.922] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m eta responseURL:eta https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m
13:26:33.277 [00:01:21.922] | Header: Server: openresty/1.7.4.1
13:26:33.277 [00:01:21.922] | Header: Date: Saturday, September 26, 2015 20:26:24 GMT
13:26:33.277 [00:01:21.922] | Header: Content-Type: application/json
13:26:33.278 [00:01:21.922] | Header: Content-Length: 15
13:26:33.278 [00:01:21.922] | Header: Connection: keep-alive
13:26:33.278 [00:01:21.922] | Header: Cache-Control: private
13:26:33.278 [00:01:21.922] | Header:-Access-Control-Allow-Origin: *.
13:26:33.278 [00:01:21.922] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
13:26:33.278 [00:01:21.922] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
13:26:33.278 [00:01:21.922] | Header: Access-Control-expose-Headers: location
13:26:33.279 [00:01:21.922] | Header: Access-Control-Max-Age: 99999
13:26:33.279 [00:01:21.922] | Data:
{"code": 104001}
13:26:33.280 [00:01:21.922] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta responseURL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta
13:26:33.280 [00:01:21.922] | Header: Server: openresty/1.7.4.1
13:26:33.280 [00:01:21.922] | Header: Date: Saturday, September 26, 2015 20:26:24 GMT
13:26:33.281 [00:01:21.922] | Header: Content-Type: application/json
13:26:33.281 [00:01:21.922] | Header: Content-Length: 15
13:26:33.281 [00:01:21.922] | Header: Connection: keep-alive
13:26:33.281 [00:01:21.922] | Header: Cache-Control: private
13:26:33.281 [00:01:21.922] | Header:-Access-Control-Allow-Origin: *.
13:26:33.281 [00:01:21.922] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
13:26:33.281 [00:01:21.922] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
13:26:33.282 [00:01:21.922] | Header: Access-Control-expose-Headers: location
13:26:33.282 [00:01:21.922] | Header: Access-Control-Max-Age: 99999
13:26:33.282 [00:01:21.922] | Data:
{"code": 104001}
13:26:40.729 [00:01:29.359] | EXCEPTION: [the ByteArray in Loader.loadBytes parameter] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.-stack the ByteArray parameter in Loader.loadBytes+Loader/_loadBytes+Loader/loadBytes+WebFontLoadController/registerFont+We bFontLoadController/processDownloadedFont + WebFontLoadController/onLoadedFontBytes + EventDis patch/dispatchEventFunction + EventDispatcher/dispatchEvent + MuseURLLoader/dispatchEvent + UR LLoader/onComplete + end
[00:01:29.375] AlertAndExit by: [setting the ByteArray in Loader.loadBytes] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.Logging in build 2015.0.2.4 started: my Sep 26 13:27:27 2015
========================================
13:27:39.133 [00:00:11.781] | Full recovery
14:49:50.802 [01:22:23.453] | Try opening the file ' C:\Users\jeff\Documents\shaw & co\shaw and co 14 SEPT. Muse with dimensions: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 2015
14:49:50.832 [01:22:23.485] | Opening file 'C:\Users\jeff\Documents\shaw & co\shaw and SEVEN 14.muse co' with status: success size: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 highestUID 2015: 5272
14:49:59.103 [01:22:31.750] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta responseURL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta
14:49:59.103 [01:22:31.750] | Header: Server: openresty/1.7.4.1
14:49:59.103 [01:22:31.750] | Header: Date: Saturday, September 26, 2015 21:49:50 GMT
14:49:59.103 [01:22:31.750] | Header: Content-Type: application/json
14:49:59.103 [01:22:31.750] | Header: Content-Length: 15
14:49:59.103 [01:22:31.750] | Header: Connection: keep-alive
14:49:59.103 [01:22:31.750] | Header: Cache-Control: private
14:49:59.104 [01:22:31.750] | Header:-Access-Control-Allow-Origin: *.
14:49:59.104 [01:22:31.750] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
14:49:59.104 [01:22:31.750] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
14:49:59.104 [01:22:31.750] | Header: Access-Control-expose-Headers: location
14:49:59.104 [01:22:31.750] | Header: Access-Control-Max-Age: 99999
14:49:59.104 [01:22:31.750] | Data:
{"code": 104001}
14:49:59.696 [01:22:32.344] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m eta responseURL:eta https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m
14:49:59.696 [01:22:32.344] | Header: Server: openresty/1.7.4.1
14:49:59.697 [01:22:32.344] | Header: Date: Saturday, September 26, 2015 21:49:51 GMT
14:49:59.697 [01:22:32.344] | Header: Content-Type: application/json
14:49:59.697 [01:22:32.344] | Header: Content-Length: 15
14:49:59.697 [01:22:32.344] | Header: Connection: keep-alive
14:49:59.697 [01:22:32.344] | Header: Cache-Control: private
14:49:59.697 [01:22:32.360] | Header:-Access-Control-Allow-Origin: *.
14:49:59.698 [01:22:32.360] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
14:49:59.698 [01:22:32.360] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
14:49:59.698 [01:22:32.360] | Header: Access-Control-expose-Headers: location
14:49:59.698 [01:22:32.360] | Header: Access-Control-Max-Age: 99999
14:49:59.698 [01:22:32.360] | Data:
{"code": 104001}
14:50:06.380 [01:22:39.031] | EXCEPTION: [the ByteArray in Loader.loadBytes parameter] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.-stack the ByteArray parameter in Loader.loadBytes+Loader/_loadBytes+Loader/loadBytes+WebFontLoadController/registerFont+We bFontLoadController/processDownloadedFont + WebFontLoadController/onLoadedFontBytes + EventDis patch/dispatchEventFunction + EventDispatcher/dispatchEvent + MuseURLLoader/dispatchEvent + UR LLoader/onComplete + end
[01:22:39.047] AlertAndExit by: [setting the ByteArray in Loader.loadBytes] ArgumentError: Error #2100: ByteArray Loader.loadBytes () must have the length parameter is greater than 0.Logging in build 2015.0.2.4 started: my Sep 26 15:10:20 2015
========================================
15:10:38.666 [00:00:17.984] | Full recovery
15:11:49.007 [00:01:28.312] | Try opening the file ' C:\Users\jeff\Documents\shaw & co\shaw and co 14 SEPT. Muse with dimensions: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 2015
15:11:49.017 [00:01:28.328] | Opening file 'C:\Users\jeff\Documents\shaw & co\shaw and SEVEN 14.muse co' with status: success size: 25362432 mod Date: Mon, Sep 14 22:57:11 GMT - 0700 highestUID 2015: 5272
15:11:56.855 [00:01:36.172] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta responseURL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/data?meta
15:11:56.855 [00:01:36.172] | Header: Server: openresty/1.7.4.1
15:11:56.855 [00:01:36.172] | Header: Date: Saturday, September 26, 2015 22:11:48 GMT
15:11:56.855 [00:01:36.172] | Header: Content-Type: application/json
15:11:56.855 [00:01:36.172] | Header: Content-Length: 15
15:11:56.856 [00:01:36.172] | Header: Connection: keep-alive
15:11:56.856 [00:01:36.172] | Header: Cache-Control: private
15:11:56.856 [00:01:36.172] | Header:-Access-Control-Allow-Origin: *.
15:11:56.856 [00:01:36.172] | Header: Access-Control-allow-Headers: authorization, Accept-Language, Content-Type
15:11:56.856 [00:01:36.172] | Header: Access-Control-allow-methods: GET, HEAD, POST, PUT, DELETE
15:11:56.856 [00:01:36.172] | Header: Access-Control-expose-Headers: location
15:11:56.856 [00:01:36.172] | Header: Access-Control-Max-Age: 99999
15:11:56.856 [00:01:36.172] | Data:
{"code": 104001}
15:11:57.368 [00:01:36.672] | Response receipt 404 of the GET to the URL:https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m eta responseURL:eta https://api-ava.worldsecuresystems.com/api/v1/admin/sites/2162375/storage/page-templates?m
15:11:57.368 [00:01:36.672] | Header: Server: openresty/1.7.4.1
15:11:57.368 [00:01:36.672] | Header: Date: Saturday, September 26, 2015 22:11:49 GMTPlease delete the folders "tk1", 'tk2', 'tk3' and "tk4" found in:
Mac: "~/Library/Preferences/com.adobe.AdobeMuseCC.2015.0/Local Store" (copy and paste into the go > dialog go to the folder in the Finder)
Windows: store "%appdata%/com.adobe.AdobeMuseCC.2015.0/Local" (copy and paste into a file Explorer window)
In both cases above, include everything between the quotation marks (including the tilde ~ on Mac) in the copy/paste, but not the quotation marks themselves.
Maybe you are looking for
-
Use iPhone 7 more of Apple website
Have not yet seen the site of 7 more on the apple iPhone unlocked. However, I see the "Pay in full" option after you have selected the service provider. This means that the phone is unlocked and without a sim card? How is this different from the vers
-
Get toolbar buttons to look like the fact
After I've upgraded to a new version of Firefox all toolbar buttons are just totally flat, they are again have seen a 3d. How to bring back this sketch?
-
Keep the originals for videos not photos
In an effort to save space on my iphone, I put icloud to optimize the storage of the iphone. The problem is that when I want to watch a video, I have to wait for it to download. Is there a way to define icloud to download and keep the originals for v
-
White with vertical lines colored on Equium A60
Hello I'm new on this but really need your help. My laptop is around the age of 18 months and has always worked well. Last week, I plugged modem broadband via Ethernet cable and configure the broadband services. A few minutes after doing this, when I
-
HP mini 110 computer: factory reset
UM I need help on my HP laptop reset factory UH I don't know how but I forgot the afmin password and I have no idea what to do now help please