February 05, 2008

Flex 2 – Beginners Guide

Went on a flex course eons ago, never used it! Having a bash today as I have a design for a video playing system and I’d like to see how it could be implemented what panels, containers etc. would be needed to get kind of interactive experience I’d imagined.

Key points worthy of note:

Importing graphics to show on your stage, there is no equivalent of the library. Just import to your project folder and then in design view or on code select image and enter the directory path to the image.

There appears to be some really neat way of scaling an image so that corners remain fixed and center grows this could be pretty handy for producing some scalable work. Info here

Stylesheets how to write them seems fairly straightforward, though the css syntax isnt the same argh just

and a stylesheet like this:
Application {
background-image: “backgrounds/brushed_metal.jpg”;
background-size: “100%”;
}

ControlBar {
horizontal-align: right;
}

Label {
left: 10;
}

Panel {
horizontal-center: 0;
vertical-center: 0;
}

TextInput {
left: 85;
right: 10;
}

.userlabel {
top: 12;
}

.userinput {
top: 10;
}

.passlabel {
top: 42;
}

.passinput {
top: 40;
}

But don’t be sloppy with your CSS or everything breaks! Hoping this will help with giving at least the illusion of scaling.


- 5 comments by 3 or more people Not publicly viewable

  1. Mathew Mannion

    Oh good grief, whose idea was it to make the CSS syntax slightly different!?

    05 Feb 2008, 17:44

  2. Steven Carpenter

    Oh good grief, whose idea was it to make the CSS syntax slightly different!?

    Welcome to my world! :-D

    05 Feb 2008, 20:04

  3. Steven Carpenter

    Couple of things that might be helpful – remember to use the @Embed directive in the MXML to ensure the image is compiled with the application, and with stylesheets the Style Explorer on the Flex Start Page is a great tool for tinkering with styles.

    05 Feb 2008, 20:13

  4. Sara Lever

    Steve, would you use the @Embed directive if you’ve called all your images via css? where would you put it? Hey have you tried the scaling images-9 thing? mind be handy for preserving curvy corners.

    08 Feb 2008, 10:00

  5. Sara Lever

    Matt, yeah the CSS was/is styled differently in flash too. Some flash/flex stuff is hot and some is not!

    08 Feb 2008, 11:34


Add a comment

You are not allowed to comment on this entry as it has restricted commenting permissions.

Trackbacks

  1. Scalable Flex App

    Getting a flash app to scale nicely. I’ve blogged about this as a record of the steps required. In the CSS use a background# image with EmbeddingImagesScale9 to keep some areas of a graphic a set size ...

    Sara's Mindbloggeld - 15 Feb 2008, 15:07

February 2008

Mo Tu We Th Fr Sa Su
Jan |  Today  | Mar
            1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29      

Search this blog

Tags

Galleries

Not signed in
Sign in

Powered by BlogBuilder
© MMXII