• warning: Creating default object from empty value in /home/rbezemer/softwarebyrichard.com/modules/taxonomy/taxonomy.pages.inc on line 34.
  • warning: Parameter 1 to tac_lite_node_grants() expected to be a reference, value given in /home/rbezemer/softwarebyrichard.com/includes/module.inc on line 483.
  • warning: Parameter 1 to tac_lite_node_grants() expected to be a reference, value given in /home/rbezemer/softwarebyrichard.com/includes/module.inc on line 483.
  • warning: Parameter 1 to tac_lite_node_grants() expected to be a reference, value given in /home/rbezemer/softwarebyrichard.com/includes/module.inc on line 483.
  • warning: Parameter 2 to gmap_gmap() expected to be a reference, value given in /home/rbezemer/softwarebyrichard.com/includes/module.inc on line 483.
  • warning: Parameter 1 to tac_lite_node_grants() expected to be a reference, value given in /home/rbezemer/softwarebyrichard.com/includes/module.inc on line 483.
  • warning: Parameter 1 to tac_lite_node_grants() expected to be a reference, value given in /home/rbezemer/softwarebyrichard.com/includes/module.inc on line 483.

Flex Code

Embedding fonts in Flex 4

One thing that seems to be always required on most flex project I've been a part of is the ability to dynamically embed fonts the the project. It just comes with the territory of creating dynamic content generators where you want the user to be able to have as many fonts as they can, but don't want the overhead of loading 100+ fonts at load time.

 

AlivePDF

AlivePDF is a fantastic client side pdf generation library for ActionScript that I found a few months ago. It's opensource and a relatively new project but I've found it is an extremely powerful and fast library. Using the library is simple. Most of the configuration is done all from creating an instance of the PDF class :

  1.  
  2. var _pdf:PDF = new PDF(_orientation, Unit.INCHES, _page_size);
  3. _pdf.setDisplayMode( Display.FULL_PAGE, Layout.SINGLE_PAGE );
  4. _pdf.setBottomMargin(0);

Experimenting with F*CSS

I've been spending some time using the open source F*CSS library. This is an excellant library designed for flash that lets you apply flash based properties as a css stylesheet. This may not seem like much but it paves the way for adding some very powerfull features to your flash applications.

Flex adding subelements as properties to a custom component

I was trying to extend a TextArea control, and all was working well untill I tried to use my class like the following:

  1. <widget:myhtmltextarea> <mx:htmltext> <!--[CDATA[
  2. <DIV STYLE="text-align:LEFT;"><SPAN STYLE="color:#7DB73F;font-size:20px;font-family:'Times New Roman';">Title Text</SPAN></DIV>
  3. ]]--></mx:htmltext> </widget:myhtmltextarea>

 

which of course resulted in the nice cryptic error message :

 Could not resolve <mx:htmltext> to a component implementation.

 

Flexing the Youtube Chromeless player

Getting youtube and flex / flash to work together can be a nightmare. Our original implementation ended up having us being forced to do "hack" youtube  to tease out the path the the flv and play that in a native flex video player interface. This solution works well and lets you have multiple videos playing inside your flex application at once, but unfortunatly youtube doesn't like this idea at all.

ActionScript 3 Photobucket API Basics

So by popular demand, and just because it's fresh on my mind, I've revisited the Photobucket photoflow example. This version of the app goes a step further and uses the full blown ActionScript 3 Photobucket API. This API is actually relatively new and I was actually working on a similar interface to their API when they released theirs.

Stylesheets and mx_internal

To make a long answer short... they don't work well together. basically if you want to set a style property on a CSSStyleDeclaration and you have mx_internal declared in your class (i.e. you are overriding a flex sdk component such as a button or list) then you will get weird ambiguous reference warnings like the following: Id 1000: Ambiguous reference to setStyle The solution is simple, instead of declaring use namespace mx_internal you just have to scope each of the variables or functions you want access to. i.e. mx_internal::adobe_hidden_variable.

Flex - Adding icons to a ToggleButtonBar

This was one annoying problem, I wanted a single icon on each button on my toggle button bar but for the life of me I couldn't figure out what was going on. I had set the icon property in my buttonStyle in my applications stylesheet, but my icon was nowhere to be found.

Finally after pullling my hair out for a while, a trip to flexexample found me what I was looking for. The ToggleButtonBar (and any navigation component) uses the data provider supplied to it to pull out the icon resources for each button, so the dataprovider was overriding my stylesheet with null.

9-slice scaling

Here is a pretty good write up on using 9-slice scaling in Flex to make sure your resources scale properly when you are skinning controls, it's pretty easy concept, just hard to find in the flex documentation.

Flex skinning example

Transparent List in Flex

So I wanted a list that had no layout information, or a List where you could only see the items in the list, no selection colours, no borders, no background, etc... I spent a lot of time racking my brain trying to figure out the best way to do this. Finally out of desperation I looked at the api and a few related blog posts and the answer was simple. Flex provides support for this in the base list class, so just extend the List class and tell it to not draw anything. How simple is that!

Here is the code to do it: