Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7128373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:07:55+00:00 2026-05-28T11:07:55+00:00

The basic problem I’m trying to solve is that I have a mix of

  • 0

The basic problem I’m trying to solve is that I have a mix of Flex & Flash components, and I have a generic function for adding a progress spinner to the component regardless. So if the component is a Container, I add it to the rawChildren, otherwise add it normally.

However, I’m running into a problem with a component that inherits from VBox. I call

cont.rawChildren.addChildAt(spinner, cont.rawChildren.numChildren);

But when I trace the children, my spinner shows up in cont.getChildren(), and the comp.numChildren obviously also increases by one. And other containers seem to work properly, even other VBox controls.

I walked through the Flex framework code and I can’t find anything to explain why this would happen, either via inheritance or timing.

Has anyone seen anything similar or can explain why rawChildren might not be predictable in this case?

Thanks.


Function:

var bcu:Number = u.numChildren;
var bce:Number = el.numChildren;

el.addChildAt(s, ((pos > -1)?pos : el.numChildren));
trace("ADD NEW SPINNER", u, el, el.numChildren, u.numChildren, bce, bcu);

Where el is either the DisplayObject or the rawChildren object of a container, and u is the original object the spinner is being attached to.

Output:

ADD NEW SPINNER BlockMovePopup1734 [object ContainerRawChildrenList] 6 5 5 4

And then:

[Fault] exception, information=TypeError: Error #1034: Type Coercion 
failed: cannot convert com.misc::SbSpinner@57970a1 to mx.core.IUIComponent.

The output shows that el is correctly set to ContainerRawChildrenList (the rawChildren object for the VBox) and that the numChildren is [6,5] vs [5,4] prior to the call. This means the Sprite is being added to the content children rather than to the rawChildren.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:07:55+00:00Added an answer on May 28, 2026 at 11:07 am

    That was fun. Found the quirk. I think maybe the rawChildren.addChildAt function is a bit buggy. Found this block of text in the Container class:

        Container assumes that content children are contiguous, and that
        non-content children come before or after the content children.
        In order words, Container partitions DisplayObjectContainer's
        index range into three parts:
    
        A B C D E F G H I
        0 1 2 3 4 5 6 7 8    <- index for all children
              0 1 2 3        <- index for content children
    
        The content partition contains the content children D E F G.
        The pre-content partition contains the non-content children
        A B C that always stay before the content children.
        The post-content partition contains the non-content children
        H I that always stay after the content children.
    

    If I used rawChildren.addChild it works fine for now. In both cases, the spinner was being added as the last child, but addChild does it correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have such a basic problem in Delphi,I can't solve it. My Code: Note:DataR
Got some basic problem again. I need to modify a function that previously returned
Pretty basic problem here. So I have a Java package that I have created
The basic problem is that upon trying to uninstall the default SQL 2005 express
I have a probably very basic problem with PIL's crop function: The cropped image's
So, my basic problem is that I'm trying to write a program for a
My basic problem is that I'm trying to re-merge trunk and a branch in
I am trying to expand from php. Here is a basic problem I have
The basic problem I have here is that I have one xml file that
I am trying to solve a basic problem with drag and drop on iPhone.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.