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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:21:28+00:00 2026-05-12T08:21:28+00:00

I have Buttons which I have rotated vertically within a Canvas, that is working

  • 0

I have Buttons which I have rotated vertically within a Canvas, that is working fine. The problem occurs, when the user resizes the window to a small size a vertical scroll bar appears, I would rather have each button squashed upto a smaller size.

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="40" maxWidth="40" xmlns:myComponents="myComponents.*"
  horizontalScrollPolicy="off"
 creationComplete="created()" initialize="init()">
 <mx:Script>
    <![CDATA[
        import mx.effects.Rotate;

        function created() : void {
            addBtn("Personal");
            addBtn("Work");
            addBtn("Three");
            addBtn("Four");

        }

        function addBtn(name:String) {
            var newBtn: Button = new Button();
            newBtn.label = name;
            newBtn.styleName = "drawerButton";
            newBtn.width = 150;
            newBtn.x = (-newBtn.width / 2) + 50;
            newBtn.y = (-newBtn.height / 2) - 30;

            var rotationContainer:Canvas = new Canvas();
            rotationContainer.clipContent = false;
            rotationContainer.addChild(newBtn);
            rotationContainer.rotation = 90;
            rotationContainer.height = 150;

            uiContainer.addChild(rotationContainer);
        }

    ]]>
 </mx:Script>
 <mx:VBox x="5" y="30" right=""  >
    <mx:VBox id="uiContainer" right="0" verticalGap="2" >
    </mx:VBox>
    <mx:Button id="uiAdd" styleName="addButton" >
    </mx:Button>
    <mx:Button id="uiRename" styleName="renameButton">
    </mx:Button>
    <mx:Button id="uiDelete" styleName="deleteButton">
    </mx:Button>
 </mx:VBox>

So in this case the buttons would go from a width of 150 to min of 20.

  • 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-12T08:21:28+00:00Added an answer on May 12, 2026 at 8:21 am

    You need to link up to the resize handler of the control that’s being resized, and from there you can get the information that you need off of the event object, including (if you need it) the old width of the control. Here’s a simple sample:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns:myComponents="myComponents.*">
        <mx:Script>
            <![CDATA[
                import mx.controls.Button;
                import mx.containers.Panel;
                import mx.events.ResizeEvent;
    
                public function resizePanel(width:int, height:int):void
                {
                    thePanel.width = width;
                    thePanel.height = height;
                }
    
                public function panel_resizeHandler(event:ResizeEvent):void
                {
                    var myPanel:Panel = event.target as Panel;
                    var padding:int = 10;
                    var width:Number = myPanel.width - padding * 2;
                    for(var i:int = 0; i < myPanel.childDescriptors.length; i++)
                    {
                        if(myPanel.childDescriptors[i].type == Button)
                        {
                            var myButton:Button = this[myPanel.childDescriptors[i].id] as Button;
                            myButton.width = width;
                        }
                    }
                }
            ]]>
        </mx:Script>
        <mx:ControlBar>
            <mx:Button label="300x160" click="resizePanel(300, 160)" />
            <mx:Button label="800x160" click="resizePanel(800, 160)" />
        </mx:ControlBar>
        <mx:Resize id="resize" />
        <mx:Panel id="thePanel" resize="panel_resizeHandler(event)" width="800" resizeEffect="{resize}">
            <mx:Button id="fileBtn" label="File" width="200"/>
            <mx:Button id="editBtn" label="Edit" width="200"/>
            <mx:Button id="deleteBtn" label="Delete" width="200"/>
            <mx:Button id="aboutBtn" label="About" width="200"/>
        </mx:Panel>
    </mx:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Obvious solution: Return an array, like ("success" => false, "explanation"… May 13, 2026 at 10:21 am
  • Editorial Team
    Editorial Team added an answer This provides what you are looking for: May 13, 2026 at 10:21 am
  • Editorial Team
    Editorial Team added an answer I found the answer here: http://john.regehr.org/latex/. Excerpt: When a non-sentence-ending… May 13, 2026 at 10:21 am

Related Questions

I have a question regarding launching new activities. It boils down to this. I
I have a UIViewController that returns YES in shouldAutorotateToInterfaceOrientation: for UIDeviceOrientationPortrait and NO for
First a little intro: Last year i wrote this http://dragan.yourtree.org/code/canvas-3d-graph/ Now, i want to
I am developing a game in which I am using Landscape mode I have

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.