Posts Tagged ‘flex flexmdi example’

January 19th, 2010  Posted at   Adobe Flex

In my previous post I described basic installation of FlexMDI.  Below I give an example of how to use it to create a simple canvas (desktop in browser window) with two sample internal windows.

Create a new project and add the flexmdi.swc to the build library path as describe previously.

In the main project mxml file, do something like this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    xmlns:flexmdi="http://flexmdi.googlecode.com/">
  <flexmdi:MDICanvas
      id="mdiCanvas"
      horizontalScrollPolicy="off"
      verticalScrollPolicy="off"
      width="100%" height="100%"
      backgroundColor="#FFFFFF" backgroundAlpha="0">
    <flexmdi:MDIWindow id="window1"
        title="Window 1" x="30" y="30" width="200" height="200">
      <mx:Label text="Label in the first window" />
    </flexmdi:MDIWindow>
  </flexmdi:MDICanvas>
</mx:Application>

This will make an MDI canvas to hold MDI windows. This example shows just one window, but you can easily add more windows. Each window can then contain other containers and controls.