Adding Radio Button dynamically, twice - Error #2025: The supplied DisplayObject must be a child of

Hello
I am having some trouble adding UI controls dynamically. Mostly with radio buttons.
Here is an example that demonstrates 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 Label();
                myLabel.text = "My Label";
                myLabel.width=120;
                theForm.addChild(myLabel);
                //2. Numeric 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 radio button";
                myRadioButton.selected = true;
                theForm.addChild(myRadioButton);
                //4. Panel
                var thePanel:Panel = new Panel();
                thePanel.width = 300;
                thePanel.height = 475;
                thePanel.name=theChar;
                thePanel.title = "My Profile Panel";
                thePanel.setStyle("backgroundColor", "blue");
                //add the form to 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>
^ Run that. Click the "Add a panel" button. Then click "Clear". Then click the "Add a panel" button again. 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]
    at Array$/_sort()
    at Array/http://adobe.com/AS3/2006/builtin::sort()
    at 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 do not understand why I cannot re-add the radio button? If you comment out the code for the radio button (comment section #3.) you can re-add the panels easily. It is only happening when I have radio buttons being added to the form/panel.
Why is this happening and how do I fix it? Why is this only happening to radio buttons? I thought I had this fixed

^ well, okay, but that's not the problem.
here, i removed list and replaced with Panel. same problem on the radio buttons.
<s:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark" 
    xmlns:containers="com.dougmccune.containers.*"
    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 Label();
                myLabel.text = "My Label";
                myLabel.width=120;
                theForm.addChild(myLabel);
                //2. Numeric 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 radio button";
                myRadioButton.selected = true;
                theForm.addChild(myRadioButton);
                //4. Panel
                var thePanel:Panel = new Panel();
                thePanel.width = 300;
                thePanel.height = 475;
                thePanel.name=theChar;
                thePanel.title = "My Profile Panel";
                thePanel.setStyle("backgroundColor", "blue");
                //add the form to the panel
                thePanel.addChild(theForm);
                //add the Panel to the list control
                myContainer.addChild(thePanel);
            protected function btnClear_clickHandler(event:MouseEvent):void
                var numChildren:Number = myContainer.numChildren;
                for(var i:Number=numChildren - 1; i > -1; i--){
                    myContainer.removeChildAt(i);
        ]]>
    </fx:Script>
    <mx:VBox width="100%">
        <mx:Panel id="myContainer" />
        <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>
Any idea why radio buttons causing this to happen? If I comment out the radio button, this works fine. This is really baffling me.
The exception is thrown when the dynamically created panel (thePanel) is added to the main Panel (myContainer):
myContainer.addChild(thePanel); <--- causes the exception!
^ Why would radio buttons make a difference on "thePanel"?? How can I enforce parent-child relationship, explicitly? .parent is read-only

