cancel
 

 

Job type :

Zip Code :

community forums

Featuring over 100 topics of interest to DoItYourselfers.

How to Use Absolute Layout in Flex Builder 3

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Video Transcript

For most of the other projects that we will be using throughout the rest of this course, we are going to be using starting files. So what I would you like to do is just to Delete this Fundamentals projects. So click on Fundamentals here and either right click or Ctrl+Click and just choose Delete and this will delete the Fundamentals project. In this case, we don't want to delete the contents. We just want to delete the project from Flex Builder. So go ahead and click Yes and make sure that they Do not delete, content's radial button is in fact selected. That should get rid of the project and now we will be able to set up a new project, using the starting files, so we can see code and minimize the typing that we need to do.

So now again in your Navigator Panel right here, right click or Ctrl+Click, choose New and then Choose Flex Project and then give your project a name of Fundamentals and some users here may see an error if you are still pointing to the old Fundamentals folder. We are going to fix that in moment so don't be alarmed if you see an error there, but just click Browse, choose Desktop, point back to your Flex Projects files, choose your Fundamentals folder and then choose your studentFiles folder and point to this Fundamentals folder that we have right here.

Go ahead and click Choose and then make sure that it's currently set to a Web application that we will run in the Flash Player and in this case we are not going to use any Application server type and then go ahead and click Next and make sure that your SWF files will be outputted to the bin folder that you see there. Go ahead and click Next again and again in this case we want to use actually a starting file. So we are not going to use a the Source folder in this case and what we are going to use is we are going to use a starting file that's located at the root of our project and so make sure you delete the source folder like you saw me do there and then click on Fundamentals_Wt2.mxml and go ahead and click OK.

So now click on Finish and you should see our starting file here with the _wt2 and you will see a very similar application to what we created before, but this will just help us minimize some typing and notice of course there is an Application tag and an XML Name Space tag and notice that the layout is set to absolute. Now again you should see that this is already saved which means it is already been compiled because we set our Build Automatically here. So all we have to do is Run this and when we Run this, what you will see is you will see three labels, all stacked on top of one another. Now go ahead and close of your Browser like so and the reason they are stacked on top of one another is because the layout is currently set to absolute and what means is that means you have to manually control the X and Y placements of each one of those different labels.

So in this case to avoid that stacking on top of one another which is the default because in this case you can see that the X and Y positions are not placed, I am just going to say X = "20" for the first one and I am going to set the Y = "25". For the second Label Control, I am going to set the X = "0" and the Y = "300". For the third one I am going to set the X = "300" and the Y = "200". Now when we save this, that's going to off course compile it. When I click Save and notice I do get a Syntax error because what I did as I did not include a space between the Font size and notice as soon as I compile, that's displayed in my problems, so what I am going to do is just add in a space and I am going to re save it and recompile that SWF file and again you will see I did the same thing on the next line.

So I am going to click File>Save again and you should see that there now are no errors in my project and when I Run this, you will see that this now displays in the browser. I have now manually controlled the placement of my different Label Controls and notice in the Flash player the X and Y coordinates are little bit different then they are in the Geometry class. The X,Y, 00 is up at the upper left hand
For most of the other projects that we will be using throughout the rest of this course, we are going to be using starting files. So what I would you like to do is just to Delete this Fundamentals projects. So click on Fundamentals here and either right click or... click to read more


Painting Stylish Wall Borders

sponsored articles of the day

diy centers

Research and explore a wealth of wisdom on these topics