Log In  
  Getting Started  
----------------------------------------

Resources

 

Canvas container - absolute positioning

  • Canvas is the only container that lets you explicitly specify the location of its children within the container.
  • Canvas has only one layout value - absolute.
  • Use the x and y properties of child components for pixel-perfect layouts.
  • If the display window is resized, the child components stay fixed in place and may appear cut off.
  • Using absolute positioning you can make child controls overlap if desired.
previous page next page

User rating?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    backgroundColor="#FFFFFF"
    backgroundAlpha="0">

	<mx:Canvas x="23" y="34">

        <mx:Button label="&lt; prev"
            x="4" y="97" />

        <mx:Image source="assets/animals03.jpg"
            x="85" y="4" />

        <mx:Label text="Photographed by Elsie Weil"
            x="85" y="230" />

        <mx:Button label="next &gt;"
            x="381" y="97" />

	</mx:Canvas>

</mx:Application>

Rendered Sample

previous page next page

Added by Mark Nichoson , last edited by matthew horn on Apr 22, 2008  (view change)
Labels: 
(None)

Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators