The following example shows how you can dock an ApplicationControlBar container by setting its dock property to true. Yes, this is perhaps the shortest and most boring example ever. Enjoy!

Full code after the jump.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/08/25/docking-an-applicationcontrolbar-container/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <mx:ApplicationControlBar dock="{checkBox.selected}">
        <mx:CheckBox id="checkBox" label="dock" />
    </mx:ApplicationControlBar>

</mx:Application>

View source is enabled in the following example.

 
Tagged with:
 
About The Author

Peter deHaan

Peter deHaan currently works for Adobe on the Flex SDK QA team. While not working on Flex, Flash, and ColdFusion applications, Peter enjoys making up bios and writing in 3rd person. Peter's rarely updated blog can be found at blogs.adobe.com/pdehaan/, actionscriptexamples.com, airexamples.com, and coldfusionexamples.com.

4 Responses to Docking an ApplicationControlBar container

  1. DCHall says:

    First I have to say, you rock for posting these examples. I have been doing web development for 6 years and have worked on an off in Flash during that time. So I know a lot of the basics but I am more of a design guy. I have now been pushed to work with flex/air for a couple of projects when I came across your site. Great example walkthrough’s! Your site alone has got me up and running in a short time.

    Now to my question… Would this example also work docking if you we not using flex chrome/window or windows chrome. Example. I am making an application that would basicly dock to the top/screen or taskbar on launch. Then when clicking the control bar a canvas will slide up or down depending on location on screen. I hope I am explaining that right.

  2. peterd says:

    DCHall,

    I haven’t had a chance to play with AIR very thoroughly yet and haven’t tried doing that yet.

    Sorry,
    Peter

  3. Asif Bilal says:

    This blog is really useful for new flex users. Because, it helps them in a great deal.
    So, I just would like to appreciate the website owner to build such an innovative and informative Web Site.
    Thanks,
    Asif Bilal
    Pakistan

  4. isundil says:

    is it possible to set the dock position (not only on top) ?

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree