Archive for the ‘Adobe Flex’ Category

January 20th, 2010  Posted at   Adobe Flex, Uncategorized
   |   No Comments

Forgive me if this is trivial and beginner (because it is :) ).

Here are two ways to get an image into a button.

First Method, using assets added to the project:
1. Open project properties, go to Flex Build Path, Source path tab, and click Add Folder…
2. Add the folder of images to your project
3. Reference an image in a button like this:
<mx:Button label=”Ok”
  icon=”@Embed(source=’accept.png’)” />
(A ton of great icons at Famfam)

Second Method, using absolute referenced assets:
1. Reference an image in a button like this:
<mx:Button label=”Ok”
  icon=”@Embed(source=’c:/assets/icons/famfam/accept.png’)” />
(Note the forward slashes)

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.

January 19th, 2010  Posted at   Adobe Flex

Thus begins my Flex self-education.  For my own benefit, and for the benefit of others just starting, I shall make some notes in blog posts on topics that I think are particularly useful.

FlexMDI is a multi-document interface library for Flex apps.  It allows you to essentially create multiple windows in the good old Windows MDI style within a Flex app.

You can find FlexMDI here: http://code.google.com/p/flexmdi/

  1. Download and unzip the flexmdi-x.y.zip (where x and y are version numbers) to a safe place on your machine.
  2. In FlexBuilder, with your project open, open the project properties (Project->Properties).
  3. Select [Flex Build Path] on the left, then click the [Library path] tab on the right.
  4. Click [Add SWC...], and navigate to the place where you unzipped flexmdi.  Go into the bin directory and select the “flexmdi.swc” and click [Open].

Now the flexmdi tags and elements should be available to your project.

FlexMDI usage examples will come in future posts.