#2025 error: The supplied DisplayObject must be a child of the caller.      to flash. display::DisplayObj

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 process
When tracing both parent show is the same but preloader does not work please help me
Thanks in advance

This 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.

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);

  • Add Radio button dynamically, twice - #2025 error: the supplied DisplayObject must be a child of

    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);

    }

  • 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;

  • #2025 error: the supplied DisplayObject must be a child of the appellant - delete table object

    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

  • ArgumentError: Error #2025: the supplied DisplayObject must be a child of the caller.

    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.

  • Video error: the files needed to display video are not installed or not working not properly. Please restart Windows Media Center...

    Please help - it's driving me crazy! I got this to work!

    I am using Vista Ultimate and a connection (cat-5) ethernet to an xbox 360 as a Media Extender (via a Linksys router). I get the error of the video:
    "The files needed to display video are not installed or not working not properly." Please restart Windows Media Center or restart the computer "."

    I have a Happauge PVR 150 TV capture card installed, and you want to watch TV and my video files Via the Xbox 360. I can see the guide for lists of TV programs, but not to look at them without getting the message above.  I can also put in place a program to record, display the video thumbnail, but not play. Video files only will play are videos very select few years recorded only where there is.

    My graphics card is an ATI 2900XT - 512 MB of ram, with the latest drivers.

    I've seen a number of discussions on the web that describes the same (or similar) problem, but none of them seem to have no solution.

    I had Norton Internet Security installed and it has since withdrawn because of the firewall. I had thought, it could be a firewall issue, but it is not. I'm now using the Windows Firewall for now.

    I deleted and reinstalled the Xbox as an Extender media several times... no help. I have re-installed the complete drivers for the video capture card, it has not helped either. I checked and double-checked the settings on my router as well.

    The xbox is set for the share on my multimedia computer. The correct files can also be programmed for sharing.

    On the PC in Windows Media Center, I can view the TV programs, record programs etc etc etc all work.

    Any help would be really appreciated!

    Hello Lowwatts,

    Microsoft Xbox 360 community

    Thank you for visiting the website of Microsoft Windows Vista Community. The question you have posted is related to

    Microsoft Xbox360 community and would be better suited to the Microsoft's Xbox 360 community. Please visit the link below to find a community that will provide the support you want.

    Community Microsoft Xbox360

    Try following the steps in this article:

    Enjoy Windows Media Center on your Xbox 360 with your music, photos, recorded Live TV * and online media

    This should solve your problem.

    Let us know if these steps solve your problem.  I hope the information is useful.

    Kind regards

    Anthony
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • WMC on Xbox 360 shows "video error: the files needed to display video are not installed...»

    Front when you use Windows 7 Xbox 360 everything has worked well.
    Upgrade to windows 8.  WMC can play programs recorded on PC, but when I try to play recorded shows with WMC of XBox 360, I get the following message

    "Video error: files needed to display video are not installed or not working not properly." "Please restart Media Center and or restart the computer.

    I don't have any codecs installed
    I tried regedit change suggested that for vista, does not work
    I tried the deactivation/activation of WMC on the PC, does not work
    Restart the PC does not work
    Restarting everything doesn't work

    had this error the other day, that it drove me crazy. You know what fixed it? Disable my firewall. For some reason, he decided to start blocking my xbox. I hope this helps.

  • Procedural error the call for VARRAY String as parameter

    Hello

    I get the error during the call to the procedure:

    Here are the steps:

    CREATE or REPLACE TYPE PART_TYPE IS an OBJECT (part_number VARCHAR2 (120));

    CREATE OR REPLACE TYPE PART_REC_TBL IS VARRAY (1000) of PART_TYPE ;

    I have a stored procedure in the package:

    create or replace package TEST_PART_SEARCH_PKG AUTHID CURRENT_USER AS

    PROCEDURE ADD_TO_PART)

    p_part_number_list IN PART_REC_TBL ,

    p_ord_number IN Varchar2,

    x_error_flag OUT Varchar2,

    x_error_msg OUT Varchar2

    );

    end TEST_PART_SEARCH_PKG;

    When I call the Package:

    DECLARE

    v_flag varchar2 (100);

    v_err_msg varchar2 (100);

    BEGIN

    TEST_PART_SEARCH_PKG. ADD_TO_PART ('09031518,0897701 ',' 003146M 56', v_flag, v_err_msg);

    END;

    error report-

    ORA-06550: line 5, column 6:

    PLS-00306: wrong number or types of arguments in the call to 'ADD_TO_PART '.

    ORA-06550: line 5, column 6:

    PL/SQL: Statement ignored

    It would be helpful if someone can help me on this

    Obviously. There are no part_number, so turn in your package and get rid of it:

    FOR indx1 IN 1.p_lot_number_list. COUNTY

    LOOP

    BEGIN

    SELECT

    inventory_item_id

    IN

    var_item_id

    Of

    test_part_number_v

    WHERE

    PART_NUMBER = p_part_number_list (indx1);

    EXCEPTION

    WHILE OTHERS THEN

    var_item_id: = NULL;

    END;

    SY.

  • Java object - internal error, the Page cannot be displayed

    Hello!
    I'm trying to define an instance of my own Java class, but whenever I call the page, in which I make the instance I get this error "HTTP 500 Internal Server Error." - the Page cannot be displayed
    I use the following code:
    ---------------------------------------------------------
    Java file, I put the class file in the folder "CFusionMX7\wwwroot\WEB-INF\classes".
    public class SimpleMath {}

    public int addNumbers (int num1, int num2) {}

    Return num1 + num2;
    }
    }
    -----------------------------------------
    I use the following code in my web page

    < cfset MyObject = createObject ("java", "SimpleMath") >
    < cfset myObject.addNumbers = result (25,25) >
    < cfoutput > the result is: #result # < / cfoutput >

    We consider a computer where Java is installed. The goal is to start from scratch with just the basics.

    (1) delete or backup the files of current test SimpleMath.* in CFusionMX7\wwwroot\WEB-INF\classes;
    (2) restart Coldfusion;
    (3) open an editor, for example Notepad and type public class SimpleMath {public int addNumbers (int num1, int num2) {return num1 + num2 ;}} .}} Using the file => record under and select the all files option for Save As Type:, save the file as SimpleMath.java in the CFusionMX7\wwwroot\WEB-INF\classes\ directory.
    (4) open the command prompt and navigate to the directory until the cursor is located at:
    C:\CFusionMX7\wwwroot\WEB-INF\classes >;
    Type 5) javac-source 1.4 - target 1.4 SimpleMath.java and press ENTER to compile the file. The options of the source and the target to ensure that the file is compiled into Java version 1.4, which is compatible with Coldfusion. (A review, for example, when there is also Java 1.5 on the machine);
    (6) open the web page containing your code.

  • Video error for a single show - "video error: the files needed to display video are not installed or not working not properly.

    I get a "video error: files needed to display video are not installed or not working not properly."  Please restart Media Center and / or restart the computer. »

    Windows XP MCE 2005 on a PC HP Media Center m750n with 2 GB of RAM, Intel Pentium D 920 processor and more than 230 GB of free hard disk space.

    The strange thing is, it only happens for a show, "Star Trek: The Next Generation" at 07:00 on channel 55 Houston.  Sometimes it is live or recorded.  Shown immediately before and immediately after about 55 works fine, as does anything on any other channel. (Although if I leave the video error for more than a few seconds, then I get an error of the tuner on the other channels until I quit Media Center and bring backup.)

    Maybe my computer is a militant fan of Star Wars?

    Windows XP Media Center 2005

    If this only happens in a show on a channel and passes every day but others
    shows on the same channel are watchable/recordable, it is possible that a copy
    never flag is set that is manifested by the video display
    error message.
     
    I would recommend that you post this topic on the forums of http://thegreenbutton.com .
     
    Tuesday, July 27, 2010, 00:54:06 + 0000, Pseudo Witty says:
     
    >
    >
    > I get a "video error: files needed to display video are not installed or not working not properly."  Please restart Media Center and / or restart the computer. »
    >
    > Windows XP MCE 2005 on a PC HP Media Center m750n with 2 GB of RAM, Intel Pentium D Processor 920 and more than 230 GB of free hard disk space.
    >
    > The strange thing is, it only happens for a show, "Star Trek: The Next Generation" at 07:00 on channel 55 Houston.  Sometimes it is live or recorded.  Shown immediately before and immediately after about 55 works fine, as does anything on any other channel. (Although if I leave the video error for more than a few seconds, then I get an error of the tuner on the other channels until I quit Media Center and bring backup.)
    >
    > Maybe my computer is a militant fan of Star Wars?
    >
    > Windows XP Media Center 2005
     

    Barb Bowman

    http://www.digitalmediaphile.com

  • The call log is displayed on another phone

    Phone call made on 5 phone to appear in the 4S another phone call log

    1 stop sharing with Apple ID

    2 settings > phone > application to other devices > make sure that the iPhone 4S is not listed

    Even with Messages & FaceTime

  • #2006 error: The supplied index is out of bounds

    Hello

    I'm trying to addChild with an interval, using this piece of code, but I always get an error saiyng that the State index is out of bounds.

    Why?

    What should I do to have mc1, added so the wait lets say a second and add m2 2 and so on?

    Thank you

    var tempo_espera:Timer = new Timer(1000, 1);
    tempo_espera.addEventListener ("timer", joints);
    tempo_espera. Start();
    //
    function inserir(evt:TimerEvent):void {}
    for (var nv1:int = 0; nv1 < promocoes.length; nv1 ++) {}
    holder.addChildAt (mc, nv1);
    var animacao:TransitionManager = new TransitionManager (mc);
    animacao.startTransition ({type: Zoom, direction: Transition.IN, easing: Elastic.easeOut, duration: 3});
    }
    }

    RangeError: Error #2006: the supplied index is out of range.
    at flash.display::DisplayObjectContainer/addChildAt()
    to MethodInfo - 346)
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

    Here is the code that works. The problem was that Timer.currentCount begins with 1 - 0 no. Made on each call, it must be decremented from 1 to call table position (highlighted in red).

    var holder:Sprite = new Sprite();addChild(holder);// this is array of movie clipsvar mcArray:Array = new Array();// it is better to declare variable once and then reinstantiate itvar mc:MovieClip;// do your regular routinevar prm:Array;for (var nv:uint = 0; nv < promocoes.length; nv++) {    prm = promocoes[nv].split("|sep|");    mc = new MovieClip();
        mc.name = "mc_"+nv;    mc.graphics.beginFill(0x000000, 0.20);    mc.graphics.drawRect(0, 0, 100, 60);    mc.graphics.endFill();    mc.name = "mc_"+nv;    // place this new mc into array    mcArray.push(mc);}
    
    // start timer - note that timer will fire as many times as there are movie clipsvar tempo_espera:Timer = new Timer(1000, mcArray.length);tempo_espera.addEventListener(TimerEvent.TIMER, placeClip);tempo_espera.start();
    // the clip you will apply transition tovar currentClip:MovieClip;
    // function that places clipsfunction placeClip(e:TimerEvent):void {    trace("placeClip: currentCount = " + tempo_espera.currentCount);    // get next clip by calling movie that corresponds with the timer counter    currentClip = MovieClip(mcArray[tempo_espera.currentCount - 1]);    // just place next clip    holder.addChild(currentClip);    var animacao:TransitionManager = new TransitionManager(currentClip);    animacao.startTransition({type:Zoom, direction:Transition.IN, easing :Elastic.easeOut, duration:3});}
    
  • Error message: your browser must have Java enabled to use the Client for Java when you try to access the Citrix server.

    Original title: java question.

    I'm trying to access the Citrix server to access my work server.  When I click on an application, I get an error message: your browser must have Java enabled to use the Client for Java.  I checked and the right version of Java installed and removed the old Java applications but still this message when trying to access Citrix.  Please meet w / directions for a fix.

    Start by seeing if Java has been installed correctly:

    http://www.Java.com/en/download/testjava.jsp

    or
    http://javatester.org/

Maybe you are looking for