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 174413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:31:03+00:00 2026-05-11T13:31:03+00:00

I have a custom HBox as so…. public class MyBar extends HBox { public

  • 0

I have a custom HBox as so….

public class MyBar extends HBox {

public function MyBar() { super();  this.height = 65; this.percentWidth = 100;  var newButton:Button = new Button(); //.....  newButton.y = 20;  var spacer1:Spacer = new Spacer(); spacer1.percentWidth = 50;  var spacer2:Spacer = new Spacer(); spacer2.percentWidth = 50;  this.addChild(spacer1); this.addChild(newButton); this.addChild(spacer2);  } 

}

This displays a button in the center of the HBox, but the button is aligned to the top of the Box, I would like it to be in the center.

I’m sure I’ve had this working before as simply as setting the y value. But doesn’t seem to be working now. I am using SDK 3.3

Anyone have any clues as to why I’m having difficulty with this?

Thanks!

  • 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. 2026-05-11T13:31:04+00:00Added an answer on May 11, 2026 at 1:31 pm

    Setting the y won’t work as the HBox controls the y positions. If you’d like all the buttons to be placed in the middle of the HBox you need to set verticalAlign to middle

    in code that would be

    setStyle('verticalAlign', 'middle'); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom ImageView: public class ShadowedImageView extends ImageView { private Paint mPaint; public
I have custom control: public class TestTextBox : TextBox { public TestTextBox() { Text
I have custom class that extends WebViewPage that I use as the base for
I have Custom List to display image with it's name like below... public class
i have custom cell with 2 buttons(the function of these buttons is just to
hi i would like to create a custom calendar, this calendar will have custom
I have created a Popup that is custom component extends Canvas i want the
I have the below function creating new panels inside my ViewStack.. This works fine
I have custom assembly that is loaded on runtime. at this point i have
I have a custom FilterColumnHeaderRenderer with an HBox, inside a Label for the Column

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.