Archive for May, 2008

CSS bar graphs

May 21, 2008

Examples

  • “<table>” is rendered row by row(“<td>”) top to bottom;
  • Inside “<tr>” you can nest “<th>” or “<td>”;
  • “<td>” and “<th>” don’t need to have close tags;
  • Nested table must be inside a “<td>” node;
  • “<table>” tries to equalize widths of all cells(“<td>”) of the same column.
    The 2nd table in the preceding examples uses a nested table to create variant widths.

Vertical bar graphs using css

Real world bar graphs (with some CSS)

Use swc in flex

May 5, 2008

Scenario 1: You need to compile ActionScript code as a reusable component in Flex Builder.

Solutions: Follow the steps (FB plugin v3):

Step 1. Compile swc. First you will need to create a new “Flex Library Project”. Then copy all the actionscript code into the top folder of your project file, retaining the package/namespace structure (fig. 1)

The file structure and xml manifest file in Flex Library Project

In “src” folder, you would need a xml-manifest.xml file where you declare the class and id (optional, default to the class name anyways) (fig 1). Thirdly, you would need to define your namespace for the class that’s going to be referenced in MXML (or Flash?) like so: In the AS class fine, inside the class definition, just like the way as you declare a variable, add “public namespace fc;” (substitue “fc” with whatever your choice of namespace). If you’ve enabled “build automatically” (under “Project” menu command), FB will instantaneously build the deploy files for you the time you save the AS file. The result is the complied .swc file, which you can find in the “bin” folder in your library project.

Step 2. Use swc in your Flex project. You either need to copy the swc file(s) into the library-path folders as defined in your flex-config.xml, or explicitly tell Flex to use the swc you want in your current project. To do so, go to “Project properties”->”Flex Build Path”->”Library Path”->”Add SWC”. You can simply navigate to the swc file in the Flex library project as defined in Step 1. After Flex compiled the project, you can use the component as defined in your ActionScript code. Here is an extract:

<mx:HBox>
<mx:Label text="Search by last name: "/>
<fc:AutoComplete id="lastNameSrchAC" dataProvider="{listInfo}" labelField="lastName"/>
</mx:HBox>

See also: Namespaces in Flex and Soprano

How to update everyone’s profile page at facebook (same content for everyone)?

May 2, 2008

How To Set Up A Facebook RSS Feed Reader Application For Your Blog – Page 5