AddChild/RemoveChild Problem

Hi, I had posted this in the FlashBuilder forum but someone very kindly suggested I post it here instead. So that's what I'm doing.
I'm using FlashBuilder4 (set to Flex 3.5SDK for compatibility) and am running into an issue with RemoveChild/AddChild.
I have a TabNavigator component with several tabs, each tab utilizing a canvas as its child component.
What  I'd like to do is to be able to click a button and have one of the  tabs, say the first (index 0) inaccessbile, then to make it accessible  upon clicking another button. My first thought was to disable the canvas  for the first tab, but I don't see a property for that (i.e. no  tabnavigator1.getChildAt(0).enabled property). But I DO see a "visible"  property; unfortunately, doing a "tabnavigator1.getChildAt(0).visible =  false" in the button's click handler doesn't seem to work. So I settled  on removeChild. Clicking the first button calls a handler with  "tabnavigator1.removeChild(canvas0)", where canvas0 is the child of the  first tab, works fine. Unfortunately, to restore the child I use, in the  clickhandler of the SECOND button,  "tabnavigator1.addChildAt(canvas0,0);tabnavigator1.selectedIndex = 0"  and this does cause the first tab to be selected BUT THE CONTENTS OF THE  PREVIOUSLY DISPLAYED TAB OVERWRITE CANVAS0 (sorry for shouting, just  wanted to emphasize).
The above seems to be an issue (for  me at least) with addChild, since when I started playing with the new  way FlashBuilder handles states, using Add/Remove Child, I would see the  same type of behavior; i.e. one tab's contents overwriting another's.
Has  anyone run into this issue (I've searched and don't see anything)?  Failing that, any ideas what might be going on and what to do to  correct/workaround this issue?
Thanks.

hi
not sure if it will fix your problem but you can enable/disable Canvas.
instead of this:
tabnavigator1.getChildAt(0).enabled = false;
do this:
(tabnavigator1.getChildAt(0) as Canvas).enabled = false;
(FB doesnt know what kind of object getChildAt(0) is, so you have to help it out by specifying the type)

