Set vertical center and horizontal center for Button inside a Canvas : Canvas « Components « Flex






Set vertical center and horizontal center for Button inside a Canvas

Set vertical center and horizontal center for Button inside a Canvas
         
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    
    <mx:Style>
        
        .skinnedCanvas {
            borderSkin: Embed("logo.png");  
        }
        
        .starButton {
            upSkin: Embed('logo.png');
            overSkin: Embed('logo.png');
            downSkin: Embed('logo.png');
            disabledSkin: Embed('logo.png');    
        }
        
    </mx:Style>
    
    <mx:Canvas styleName="skinnedCanvas" width="200" height="200">
        
        <mx:Button label="Button 1" width="125" horizontalCenter="0" verticalCenter="-30"/>
        <mx:Button label="Button 2" width="125" horizontalCenter="0" verticalCenter="0"/>
        <mx:Button label="Button 3" width="125" horizontalCenter="0" verticalCenter="30"/>
        
    </mx:Canvas>
</mx:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Scroll ticker symbols across the screen and lets users adjust the speed with an HSlider controlScroll ticker symbols across the screen and lets users adjust the speed with an HSlider control
2.Put Button into a CanvasPut Button into a Canvas
3.Use Canvas to wrap ButtonsUse Canvas to wrap Buttons
4.uses constraint rows and constraint columns to position three Button controls in a Canvas container:uses constraint rows and constraint columns to position three Button controls in a Canvas container:
5.Use Canvas to hold controlsUse Canvas to hold controls
6.A Canvas container with two vertical regions and two horizontal regions
7.A single constraint column that occupies 20% of the Canvas area
8.Canvas background color whiteCanvas background color white
9.Creating a Canvas container by using constraint-based layoutCreating a Canvas container by using constraint-based layout
10.Use a semitransparent Canvas container to highlight the data pointUse a semitransparent Canvas container to highlight the data point
11.Canvas containerCanvas container
12.Canvas RepositionCanvas Reposition
13.Change Canvas cornerRadius and borderStyleChange Canvas cornerRadius and borderStyle
14.Canvas border style solidCanvas border style solid
15.Add style name to CanvasAdd style name to Canvas