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

  • Home
  • SEARCH
  • 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 510261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:05:44+00:00 2026-05-13T07:05:44+00:00

I am trying to develop a custom component to act as a divider. <?xml

  • 0

I am trying to develop a custom component to act as a divider.

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml">
   <mx:Canvas id="left"/>
   <mx:Canvas id="right"/>
</mx:HBox>

I would like to use this component to assign objects like this:

<Divider>
    <left>
        <mx:label text="Stuff I want to put in the left canvas"/>
        <mx:label text="etc..."/>
        <mx:label text="etc..."/>
    </left>

    <right>
        <mx:label text="Stuff I want to put in the right canvas"/>
        <mx:label text="etc..."/>
        <mx:label text="etc..."/>
    </right >
</Divider>

Unfortunately, this does not work. I get a compiler error saying :
In initializer for ‘left’: multiple initializer values for target type mx.containers.Canvas.

What am I missing ?

  • 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-13T07:05:44+00:00Added an answer on May 13, 2026 at 7:05 am

    I ended up finding the solution reading the following from the Adobe website.

    Using the technique described as template component, you can specify an array of a certain type of objects. I ended up rewriting my component as follow:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init()">
        <mx:Script>
        <![CDATA[
    
           [ArrayElementType("mx.core.UIComponent")]
           public var right:Array;
    
           [ArrayElementType("mx.core.UIComponent")]
           public var left:Array;
    
           protected function init():void
           {
               var i:int;
    
               for (i = 0; i < left.length; i++)
                   leftCanvas.addChild(left[i]);
    
               for (i = 0; i < right.length; i++)
                   rightCanvas.addChild(right[i]);            
           }         
    
        ]]>
        </mx:Script>
    
        <mx:Canvas id="rightCanvas"/>
        <mx:Canvas id="leftCanvas"/>
    </mx:HBox>
    

    It now works as intended.

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

Sidebar

Ask A Question

Stats

  • Questions 298k
  • Answers 298k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer C4996 means you're using a function that was marked as… May 13, 2026 at 7:36 pm
  • Editorial Team
    Editorial Team added an answer Here is a simple "Knock Knock" server courtesy of Sun:… May 13, 2026 at 7:36 pm
  • Editorial Team
    Editorial Team added an answer From php documentation on mysql_query() Return Values For SELECT, SHOW,… May 13, 2026 at 7:36 pm

Related Questions

I am trying to develop a custom widget for camera preview. I would like
I'am trying to develop a Custom drupal module which will read arguments from the
I am writing a python platform for the simulation of distributed sensor swarms. The
I am trying to develop some general purpose custom ValidationAttributes. The fact that one
I am a complete beginner trying to develop for FCKeditor so please bear with

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.