Similar Messages

  • AddChild / removeChild variables declaration (when is best?)

    I am putting together my file right now which is now using visual elements purely added and removed via AS3 (addChild / removeChild) methods. My question is just about the proper time / place to declare their variables.
    Can I declare them all at the start of the movie (frame 1) and just call them when I need them, or is it better to declare them on the frames that they are introduced on? I guess the question is really, will I ever lose those variables throughout the movie once they are declared?
    thanks.

    you won't lose variable declarations.  the only thing that could cause a problem was if you referenced an object in a frame where the object doesn't exist.   but you can declare variables to have an object types and do not need to point the variables to objects (until later in your code).

  • DOM removeChild problem

    I am trying to delete all nodes from one parent node using the code below. However, this is not working. I have 12 children, but it only loops 6 times and also, the original xml file is not changed. The question that I have is, do I need to save the DOM doc back in order for the changes to take affect and also, why doesn't this code loop 12 times.
    NodeList nd3 = nd2.item(0).getChildNodes();
    System.out.println(nd3.getLength()); <-- prints 12
    for (int m = 0; m < nd3.getLength(); m++) {
      Node nod2 = nd3.item(m);
      Node parent = nod2.getParentNode();
      parent.removeChild(nod2);
    System.out.println(nd3.getLength()); <-- prints 6Thanks. Luke

    The classic delete-all gotcha!
    You have children A, B, C, D, E, F (let's limit the example to 6).
    You remove index 0, now you have children B, C, D, E, F.
    You remove index 1, now you have children B, D, E, F.
    You remove index 2, now you have children B, D, F.
    You remove index 3... there isn't any index 3 so nothing happens. And so on.
    How to fix your code? Always remove index 0 is one way.
    PC&#178;

  • AddChild() problem - child doesn't apper at runtime

    I've got very simple class which takes on constructor ArrayCollection of images and adding each one item using AddChild method, here is a code of this class:
    package jb
        import mx.collections.ArrayCollection;
        import mx.containers.HBox;
        import mx.controls.Image;
        public class SliderItemsContainerAS extends HBox
            public function SliderItemsContainerAS(imagesCollection:ArrayCollection)
                super();
                setStyle("backgroudColor", "0x429323");
                for each(var image:Image in imagesCollection)
                    addChild(image);
    Then I creating 2 instance of this class in main application file and of course provide correct images collection. Finally I'm adding the objects to Application.
                private function loadAllImagesComplete():void
                    var itemsContainer:SliderItemsContainerAS = new SliderItemsContainerAS(imagesStack);
                    var itemsContainer2:SliderItemsContainerAS = new SliderItemsContainerAS(imagesStack);
                    addChild(itemsContainer2);
                    addChild(itemsContainer);
    PROBLEM: Only one of added objects (SliderItemsContainerAS) display nested images, why?
    I make a little investigation and when I add somethink else than my Image e.g. Label created in SliderItemsContainerAS constructor it's appers in both instance of the display object.
    I'm attaching main application file where you can see the way I retriving images.

    An image can only have one parent.  You are trying to add them to two
    different parents.  Only the last one will win.  You will need to make
    copies of the images for the other parent.

  • HTMLLoader problem with comboBox

    hi guys
    I'm trying to loader pdf file using XML to retrieve the URL  and I have CombBox to list all the files ,and I need to load another file every time I change the silder for the CombBox
    the problem is the pdf file load only first time and dosent  change if I select another one from the list, I dont know what the the probelm I tried manything like removeChild and I tried to use container but no change, only first time the file loaded
    this is the code
    cb_list.addEventListener(
    SliderEvent.CHANGE,changehandler);
    function changehandler(e:Event):void {
        var sort1:String=cb_list.value;
        var id:String = myXML.tip.(title == sort1)[email protected]();
         //trace(id)
        var slectedtip = myXML.tip.(title == sort1).fulltip.text();
        tit_label.text=myXML.tip.(@ID == id).title .text();
        date_label.text=myXML.tip.(@ID == id).date.text();
        full_tip.text=myXML.tip.(@ID == id).fulltip.text();
         var flashfileURL = myXML.tip.(@ID == id).picURL.text();
        swfURL.text=flashfileURL;
        var url:String = new String();
        url= myXML.tip.(@ID == id).picURL.text().toXMLString();
        var requestpdf:URLRequest=new URLRequest(url);
         var container:Sprite = new Sprite();
        var pdf = new HTMLLoader();
        pdf.height=stage.stageHeight-150;
        pdf.width=stage.stageWidth-270;
        pdf.y=100;
        pdf.x=260;
        pdf.load(requestpdf);
           pdf.addEventListener(Event.COMPLETE, completeHandler);
        function completeHandler(event:Event):void {
            addChild(pdf);

    [problem with combobox comes infront of popup window|http://forum.java.sun.com/thread.jspa?threadID=5291468]

  • Stack Lag, Simultaneous addChild/addtoState Issues

    It would be great if someone could help explain a few issues
    I have been having:
    - The main issue I have been dealing with is a lag time
    between addChild/removeChild and the load of the Images, and the
    actual finished load of the images (complete with height and
    width). Is there a hack that properly checks and halts all other
    code until the action is off the stack?
    For my particular application, when I check if the object
    exists as a child admist addChild/removeChild calls, sometimes it
    is and sometimes its not. I'm currently using a hack to make sure
    the height and width values are loaded, but I don't know enough
    about the internal architecture to write a hack for
    addChild/removeChild calls on the stack.
    - Is there a function that checks if an object exists as a
    child without throwing an error if it is not? It seems everything
    that getChildIndex, etc will throw runtime errors if it is not a
    child. While it may be a workaround to catch the errors, it still
    doesn't return the existence of the object as a child.
    - Is there a way to simultaneously add a child to a specific
    position to an displayobject and a mxml defined state?
    Thanks!

  • One instance of a component in two TabNavigator children

    Hello,
    I currently use a TabNavigator composed of two tabs in which
    I have two instances of the same component and I was wondering if
    it were possible to have a unique instance in those two tabs. Let's
    suppose that I have a TextInput in the tab `A' of my TabNavigator,
    is it possible to have the same instance of this TextInput in the
    `B' tab ?
    The component in my problem is a big component that I would
    like it to be shared in those two tabs without using something
    complicated as addChild() removeChild() on the fly or something too
    complex. For now, I have simply a common model to those two
    instances but I am mostly worried about memory use, this component
    is huge and it would be really cool to have the same instance.
    The best would be something like having a reference in the
    `B' tab of the instance of the `A' like a pointer but I do not have
    enough knowledge in Flex to conceptualize such architecture, so if
    anyone has an idea, I'm all hears. Thanks

    "Bobito7" <[email protected]> wrote in
    message
    news:ghr1v2$1hm$[email protected]..
    > Hello,
    >
    > I currently use a TabNavigator composed of two tabs in
    which I have two
    > instances of the same component and I was wondering if
    it were possible to
    > have
    > a unique instance in those two tabs. Let's suppose that
    I have a TextInput
    > in
    > the tab `A' of my TabNavigator, is it possible to have
    the same instance
    > of
    > this TextInput in the `B' tab ?
    >
    > The component in my problem is a big component that I
    would like it to be
    > shared in those two tabs without using something
    complicated as addChild()
    > removeChild() on the fly or something too complex. For
    now, I have simply
    > a
    > common model to those two instances but I am mostly
    worried about memory
    > use,
    > this component is huge and it would be really cool to
    have the same
    > instance.
    >
    > The best would be something like having a reference in
    the `B' tab of the
    > instance of the `A' like a pointer but I do not have
    enough knowledge in
    > Flex
    > to conceptualize such architecture, so if anyone has an
    idea, I'm all
    > hears.
    > Thanks
    There's an example of something like that with an Accordion
    here:
    http://flexdiary.blogspot.com/2008/09/groupingcollection-example-featuring.html
    It does use addChild, though (addChild handles removeChild,
    so you don't
    need to call it separately.
    HTH;
    Amy

  • Remove child within a movieclip

    Hi guys,
    Does anyone know the actionscript 3.0 parameters in removing the child within a movieclip?
    This is my scenario:
    1. I have two (2) languages which play on the main timeline. Each languages are movieclips.
    2. I have a movieclip which has buttons. These buttons are added dynamically using "stage.addChild(main_menu)"
    3. I have a go back button together with the main timeline.
    How can remove a child on a timeline?
    For example when I choose the language A: it will play through by a movieclip and the buttons will be added dynamically [the dynamically added buttons are inside this movieclip; also the AS3 is inside that movieclip]. I wanted to remove the added child when the go back button is pressed and return to certain frame on the main timeline. The go back button is not included in the said movieclip--it is within the same timeline of languages and I wanted the script to be on the main timeline.
    Hope someone could help me. Thanks a lot.
    YSONG

    http://mtrinitaria.com/mykhel/as3-tips-of-the-day-removechild/
    http://mtrinitaria.com/mykhel/as3-tip-of-the-day-removechild-problems-and-solutions/
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectConta iner.html

  • Loading a video overtop another display object

    Hi All,
    I am trying to load a video on click of a button after my animation plays out.. however, when I load it, it appears behind better_mc.. I tried using addChildAt(); but that doesnt' solve the problem. Any help would very appreciated! Below is the snippet of the code that shows both objcets loaded:
    var test:VideoLoader = new VideoLoader("TestVideo.f4v");
    test.load();
    addChild(test.content);
    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;
    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));
    Thank you!

    I am not familiar with the classes you are using, but for any load processing I am familiar with, the content is not readily available since it takes time to happen.  So you might try just using
       addChild(test);
    As far as that last line of code you show goes....
       addChild(removeChild(better_mc));
    That's not serving any purpose I can see other than placing better_mc on top of anything else, and has the same net effect as just using addChild(better_mc);  The removeChild method returns the object being removed, so it is essentially saying to add the child right after you remove it - which still places it atop anything else.  If you just get rid of that line altogether you might find the video sitting atop everything as you want.

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

  • Syntax coloring / Keyword adding

    In Flash Builder 4, (sorry I'm still downloading, seems a bit slow today, surprise)
    Will it be a big pain in the neck to change the syntax coloring?
    Could I add my own keywords to some kind of list.
    This release seems to be playing catch up to FlashDevelop (I view this as a good thing):
    Automatic generation of Getter/Setters...
    Automatic generation of Event handlers...
    Conditional breakpoints for debuging (Yes it has that)...
    View ASDoc style documentation during code hinting...
    So could you guys please also add two things?
    1:
    One huge gripe I have is the fact that I can't change the colors in FlexBuilder to match my liking, and SO many terms are colored using the default
    that it almost makes syntax coloring a bit worthless.
    2:
    I'd like to be able to change the list of keywords / reserved words / class names / instristic class to add whichever I feel like.
    I like having addEventListener/removeEventListener/addChild/removeChild/getChildAt/getChildByName different color than everything else because I use them so much. I enjoy being able to tell what's what at a glance. Once they're colored I know there's no typographical errors.
    Ok three things...
    3:
    Code hinting in FlexBuilder leaves a lot to be desired. In FlashDevelop if I have a property named _viewPortTop, i could hit enter for the new line, then start typing 'top', and the available options will come up pruning the possible choices as they are filtered out.
    In flex builder, I HAVE to put 'this'., to even GET the list or press ctrl+space which is cumbersome to do each and every time. If i even make a typo, BAM, whole list is gone.
    I don't like seeing 'this' all over the place, since 'this' is assumed in scope.
    If there's an error, then it's a scope issue, go fix it.
    I don't want to clutter my code just cus the hinting is lackluster.
    Mario Gonzalez
    http://onedayitwillmake.com
    Senior Developer | WDDG.com

    Hi Mario,
    I just read your bug http://bugs.adobe.com/jira/browse/FB-20285 and your workaround: "Press ctrl+space, EVERYTIME you want code hinting without having to tyoe 'this'"
    This is by design, not a bug. I believe what you maybe misinterpreted as a feature is that code hints show up by simply typing. This is not true. We follow the JDT convention for explicit code hinting and implicit code hinting for AS in most cases. See auto activation in the JDT preferences for more information.
    We also have implict code hinting for MXML cases. Here are some examples of both AS and MXML:
    Implicit code hints:
    Start of MXML tag "<"
    Start of attribute inside an MXML tag "<s:Button " the space character triggers code hints
    Member access "myButton." the period character triggers code hints
    Extends keyword "extends " the space character triggers code hints
    Vector type declaration "Vector.<" the < character triggers code hints
    new expression "var foo:Button = new " the space character triggers hints
    Explicit code hints can be triggered with CTRL+Space at the user's discretion.
    For the case your are referring to, there is no implicit trigger character. You do have to hit CTRL+space in this case, that's the expected workflow in Eclipse.  I think you are suggesting that any AS identifier character always trigger code hints. Are there other IDE's that you've used that do this? I'm curious to see an example.
    Jason San Jose
    Quality Engineer, Flash Builder

  • Remove child menus with xml

    Hi everyone, my case is that I loaded a xml menu like this:
    <?xml version="1.0" encoding="UTF-16"?>
    <Application>
      <Menus>
        <action type="add">
          <Menu Checked="0" Enabled="1" FatherUID="43520" Position="20" Type="2" String="SISTEC" UniqueID="STEC" Image="imagenx">
            <Menus>
              <action type="add">
                <Menu Checked="0" Enabled="1" FatherUID="STEC" Position="1" Type="1" String="Analítica Financiera" UniqueID="STEC_INFORMES"></Menu>
                <Menu Checked="0" Enabled="1" FatherUID="STEC" Position="2" Type="1" String="Menu Activos" UniqueID="STEC_MENU_ACTIVOS"></Menu>
              </action>
            </Menus>
          </Menu>
        </action>
      </Menus>
    </Application>
    With this code:  ConsSAP.SBO_Application.LoadBatchActions(ref s_xml);
    Then when i try to remove the child nodes with the following xml it doesnt work:
    <?xml version="1.0" encoding="UTF-16"?>
    <Application>
      <Menus>
        <action type="update">
          <Menu Checked="0" Enabled="1" FatherUID="43520" Position="20" Type="2" String="SISTEC" UniqueID="STEC" Image="imagenx">
            <Menus>
              <action type="remove">
                <Menu Checked="0" Enabled="1" FatherUID="STEC" Position="1" Type="1" String="Analítica Financiera" UniqueID="STEC_INFORMES"></Menu>
                <Menu Checked="0" Enabled="1" FatherUID="STEC" Position="2" Type="1" String="Menu Activos" UniqueID="STEC_MENU_ACTIVOS"></Menu>
              </action>
            </Menus>
          </Menu>
        </action>
      </Menus>
    </Application>
    Althought it works if i put "remove" instead of "update" in the root menu...i want to preserve the root menu (and adding it again later is not a valid solution in my case)...
    On the other hand, If i use the following xml it works but i dont want to reformat the xml menu knowing the xml with "update" should do it fine:
    <?xml version="1.0" encoding="UTF-16"?>
    <Application>
            <Menus>
              <action type="remove">
                <Menu Checked="0" Enabled="1" FatherUID="STEC" Position="1" Type="1" String="Analítica Financiera" UniqueID="STEC_INFORMES"></Menu>
                <Menu Checked="0" Enabled="1" FatherUID="STEC" Position="2" Type="1" String="Menu Activos" UniqueID="STEC_MENU_ACTIVOS"></Menu>
              </action>
            </Menus>
    </Application>
    Have i done something wrong in the xml or its a SAP bug?

    http://mtrinitaria.com/mykhel/as3-tips-of-the-day-removechild/
    http://mtrinitaria.com/mykhel/as3-tip-of-the-day-removechild-problems-and-solutions/
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectConta iner.html

  • Need to add 2 properties to DisplayObject

    I am building a mapping application (think google maps) and
    want to be able to add a latitude,longitude to any DisplayObject
    (or subclass) so I can still use all the built-in AddChild,
    RemoveChild, etc. methods. I was thinking I could just extend
    DisplayObject to GeoDisplayObject and add the custom properties and
    methods, but then I can't cast any of DisplayObjects subclasses to
    a GeoDisplayObject.
    Any Ideas?

    Hello,
    Either you could copy the existing report for MB51 - RM07DOCS into a Z report and add these two fields depending on where these columns are required (header or item level - as the output is a hierarchial alv report) in the corresponding tables defined in the program HEADER or ITEM. populate the respective data in the internal tables and add these fields in the corresponding field catalogs.
    As you are using ECC 6.0, you can also check if an implicit enhancement is available. You will have to add these fileds in the internal tables HEADER or ITEM, these fields will also be added in the corresponding field catalogs and a point where the logic to add data into the internal tables.
    These values passed to the ALV will display the new columns.
    Thanks and Regards,
    Sachin

  • Need some help with Panel

    NOTE: I am using Flex Builder 3, I'm not sure if just the
    BUILDER is upgraded to 3, or Flex is upgraded as well. There
    doesn't seem to be a Flex 3 forum here or on Adobe labs. I am
    posting here hoping that this is a general Flex problem and someone
    can help me.
    I and trying to make a sub-class of Panel with a series of
    buttons at the top. As the buttons will be outside the container
    area, I chose to put them into the titleBar. using
    titleBar.addChild()
    The problem is, the buttons I place inside the titleBar do
    not get Events.
    In what I think is a related problem. If you adjust the
    "headerHeight" property to say "12" and then have controls
    (button/combo) at the top of the panel's container, the top of
    controls do not get events, but the bottom of the controls do. It
    seems that something in the Panel is blocking events at the top of
    the panel.
    Any ideas?
    Thanks
    -pete

    I have gathered more information about this issue today. it
    seems that the issue is not the panel, but the outer container that
    I embedded it into. The effect I was trying to get was a panel with
    a highlight at the top. To do this the border alpha has to be set
    to "0" otherwise you see odd artifacts, but then the highlight can
    only apply to the background color.
    To get the effect I wanted, I embeded the panel with the
    highlight and buttons inside another panel (with the
    backgroundColor i wanted and solid border) embeding the panels is
    what caused the mouse events to go missing. Changing the outer
    Panel to a Canvas fixed the problem.
    However I still think there is a problem with Panels.
    embedding a Panel inside another Panel should not make the mouse
    events disappear. I'm just not sure where the real problem is.
    If anyone is curious, i can prepare a simple test app that
    shows the bug.
    -pete
    -pete

  • Linking swfs or exe files?

    I need help with a Flash AS3 project that includes about 30 videos. I needed to break it in smaller pieces because it is a large file (over 300 mb) and every time I wanted to publish the entire project flash crashed.
    Here is my test:
    I have two exe files that should link back and forth.
    Intro_YIM.exe, which has a button that links to Videos_FrontPage_YIM.exe
    Here is my code, which is in Intro (button name= nav_4).
    nav_4.addEventListener(MouseEvent.CLICK, gotoVideoFront);
    function gotoVideoFront(event:MouseEvent):void {
      var url:String = "Videos_FrontPage_YIM.exe";
      var request:URLRequest = new URLRequest(url);
      try {
        navigateToURL(request, '_self');
      } catch (e:Error) {
        trace("Error occurred!");
    Problem:
    The link seems to work, but there is a message that says save or run. When I click run, there is another message that says the file can't be open.
    Questions:
    1. Is there a better way to handle links using executable files using Flash CS5 and AS3?
    2. If swfs were used, how can I have a main page displaying all other swfs as they are linked?

    Kglad:
    Yes, initially I thought that exe files was the way to go. However, I've been searching for options and found that by using the class Loader, I can load swfs files instead of exe files.
    Here is what seems to work with only swf file:
    var my_loader:Loader = new Loader();
    nav_4.addEventListener(MouseEvent.CLICK, startLoading);
    function startLoading(e:MouseEvent):void {
        my_loader.load(new URLRequest("Videos_FrontPage_YIM.swf"));
        addChild(my_loader);
    Problem: I have a interface, which loads all other files by way of buttons. For instance, nav_4 button loads the file Videos_FrontPage.swf. When this movie loaded, the interface was also gone.
    How can I keep the same interface and still be able to load all other movies?
    Your help is appreciated.

Maybe you are looking for

  • Re: [iPlanet-JATO] Use Of models in utility classes

    Hi Matt, Sounds like some of the stuff we need to migrate has a lot in common with Namburi's project. I would be very keen to get hold of a copy of the 'tactic' document you mention below, as well as the sample code you mention to replace CspDBResult

  • Satellite Pro A200 PSAFCA: Need Lan and display driver for XP

    Hey please help me! I have just installed XP on my new satalite pro, but i have had trouble with the drivers. At the moment I have installed most but from this site i can't seem to find a driver that will help my network card, nor my video NIVIDIA dr

  • IC Webclient. Typing Lag

    How am I going to explain this? Ok there we go. Our users are complaining about CRM performance in specific there are complaining about typing lag. They are typing faster than what shows in IC webclient fields. I was wondering If any one has experien

  • Data are not being applied at destination side

    Hi all, I have implemented real time streams replication(not archive log based downstream replication). source:9.2.0.8.0 destination:10.2.0.2.0 Capture and propagation is working fine. DBlinks are also fine. Apply process is running , but data are no

  • Not able to connect wifi after ios5 upadate

    Hi i updated my ipod with ios 5 after updation is successfully done i am not able to connect with my wifi network. the thing is my i pod is getting connected with my system but when open safari it shows error msg like this "Safari cannot open the pag