Accessing children of children

Hey!
for some reason STORAGE[0].getChildAt(0) works whereas liner.getChildAt(0).getChildAt(0) does not. STORAGE is a movieclip and a child of liner. the error is something about not being able to use getChildAt on a display object.
what's wrong? is there any other approach i could use?
PS: liner.getChildAt(0) works and does indeed seem to refer to STORAGE[0]
thanks!!

What do you mean when you say "liner.getChildAt(0) works and does indeed seem to refer to STORAGE[0]"... in what ways does it work and seem?  You might find out that what you believe is STORAGE[0] is not.
Try using...
trace(DisplayObjectContainer(liner.getChildAt(0)).getChildAt(0));
and see what comes up.
If you have direct access to the objects via the STORAGE array there is no need to be trying to reach them via whatever you might have added them as children.  The reference in the array is a direct line to them.
You should show the code that creates this system so that it is clearer what each element is and from where each arises.  If you are getting an error message, include the complete message.

Similar Messages

  • Accessing children by index

    if I create a symbol, go to the linkage window, set the
    symbol's class name to myClass (which extends sprite), set it's
    base class to Sprite, then create an instance of myClass in AS3, my
    instance already has a child, of type shape, which presumably is
    just an instance of my symbol.
    this seems very problematic. if I want to then add and remove
    children using indices, everything will be off by one (or more?
    or, what if I at some point addChildAt(0)? then things get
    worse
    am I doing something wrong? should my symbol-extended objects
    begin life w/ zero children?
    if not, does that mean I should just stores my children in a
    backing array and manipulate that? or do it strictly by obj
    reference, as in removeChild(ref)?
    thanks

    that may cause some unexpected issue because it's not really
    a sprite and it's not a movieclip.
    anyway, each object created in the authoring environment has
    a graphic child object of some sort. that shouldn't cause any
    problems and doesn't interfere with accessing other child object
    types once you recognize the shape is a child object.

  • Accessing children on frames after gotoAndStop

    Hi
    I have an SWF file where I want to access symbol instances on
    frame 2.
    I have noticed that after I call gotoAndStop(2); it takes a
    little while before the symbol instances are instantiated.
    I get null ref exceptions if I immediately access the
    children on a frame after calling gotoAndStop, but if I wait a bit
    it works, because it seems as if the children have had time to be
    instantiated, see examples below.
    I prefer not to rely on delaying my code, but would rather
    prefer to listen for an event that could notify me when a frame is
    properly "initialised", that is, when all symbol instances have
    been instantiated. Is there such an event and if not, is there
    another solution ?
    Examples:
    mc2 is a movieclip.
    1) This gives null exceptions because the child of frame 2 is
    null when accessed.
    mc2.gotoAndStop(2);
    for(var i:int = 0; i < mc2.numChildren; ++i)
    var child:DisplayObject = mc2.getChildAt(i)
    trace(child.name);
    trace("done");
    But it works if I wait a bit, because apparently I have
    waited enough to allow the child to become instantiated:
    mc2.gotoAndStop(2);
    var intervalId:int = setInterval(callback,100);
    function callback():void
    clearInterval(intervalId);
    for(var i:int = 0; i < mc2.numChildren; ++i)
    var child:DisplayObject = mc2.getChildAt(i)
    trace(child.name);
    trace("callback done");
    trace("done");
    Is there an event that can be used instead of relying on some
    delay ?
    Best regards Stig Nielsson

    My guess is that you are waiting for the timeline to advance
    to frame 2, which doesn't happen instantly, it follows the frames
    per second rate you establish for the file. If the frame 2 clips
    don't exist in frame 1 but that's where your code (which does act
    instantly) starts looking for them, then it was probably looking at
    frame 1 when it ran the code.

  • Accessing children of element created with PopUpManager

    My application has 2 files. First one is main application, second one is custom component (Popup) used to create popup windows. I would like to know how can i access ViewStack element (has id assigned to "vs") in popup from main application.
    NB! Lot of code has been removed for readability!
    application.mxml
    <s:Application creationComplete="init()">
         <fx:Script>
              <![CDATA[
                        public function init():void{
                             var popup:TitleWindow = PopUpManager.createPopUp(this , Popup , false) as TitleWindow;
                             trace(popup.vs , "It's not working!!");
              ]]>
         </fx:Script>
    </s:Application>
    Popup.mxml
    <s:TitleWindow>
         <mx:ViewStack id="vs">
         </mx:ViewStack>
    </s:TitleWindow>

    <s:Application creationComplete="init()">
         <fx:Script>
              <![CDATA[
                        public function init():void{
                             var popup:Popup= PopUpManager.createPopUp(this , Popup , false) as Popup;
                             popup.vs // should get access
              ]]>
         </fx:Script>
    </s:Application>
    Can you please try the above.

  • Accessing Children of VBox

    Hello All,
    I have dynmaically created some CheckBox's and added them to a VBOX.
    What i want to do is create a function that will iterate through them all and deselect. I have got this far:
    private function clearSelection():void
                for (var i:int = 0; i < campaignRadioButtons.numChildren; i++) {
                    var tmpCheckBox:CheckBox = new CheckBox
                    tmpCheckBox = CheckBox(campaignRadioButtons.getChildAt(i));
                    trace (tmpCheckBox.label);
    Ok so this at the moment returns all of the labels. What I want to do is get access to the 'selection' attrubute and set it to false. How do I do this?.. without having to re add them all over again.
    Thanks

    private function clearSelection():void
        var n:int = campaignRadioButtons.numChildren;
        for (var i:int = 0; i < n; i++)
            var tempCheckBox:CheckBox = CheckBox(campaignRadioButtons.getChildAt(i));
            tempCheckBox.selected = false;
    Note: DON'T do
    private function clearSelection():void
        var n:int = campaignRadioButtons.numChildren;
        for (var i:int = 0; i < n; i++)
            var tempCheckBox:CheckBox = new CheckBox();
            tempCheckBox = CheckBox(campaignRadioButtons.getChildAt(i));
            tempCheckBox.selected = false;
    This needlessly creates n new CheckBox instances and frees them when the reference to the ith new CheckBox in tempCheckBox is overwritten with the reference to the ith existing CheckBox.
    Gordon Smith
    Adobe Flex SDK Team

  • Customclass accessing children

    Hi there,
    I made a search looking for custom class problems but didn`t find anything about what I`m having trouble with. Witch I thought to be pretty weird. I think I may be doing something stupid.
    I have a customScrollBar_mc in my library which consists of 2 movieclips instanced as mcBar and mcBackGround.
    I exported customScrollBar_mc for actionscript with a custom class attached to it called CustomScrollBar and I UNchecked the export in frame 1 option (I left only the preloader things with that checked).
    Well, I made my CustomScrollBar class but the problem is. If I try something like this in its constructor
    mcBar.height = 10; or
    mcBackGround.width = 10;
    Flash tells me that those instances doesn`t exist.
    How can I make flash recognize them ?
    Here is some structure information:
    Project organization
    /Project
       /bin
       /src
         Main.as
         /sessions
           CustomScrollBar.as
           Session.as this class instances CustomScrollBar
    Export SWC is checked.
    Sourcepaths added are /src and /src/sessions
    Automatically declare stage instances is UNchecked.
    All my files have no PACKAGE especification (if I add "sessions" to the package name it tells me that it doesn`t especify the real location of the files. Don`t know why this happends.)
    Could anyone please help me with this ?
    Thanks in advance,
    Oscar

    Hi there, the topic was on the 4th page so I decided to make some screenshots and explain better this so it would be easier to help me out.
    I don`t have a clue about it and I just crossed a point where I can`t go any further without this.
    I took a photo of my publish settings, library, movieclip properties andproject folder so you can understand what is happening.
    First of all, the problem is related to the topico_mc movieclip (translation: topic_mc)
    topico_mc is composed by:
    movieclip topico_quadrado_mc (translation: square_topic_mc) that is just a small square: mcSquare
    dynamic text: dynText
    I export it to actionscript with class name TopicosFlash and unchecked export in frame 1 (I tested with this checked too). I also tried browsing my symbol in the Source field just as shown in the screenshot.
    I make the TopicosFlash.as file, make it extends movie clip and add a simple code to the constructor: mcSquare.alpha = 1
    In the document class I simply add it: addchild(new TopicosFlash());
    The issue: mcSquare is a undefined property
    Screenshot:
    Trying to solve this I found some things that for me were strange:
    1) If I don`t make the TopicosFlash.as file, the movieclip is added with no problems.
    2) If I make the TopicosFlash.as file but let it empty flash throw an error: Cannot create property dynText on TopicosFlash.
    3) If I make the file, it gives the mcSquare undefined error.
    Sorry for the bad words but wtf is going on?
    I really am not being able to understand this and I can`t find any answers anywhere.
    Thanks in advance,
    Oscar

  • We have multiple users, each with multiple devices, on 1 apple id - as we want to share music and ibooks etc.  We want the children to have access to the store, but with a financial limit. How do we do this?

    We have multiple users, each with multiple devices, on 1 apple id - as we want to share music and ibooks etc.  We want the children to have access to the store, but with a financial limit. How do we do this?

    Welcome to the Apple Community.
    That's simply not possible I'm afraid. You'd need to give them their own account and allowance or make it so you are required to be there to input the password when they wish to make a purchase.

  • Over the years my children have set up 2 i tunes accounts on my computer is there a way to put them together as one account that everyone can access with their synced i pods, phones etc

    Over the years my children have set up 2 i tunes accounts on my computer (windows vista) can i amalgamate both into one account with one password / account details that all my family can access with their i pods, i phones, i touch etc

    How to use multiple iDevices with one computer

  • HT201269 Hi. I have shared an Apple ID with my children for some time.  As they are getting older they do not wnat me seeing all their messages, photos etc so want their own accounts.  How can they access their purchased music and apps on the new account

    Hi. I have shared an Apple ID with my children for some time.  As they are getting older they do not wnat me seeing all their messages, photos etc so want their own accounts.  How can they access their purchased music and apps on the new account please?

    Yes.
    On their iOS devices, under Settings>iTunes & App Store, they should use your Apple ID. When they log into iCloud, iMessage and Facetime, they should use their personal Apple IDs.

  • I have a 1st generation Time Capsule with current firmware. Can I define the time periods when my children's devices have access to the wi-fi network?

    I have a 1st generation Time Capsule with current firmware. Can I define the time periods when my children's devices have access to the wi-fi network?

    Can I define the time periods when my children's devices have access to the wi-fi network?
    Yes, using the Timed Access feature in AirPort Utility, you can setup specific rules for each wireless device which define the exact timeframe each day that the device will be allowed to connect to the wireless network.
    Example....junior's iPhone can connect.....
    Everyday......Between.....9 AM and 10:00 PM
    or
    Weekdays.......Between......4 PM and 9 PM
    and Weekends.....Between......9 AM and 11 PM
    At the same time, your own personal devices will have Unlimited Access at all times.

  • How to best add VoiceOver accessibility for children's graphic books?

    iBooks Author seems fairly intuitive for the most part with the exception of adding accessibility (VoiceOver) for children's graphic books.
    My story is written as a rhyme and prefer the story to be heard as initial (or primary) VoiceOver after each page advance. That said, because of the (lower) story line page/screen placement (see image) other VoiceOver details are heard first. Because the story is written as a rhyme I found it a broken user experience and frustrating for those in need of the VoiceOver tool during testing (turning on VO in settings).
    I think I fashioned a work around (adding the story line to the graphic images, as well as where the story copy appears)—but at the sacrifice of removing image details (that a blind reader may want to hear) and repeating the story.
    All that said, am I missing something in iBooks Author? Is there a way to manage how I want the VoiceOver to read in sequence on the screen? If not, are there other best practices I could employ?
    Below is a sketch of the page design and numbers reflect the as-is experience vs the desired. Any insights appreciated!

    Seen that topic in iBA Tips and Tricks 01 .. yet?

  • How do I access or delete an Apple ID Nickname created for my children in GameCenter?

    I have created two nickname Apple IDs for my children via GameCenter. Their names show in GameCenter in inverted commas (ie I think they are set up as Nicknames without email addresses linked to them).
    When I try to access the IDs via My Apple ID using the Nickname and their Password, I get the message "You are not a member of the administrator group".
    Now my children have their own email addresses and also have an Apple ID linked to that email address. Is there any way that I can link the original Nickname ID to the new email Apple ID?
    If not, I would like to simply delete the original Nickname Apple IDs, but I cannot access them to delete them.
    Any assistance gratefully received.
    Thanks.

    You have to follow the instructions here and use an email address that you have not yet used with Apple before.
    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • There are certain albums and songs I don't want my children having access to in iTunes Match through their iPod and iPad.  Is there a way to control what songs are visible on different devices?

    There are certain albums and songs I don't want my children having access to in iTunes Match through their iPod and iPad.  Is there a way to control what songs are visible on different devices?

    No.

  • Security class access to parents and children

    Dear Experts,
    If I give "All" access to a parent entity to a user, does it give also access to the children of the parent entity?
    Many thanks.
    Regards,
    Benoit

    Hi Benoit,
    If you give "All" access to a parent entity it means that the user will be able to read/write/promote an entity. If in the application properties "Node security" attribute, you have selected "Entity" the access will be available only for the specific entity. If you have selected "Parent" then the specific access will be available for all the children of that entity.
    Check the admin manual page 90.
    Regards,
    Thanos
    One Truth about...: ..calculation options

  • HT201272 If I create separate Apple IDs for my children, will they still be able to access content I have purchased on their iPhones and iPads?

    If I create separate Apple IDs for my children, will they still be able to access content I have purchased on their iPhones and iPads?

    I happened to stop at the Apple store yesterday for a separate issue and had a discussion about iCloud. Seems like this is how iCloud works (also, there's another thread on this forum that explains it well).
    Each member of the family can have their own iCloud ID, which will be used for Mail, Calendar, Contacts, Apps, Bookmarks, Media, Photos, etc. and having this content synced automatically with a Mac (computer). The iCloud IDs work in tandem with the associated Apple ID — so while you cannot have multiple Apple IDs, you can certainly have multiple iCloud IDs tagged with a certain Apple ID.
    While all this makes sense from the iOS device standpoint, I'm unclear on how things will sync with a Mac computer, especially if the family uses a single iMac with multiple login IDs for various members. For instance, I currently have an iMac and iTunes content resides in my Public folder, which my wife can still access when she logs in with her login ID. I'm guessing that I'll be able to set up her iCloud ID using her login, set up my iCloud ID using my login, while both our iMac logins will retain the same Apple ID. This would take care of syncing Photos, Contacts, Calendars, etc.
    Another (not sure if unique) problem I face is our Address Book — right now, we have one GIANT address book with different groups set up. Certain groups sync to her iPhone, while others to mine. Some contacts are common between both of us. I'm hoping that if she/I updates a common contact, then the change will be reflected in both our groups of contacts. I hope this makes sense — for instance, I update a contact named Joe, and he's on my group of contacts in my iPhone. Hope iCloud updates the master contact card for Joe on the iMac, which would then automatically trigger the update on my wife's group of contacts—that Joe also belongs to— leading to an update on her iOS device as well.
    Apologies for the lengthy response..

Maybe you are looking for

  • Mid year Go-Live (India Payroll)

    Hi, My client's business is now in ECC 5.0, Now we are going live on 01.01.2010 in ECC 6.0, this is not upgradation project, its a fress implementation so please tell me what all are precautions i need to take before going live on 01.01.2010. as this

  • Why can't I see the carrier tab in my settings?

    Why can't I see the carrier tab in my settings? This iphone5 was bought in india where the phones are NOT locked

  • Problem with EXPDP failed job

    Hi, I started one job name expschema for expdp I break that job and remove .dmp files. i used STOP_JOB command. when i tried to run job with same name it throws error. ORA-31626: job does not exist ORA-31633: unable to create master table "SYSTEM.EXP

  • Java RMI & Leopard

    Hi, I have been working on an app. with rmi support under tiger - and everything worked fine. I've now upgraded to Leopard and suddenly things stopped working. I have tried simple "Hello world" RMI examples which worked fine under Windows (BootCamp)

  • IPhoto error message after migration

    Just migrated everything from my old mac to my new one and get the following message when I try to open iPhoto. Does anyone have any advice on how to fix this?