Similar Messages

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

    Hi All,
    I would very much appreciate any help with this.
    I am working on a flash piece that will play 4 videos, depending on the button pressed. First button will launch first video, 2nd - 2nd video and so on. Once the Video is done playing, close_btn, learn_more_btn and replay_btn appear, in addition to an ending image that is different for each of the videos( BoxLivePic, BoxSleepPic and BoxFeelPic). So - actually 4 things appear once the movie stops playing and the last image depends on which buttons was clicked...
    My issue is, when I click the close button( andI'm sure same will 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 that it's because each Picture is not actually added to the display list, unless the proper button was clicked.. however, I don't know how to fix that! I hope this makes some sence - Below is all of my Code... Thanks a bunch in advance:
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.greensock.easing.CustomEase;
    import com.greensock.loading.VideoLoader;
    import flash.display.Sprite;
    import com.greensock.events.LoaderEvent;
    import flash.display.MovieClip;
    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:this,
                                                x:0, y:0});
    var Video_Live:VideoLoader = new VideoLoader("Live_Video.f4v",{conainer:this,
                                                 x:0, y:0});
    var Video_Sleep:VideoLoader = new VideoLoader("Sleep_Video.f4v",{conainer:this,
                                                 x:0, y:0});
    var Video_Feel:VideoLoader = new VideoLoader("Feel_Video.f4v",{conainer:this,
                                                 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);
    //Buttons Invisible
    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 Eases
    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")});
        //Show 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);
    //Event Listeners for Playing Video
    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 Close Video
    close_btn.addEventListener(MouseEvent.MOUSE_DOWN, closeVideo);
    //Functions for VIDEO and LEARN MORE buttons
        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);
    // Last Breathe Buttons Added to 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 Live 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;
    //Last Feel 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 Breathe
    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});
        //Close Live
        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 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});
        //Close Feel
        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});
        //Show Pic
        TweenLite.to(pic_breathe_mc, .5, {alpha:1});
        //Hide Other Pics
        TweenLite.to(pic_live_mc, .5, {alpha:0});
        TweenLite.to(pic_sleep_mc, .5, {alpha:0});
        TweenLite.to(pic_feel_mc, .5, {alpha:0});
        //Show Text
        TweenLite.to(breathe_txt_mc, 1,{alpha:1});
        //Hide Other Text
        TweenLite.to(live_txt_mc, 1,{alpha:0});
        TweenLite.to(sleep_txt_mc, 1,{alpha:0});
        TweenLite.to(feel_txt_mc, 1,{alpha:0});
    // Functions live
    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 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 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});
        //Close Feel
        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});
        //Show Pic
        TweenLite.to(pic_live_mc, .5, {alpha:1});
        //Hide Other Pics
        TweenLite.to(pic_sleep_mc, .5, {alpha:0});
        TweenLite.to(pic_feel_mc, .5, {alpha:0});
        //Show Text
        TweenLite.to(live_txt_mc, 1,{alpha:1});
        //Hide Other Text
        TweenLite.to(breathe_txt_mc, 1,{alpha:0});
        TweenLite.to(sleep_txt_mc, 1,{alpha:0});
        TweenLite.to(feel_txt_mc, 1,{alpha:0});
    // Functions sleep
    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 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 Live
        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 Feel
        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});
        //Show Pic
        TweenLite.to(pic_sleep_mc, .5, {alpha:1});
        //Hide Other Pics
        TweenLite.to(pic_feel_mc, .5, {alpha:0});
        //Show Text
        TweenLite.to(sleep_txt_mc, 1,{alpha:1});
        //Hide Other Text
        TweenLite.to(live_txt_mc, 1,{alpha:0});
        TweenLite.to(breathe_txt_mc, 1,{alpha:0});
        TweenLite.to(feel_txt_mc, 1,{alpha:0});
    // Functions feel
    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 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 Live
        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 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});
        //Show Pic
        TweenLite.to(pic_feel_mc, .5, {alpha:1});
        //Show Text
        TweenLite.to(feel_txt_mc, 1,{alpha:1});
        //Hide Other Text
        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 display list that (object) is not there.
    For example, if close_btn instance is not added as child, the following line will throw this error:
    removeChild(close_btn);
    One of the ways to remedy this is to confirm that the object is added:
    if(contains(close_btn)) removeChild(close_btn);

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

    Evenin' all.
    I'm creating a Flash application split up into scenes. One of the scenes is divided into sections of ten frames with keyframes at 1 (home, 10, 20, 30, 40, 50, 60, 70, 80 and 90. Frame #1 is the menu and contains the buttons to skip to each section using the gotoAndStop(); command.
    However, I want to be able to skip to #1 from any point using Next/Previous buttons. I have declared the buttons in frame 1 of scene 1 as follows:
    I have declared the buttons in frame 1 of scene 1 as follows:
    Code:
    var nextButton:Button = new Button();
    var prevButton:Button = new Button();
    var homeButton:Button = new Button();
    At each point, I use addChild(nextButton) to add the buttons to  the stage, and when the buttons are clicked it removes them as follows:
    Code:
    nextButton.addEventListener(MouseEvent.CLICK, goNext);
    function goNext(e:Event):void
          removeChild(videoPlayer);
          removeChild(prevButton);
          removeChild(nextButton);
          removeChild(homeButton);
          gotoAndStop(20);
    Now, all the 'Next' buttons work but none of the 'Previous'  buttons work, when all they do is gotoAndStop() ten frames backwards  rather than ten frames forwards, I keep getting this error message:
    Code:
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
         at flash.display::DisplayObjectContainer/removeChild()
         at Prototype_fla::MainTimeline/goBack()
    The same is happening with the Home buttons, which skip from whichever frame the user is on to the menu. The Next buttons are the only ones working consistently.
    Please help, this is really stressing me out, I'm on Flash CS4.
    Cheers

    You can`t remove the target of your event while it is "active"
    you wrote....
    nextButton.addEventListener(MouseEvent.CLICK, goNext);
    function goNext(e:Event):void
          removeChild(videoPlayer);
          removeChild(prevButton);
          removeChild(nextButton);
          removeChild(homeButton);
          gotoAndStop(20);
    instead you should write sth. like:
    nextButton.addEventListener(MouseEvent.CLICK, goNext);
    function goNext(e:Event):void
      // to be sure that there`s actualloy sth. to remove
          if(videoPlayer!=null){
          removeChild(videoPlayer);
         //similar  
         removeChild(prevButton);
          removeChild(homeButton);                
          e.currentTarget.removeEventListener(MouseEvent.CLICK, goNext)     
          removeChild(e.currentTarget);     
          gotoAndStop(20);
    this is probably similar in your other function, too

  • Error #2025:The supplied DisplayObject must be a child of the caller - Removing Object from Array

    Hi guys, I'm pretty new to as3 and I'm trying to make a game where the player supposedly clicks on the stage and 3 towers which I've spawned dynamically should shoot towards the area. Everything works in terms of tower rotation, etc, but the bullets will not be removed from the stage when I exit the level into another scene. The boundary checking is fine, too.
    Here's 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, which basically, as the name states, exits the level when a button is clicked. It worked perfectly before I started 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 says the error is at the end, where i try to remove the child from the stage. What is wrong? Sorry, I'm a beginner at as3 so any answers might have to be spoonfeeding... I'll try to learn and understand, though. Thanks!
    I did take some of the code off of a guide on the web, and I don't understand it totally, so can someone explain to me what this code does as well? What is e.currentTarget? Thanks!
    var newLaser1:MovieClip = e.currentTarget as MovieClip;
    Here's the full .as file if anybody wants to take a look. http://pastebin.com/5ff4BQa5

    Hi, I managed to solve the errors (kind of) by using this code.
    for (var i:int = tower1BulletArray.length - 1; i >= 0; i--)
    if (tower1BulletArray.parent)
    tower1BulletArray[l].parent.removeChild(tower1BulletArray[l]);
    tower1BulletArray.splice(i, 1);
    However, the problem still persists that the bullets stay in the screen after I change the scene. Any solution? Thanks!

  • Unexplainable exception:  "The supplied DisplayObject must be a child of the caller"

    What am I missing in the following code?  How is the indicated exception possible?  It seems to me that it simply "can't happen", yet it reliably does.
    I'm checking to see if a component is a child of "this", and if it is, I attempt to remove that child.  The remove faults.  Any thoughts?
                if (tf != null && this.contains(tf) == true)
                    this.removeChild(tf);   // Generates exception "The supplied DisplayObject must be a child of the caller"
                    tf=null;

    Check out the documentation for contains().  I suspect that tf isn't actually a child of this, but rather a grand child, or great grand child, ... .

  • DisplayObject must be a child of the caller.

    I am trying to remove the existing childs  (combobox and pods are the content in the page) using
    viewStack.selectedChild.removeAllChildren();
    in a tab click from the Viewstacks canvas.
    then I am trying to add new child.
    it gives this error.
    The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/getChildIndex()
    at mx.core::Container/setChildIndex()[C:\autobuild\3.2.0\frameworks\projects\framework\src\m x\core\Container.as:2449]
    Please help me to fix this

    private function onApplicationComplete():void{
    var arrView:Array =new Array();arrView=viewStack.getChildren();
    viewLength=arrView.length;
    // Load pods.xml, which contains the pod layout. 
    var httpService:HTTPService = new HTTPService();httpService.url =
    "data/pods.xml";httpService.resultFormat =
    "e4x";httpService.addEventListener(FaultEvent.FAULT, onFaultHttpService);
    httpService.addEventListener(ResultEvent.RESULT, onResultHttpService);
    httpService.send();
    private function onFaultHttpService(e:FaultEvent):void{
    Alert.show(
    "Unable to load data/pods.xml.");}
    public var viewXMLList:XMLList =new XMLList(); 
    private function onResultHttpService(e:ResultEvent):void{
    viewXMLList = e.result.view;
    var podcontentbase:PodContentBase=new PodContentBase; 
    var containerWindowManagerHash:Object = new Object();  
    var len:Number = viewXMLList.length(); 
    if (podLayoutManagers.length!=0)podLayoutManagers.splice(0,podLayoutManagers.length);
    for (var i:Number = 0; i < len; i++) // Loop through the view nodes.{
    // Create a canvas for each view node. 
    var canvas:Canvas = new Canvas(); 
    // PodLayoutManager handles resize and should prevent the need for 
    // scroll bars so turn them off so they aren't visible during resizes.canvas.horizontalScrollPolicy =
    "off";canvas.verticalScrollPolicy =
    "off";canvas.label = viewXMLList[i].@label;
    canvas.percentWidth = 100;
    canvas.percentHeight = 100;
    viewStack.addChild(canvas);
    traceDL(viewStack);
    // Create a manager for each view. 
    var manager:PodLayoutManager = new PodLayoutManager();manager.container = canvas;
    manager.id = viewXMLList[i].@id;
    manager.addEventListener(LayoutChangeEvent.UPDATE, StateManager.setPodLayout);
    // Store the pod xml data. Used when view is first made visible.podDataDictionary[manager] = viewXMLList[i].pod;
    //podcontentbase.podDataDictionarycopy[manager] = viewXMLList[i].pod; 
    podLayoutManagers.push(manager);
    onchange();
    private function onchange():void{
    tabBar.dataProvider=viewStack;
    var index:Number = StateManager.getViewIndex(); 
    // Make sure the index is not out of range. 
    // This can happen if a tab view was saved but then tabs were subsequently removed from the XML.index = Math.min(tabBar.numChildren - 1, index);
    onItemClickTabBar(
    new ItemClickEvent(ItemClickEvent.ITEM_CLICK, false, false, null, index));tabBar.selectedIndex = index;
    private var indextab:Number; 
    private function onItemClickTabBar(e:ItemClickEvent):void{
    indextab = e.index;
    StateManager.setViewIndex(indextab);
    // Save the view index.viewStack.selectedIndex = indextab;
    if( this.contains( viewStack.selectedChild) )viewStack.selectedChild.removeAllChildren();
    traceDL(
    this);

  • How to disable the inputfield using radio button dynamically in module pool

    How to disable the inputfield on the screen using radio button dynamically in module pool.
    Please suggest .
            Thanks.
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:20 PM

    I got it thank you.
    LOOP AT SCREEN.
        if  screen-GROUP1 = 'LA1'.
           If RADIO1 = 'X'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
         ELSEIF RADIO2 = 'X'.
           screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:51 PM

  • Adding radio button to each row of an interactive report: possible or not?

    First of all let me explain what the point of this application is.
    I'm making an application that allows a user to select something out of a drop-down select list. This list is a list of categories for food. Let's say the user selects "Fruit".
    Then the page refreshes and shows an interactive report with a list of food that belongs to the category of fruit.
    Here's where I want to change things:
    I want the user to see the interactive report, but in this interactive report I want to add a radio button for each row.
    Then, when a certain type of food is selected (let's say "Strawberry") via the radio button, a text field should appear underneath the interactive report. In this textfield, the user can then add the weight of the food item, and then it will calculate how many carbs there are in the strawberry.
    All I really want to know is:*
    How do I add a radio button to each row of the interactive report, and how do I link this radio button to the value of that particular row?*
    Additional information:
    The item "P17_FOOD_CATEGORY" contains the following LOV:
    select FOODCATEGORYNAME as display_value, FOODCATEGORYID as return_value
    from FOODCATEGORY
    order by 1
    The "Food" region contains the following source:
    select a.FOODID, a.NAME, b.FOODCATEGORYNAME, c.STANDARDAMOUNT, c.NAME Unit
    from FOOD a inner join FOODCATEGORY b
    on a.FOODCATEGORYID = b.FOODCATEGORYID join FOODUNIT c
    on a.FOODID = c.FOODID
    where a.FOODCATEGORYID = :P17_SET_CATEGORY
    EDIT:
    PLEASE! Even if you don't know a good answer or if you are unsure about your answer, do post! Even suggestions would be welcome! I really need all the help I could get, even if it's not much.
    Edited by: 917169 on Feb 29, 2012 12:25 AM

    Hi there!
    I tried to change my code to your version, but then I get an error message:
    Error Unable to change Interactive Report query.
    ORA-12899: value too large for column "APEX_040100"."WWV_FLOW_WORKSHEET_COLUMNS"."DB_COLUMN_NAME" (actual: 32, maximum: 30)
    I don't quite know what this means. After doing a quick search on the internet, I know that this message should mean that the length of the value for the columns named "APEX_040100", "WWV_FLOW_WORKSHEET_COLUMNS" and "DB_COLUMN_NAME" is too long. But, I don't have these columns. I searched for them in my object browser, and they can't be found in any table related to my application.
    I'm sure your answer is the solution, but do you perhaps have an idea on how to solve this error? I checked the allowed maximum length for any column value that is related to my application, but they all have "50" set as the maximum value...
    Thank you for your reply. ;)

  • How can I add radio buttons dynamically?

    Hi,
    I need to add radio buttons dynamically. I will be having a set of options which will be coming form a web service call and I need to convert those options into radio buttons and show it to the user. How can I do it?
    Thanks,
    Hali George

    Yep .... I too would  rather have seen more time put into that kind of stuff than parallax scrolling.

  • Create Radio button dynamically in Table column.

    HI All
       I have used following code to create radio button dynamically. but it's getting dump saying that Could not find attribute STATUS. 
    Here STATUS is the attribute of the node in View context. But why this dump is coming. 
    Please correct me if any thing worng.
      DATA: lr_radio TYPE REF TO cl_wd_radiobutton.
      DATA: lr_containr TYPE REF TO cl_wd_transparent_container.
      DATA: lr_data TYPE REF TO cl_wd_flow_data.
      IF first_time = abap_true.
        lr_containr ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lr_radio = cl_wd_radiobutton=>new_radiobutton(
        view = view
        id = 'RADIO'
        text = 'Enroll'
        bind_selected_key = 'STATUS'
        key_to_select = 'STATUS' ).
        lr_data = cl_wd_flow_data=>new_flow_data( element = lr_radio ).
        lr_radio->set_layout_data( lr_data ).
        lr_containr->add_child( lr_radio ).
      ENDIF.
    Thank you very much
    Ram

    Hi Rama,
    I solved it.check this code.
    i think u did mistake in creating radio button you are not passing the 
    BIND_KEY_TO_SELECT
      instead you are passing KEY_TO_SELECT.
    data:lr_column2 type ref to cl_wd_table_column,
         lr_radio type ref to cl_wd_radiobutton.
       lr_column2 = obj_table->get_column(
                   id         = 'TABLE1_PLANETYPE'
    *              INDEX      = INDEX
    lr_radio = cl_wd_radiobutton=>new_radiobutton(
    *      BIND_ENABLED        = BIND_ENABLED
           BIND_KEY_TO_SELECT  = 'STATUS'
    *      BIND_KEY_VISIBLE    = BIND_KEY_VISIBLE
    *      BIND_READ_ONLY      = BIND_READ_ONLY
           bind_selected_key   = 'STATUS'
    *      BIND_STATE          = BIND_STATE
    *      BIND_TEXT           = BIND_TEXT
    *      BIND_TEXT_DIRECTION = BIND_TEXT_DIRECTION
    *      BIND_TOOLTIP        = BIND_TOOLTIP
    *      BIND_VISIBLE        = BIND_VISIBLE
    *      ENABLED             = ABAP_TRUE
    *      EXPLANATION         = EXPLANATION
           ID                  = 'RAD1'
    *      KEY_TO_SELECT       = KEY_TO_SELECT
    *      KEY_VISIBLE         = KEY_VISIBLE
    *      ON_SELECT           = ON_SELECT
    *      READ_ONLY           = READ_ONLY
    *      STATE               = E_STATE-NORMAL
           TEXT                = 'Test'
    *      TEXT_DIRECTION      = E_TEXT_DIRECTION-INHERIT
    *      TOOLTIP             = TOOLTIP
    *      VIEW                = VIEW
    *      VISIBLE             = E_VISIBLE-VISIBLE
    lr_column2->set_table_cell_editor( the_table_cell_editor = lr_radio  ).
    Thanks,
    Suman

  • Radio button dynamic events

    Hai,
    I am using two radio buttons above the table. If i click first radio button table below should show the fields with some colyumn in drop down option. if i select other one it should show the table cell with editable options(instead of drop down). any ideas pls

    Hi Uday/Rupa,
    i did the similar scenario and i got the output.I didnt give complete logic in my previous post that was outline logic.
    If you change the celleditor dynamically you can accomplish this.
    I have taken this scenario.I have one check box and one table in my view.When check box is not selected i am showing radio buttons in the column of table.
    when i select the check box i am showing the column data in editable mode.
    Write the below code in WDDOMODIFYVIEW
    obj_table ?= view->get_element( 'TABLE1' ).
    data: lr_event type ref to cl_wd_custom_event,
          lr_radio type ref to CL_WD_RADIOBUTTON.
    i am calling this event handler method and i am initializing the value CHECK_VAL which i declared in the attributes of view.     
      *wd_this->onactioncheck(*
        *wdevent = lr_event          " Ref to cl_Wd_Custom_Event*
    if wd_this->check_val is not initial.
    lr_column = obj_table->get_column(
                   id         = 'TABLE1_PRICE'
    *              INDEX      = INDEX
    lr_input = cl_wd_input_field=>new_input_field(
          bind_value          = 'FLIGHTS.PRICE'
          id                  = 'IP1'
    lr_input->set_read_only( value = abap_false   ).
    lr_column->set_table_cell_editor( the_table_cell_editor = lr_input  ).
    else.
    lr_column = obj_table->get_column(
                   id         = 'TABLE1_PRICE'
    *              INDEX      = INDEX
       lr_radio =   cl_wd_radiobutton=>new_radiobutton(
    *              BIND_ENABLED        = BIND_ENABLED
    *              BIND_KEY_TO_SELECT  = BIND_KEY_TO_SELECT
    *              BIND_KEY_VISIBLE    = BIND_KEY_VISIBLE
    *              BIND_READ_ONLY      = BIND_READ_ONLY
                  bind_selected_key   =  'RAD1'
    *              BIND_STATE          = BIND_STATE
    *              BIND_TEXT           = BIND_TEXT
    *              BIND_TEXT_DIRECTION = BIND_TEXT_DIRECTION
    *              BIND_TOOLTIP        = BIND_TOOLTIP
    *              BIND_VISIBLE        = BIND_VISIBLE
    *              ENABLED             = ABAP_TRUE
    *              EXPLANATION         = EXPLANATION
                   ID                  = 'RD1'
    *              KEY_TO_SELECT       = KEY_TO_SELECT
    *              KEY_VISIBLE         = KEY_VISIBLE
    *              ON_SELECT           = ON_SELECT
    *              READ_ONLY           = READ_ONLY
    *              STATE               = E_STATE-NORMAL
                   TEXT                = 'Radio'
    *              TEXT_DIRECTION      = E_TEXT_DIRECTION-INHERIT
    *              TOOLTIP             = TOOLTIP
    *              VIEW                = VIEW
                  VISIBLE             = '02'
    lr_column->set_table_cell_editor( the_table_cell_editor = lr_radio  ).                 
    endif.
    See the output.
    I am unable to paste my output images here using picasa.
    Thanks
    Suman.

  • RangeError: Error #2006: The supplied index is out of bounds.

    Hi Guys
    I am making an Auto-Arrange button and clicking on which
    arranges all the children of the container( which are on the main
    stage) in the tile format. Basically on clicking, I manually move
    those child on the stage to particular coordinates as shown in my
    code. I have pasted my code below. My problem is that as soon as i
    click on the auto arrange button I am getting error "RangeError:
    Error #2006: The supplied index is out of bounds.". Please let me
    know what i am doing wrong and i will appreciate if you let me know
    how would i fix this
    Thanks a lot guys
    Anuj
    ******************CODE**********************
    var aa:Number=0;
    var xcoord:Number=-300;
    var ycoord:Number=-200;
    var xcoord1:Number=450;
    var xcoord2:Number=850;
    var xcoord3:Number=1250;
    var ycoord1:Number=350;
    var ycoord2:Number=650;
    //Button Listener
    btn_AA.addEventListener(MouseEvent.CLICK,autoArrange);
    function autoArrange(event:MouseEvent):void
    if(container.getChildAt(aa)!=null)
    container.getChildAt(aa).x=xcoord;
    container.getChildAt(aa).y=ycoord;
    //Arrange Second
    container.getChildAt(aa+1).x=xcoord+xcoord1;
    container.getChildAt(aa+1).y=ycoord;
    //Arrange Third
    container.getChildAt(aa+2).x=xcoord+ xcoord2;
    container.getChildAt(aa+2).y=ycoord;
    //Arrange Forth
    container.getChildAt(aa+3).x=xcoord+xcoord3;
    container.getChildAt(aa+3).y=ycoord;
    //Arrange Fifth
    container.getChildAt(aa+4).x=xcoord;
    container.getChildAt(aa+4).y=ycoord+ycoord1;
    //Arrange Sixth
    container.getChildAt(aa+5).x=xcoord+xcoord1;
    container.getChildAt(aa+5).y=ycoord+ycoord1;
    //Arrange Seventh
    container.getChildAt(aa+6).x=xcoord+ xcoord2;
    container.getChildAt(aa+6).y=ycoord+ycoord1;
    //Arrange Eight
    container.getChildAt(aa+7).x=xcoord+xcoord3;
    container.getChildAt(aa+7).y=ycoord+ycoord1;
    //Arrange Ninth
    container.getChildAt(aa+8).x=xcoord;
    container.getChildAt(aa+8).y=ycoord+ycoord2;
    //Arrange Tenth
    container.getChildAt(aa+9).x=xcoord+xcoord1;
    container.getChildAt(aa+9).y=ycoord+ycoord2;
    //Arrange Eleventh
    container.getChildAt(aa+10).x=xcoord+ xcoord2;
    container.getChildAt(aa+10).y=ycoord+ycoord2;

    Hi Kglad
    Thanks for reply. Can you please do me a big favor of
    modifying the code so that it would not give that range error.
    I am not sure which way to go because manually i put them at
    specific coordinate and i assume if even i place 1 child on my main
    stage it should work without giving me the error but everytime it's
    checking that whether i place 1 childrens on the stage or not.
    Please help me out.
    Thank you very much for ur help
    Regards,

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

    hello,
    i'm trying to addChild with an interval, using this piece of code, but I allways get an error saiyng the suplied index is out of bounds.
    why?
    what should I do to have mc1 added then wait lets say a second and add m2 2 and so on?
    Thanks
    var tempo_espera:Timer = new Timer(1000, 1);
                tempo_espera.addEventListener("timer", inserir);
                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 bounds.
    at flash.display::DisplayObjectContainer/addChildAt()
    at MethodInfo-346()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()

    using your new code, I got this error
    TypeError: Error #2007: Parameter child must be non-null.
    at flash.display::DisplayObjectContainer/addChild()
    at MethodInfo-343()
    at flash.utils::Timer/_timerDispatch()
    at flash.utils::Timer/tick()
    I had to add mcArray = new Array(); to avoid another error
    // this is array of movie clips
            var mcArray:Array;
            // it is better to declare variable once and then reinstantiate it
            var mc:MovieClip;
            // do your regular routine
            for (var nv:uint = 0; nv<promocoes.length; nv++) {
                var prm;
                prm = promocoes[nv].split("|sep|");
                mc = new MovieClip();
                mc.name = "mc_"+nv;
                // place this new mc into array
                mcArray = new Array();
                mcArray.push(mc);
            // start timer - note that timer will fire as many times as there are movie clips
            var tempo_espera:Timer = new Timer(1000, mcArray.length);
            tempo_espera.addEventListener("timer", placeClip);
            tempo_espera.start();
            // the clip you will apply transition to
            var currentClip:MovieClip;
            // function that places clips
            function placeClip(e:Event):void {
                // get next clip by calling movie that corresponds with the timer counter
                currentClip = MovieClip(mcArray[tempo_espera.currentCount]);
                // 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});

  • Radio buttons, dynamic creation

    hello, you can dynamically create the radio buttons?

    hello Srini, thanks for the answer
    how do I create instances, I tried but it does not work with addistance

  • How can I select a radio button in a table regarding the data in the cells?

    Hi everyone
    This is the issue: I need to select the RadioButton which is in a table with data related to transfers in the cells next to it, so I need to select the correct radio regarding the data next to it.
    This is the whole process: First I go to the Add Recurring Transfer section and select the parameters of the transfer (Accounts, date, amount, months etc), then with VB code I capture those parameters from the page and store them into Global variables for further usage on my E-tester script.
    Right after that I need to select the radiobutton regarding the data of the transfer that I already created in order to delete it or modify it (Please see Attachment selectradio1.jpg)
    So How can I move along the table and compare each cell with the variables that I created with the transfer information, so when I finish comparing a row cell by cell and if all the comparison match well in that row, I could select the radiobutton of the row.
    Note: Second Attachment selectradio2.jpg shows the source code of the table...If you need more info please let me know
    Could you please help me with this problem?? I'm Kind of frustrated with this issue jejeje

    Here is an example. I uploaded mock html so that you can actually try this code. I think this does exactly what you are asking.
    Private Sub RSWVBAPage_afterPlay()
    Dim tbl As HTMLTable
    Dim tblRow As HTMLTableRow
    Dim tblCell As HTMLTableCell
    Dim strValue As String
    Dim rButton As HTMLInputElement
    ' ******** This would be your global variable. I put this so that values are seperated by a semicolin you can use what ever format works for you.
    strValue = "03/22/2008;03/22/2008;*************1977;*************1977;$25.25;Jan, Jun, Jul, Dec"
    ' Strip out the ; for inner text comparison
    strValue = Replace(strValue, ";", "")
    ' This will get the table but can be modifoed to be more specific
    Set tbl = RSWApp.om.FindElement(, "TABLE")
    ' This loops through all the rows in the table until a match to the strValue is found
    ' then clicks the radio button. Findelements allows you to specify a root element
    ' once the correct root row is found, FindElemets can get the correct radio button
    For Each tblRow In tbl.rows
      If tblRow.innerText = strValue Then
        Set rButton = RSWApp.om.FindElement("account", "INPUT", "NAME", , , tblRow)
         rButton.click
       End If
    Next
    End Sub
    I also uploaded the script I created. You should be able to run it and see how it works.
    This should get you going.

Maybe you are looking for

  • Crystal Report 10 in Visual Studio 2008

    Hello, Is there a formal process to make Visual Studio 2008 work with Crystal Report version 10? Are there specific files that need to be installed? Any problems to watch for. I currently tried to port Visual Studio 2003 solution that had working Cry

  • HT3819 sharing i tunes library on the same computer with different users

    How do I share my library on the same computer switching to a different user?

  • Ipod not showing up in finder or itunes

    I had to replace my old ipod and got this new 5th generation video one. i synched it once and haven't done it again in about 3 or 4 months, now it won't show up in finder or itunes. Tried reseting it... nothing. have upgraded to itunes 7.1.1, still n

  • Camera used by another application ??

    I'm with 10.2.8 and I get "camera used by another application" when I launch ichatAV 2.0. The green light on top of camera comes on for 2-3 sec, and goes off. Then I click the iChat pref>video tab and microphone is= isight bulit in; sound output = di

  • IMovie 11 output settings

    If I'm importing Canon 7D footage shot at 720p 50fps which of the following settings would you recommend I use upon exporting with Quicktime: 25 fps 29.97 fps 50 fps Any help would be grateful