June 11th, 2010 by Slav
This example is taken straight from Flex 4 Cookbook. It demonstrates how you can search inside of data grid.
Works fine, that not the problem.
The problem is , once you select any cell in data grid an return the the textfield.. you are unable to type anything! Tried different flex 4 sdks tried testing in IE, FF, Chrome .. no luck.
I had it happening in a different project, where I am working with much more complex data grid with custom item renderers and editors, so I chose Flex 4 cookbook example to test if it’s happening in a very simple scenario as well. Also that book was written by Flex experts, so I wanted to confirm it’s not me using the Flex in the wrong way..
EDIT: It seems it’s not happening on all computers? On my colleague’s machine this works fine it seems.Does anybody have the same problem as me ?
EDIT2: Solution found!This weird behaviour was down to the flash plugin/active X..
it wasn’t working correctly in version 10,1,50,426 .. but when I upgraded to 10,1,53,64 all works as expected! Must have been some glitch in the plugin.
anyway, I’ll leave this post here, in case somebody will have similar problem.
Posted in AS3, Flex, Flex 4, Personal, flash | 3 Comments »
June 3rd, 2010 by Slav
While building a multilingual copy editor module for Flex 4 CMS system, I’ve encountered a following problem:
I have a editable datagrid with variable heights.The problem is, default itemEditor for a datagrid is an input textfield which is a single line , but I need a multiline editor such as text area.
Solution is simple of course, you just assign a editor=”mx.controls.TextArea” in the datagrid ’s column definition.
That might work , if you are creating a columns in mxml.
I however create columns dynamically..It turns out you can’t assign TextArea to a columns editor directly:
dataGridCol.itemEditor = "mx.controls.TextArea"
will not work as the itemEditor must implement IFactory , which TextArea (or other similar components) do not!
So what can you do in this case ? Well, you could build a custom class component that does implement IFactory and give’s you a newInstance method that returns the component you need..
or..
there’s much simpler solution.You put your component definition in the fx:declarations block like this :
<fx:Declarations>
<fx:Component id="inlineEditor">
<mx:TextArea />
</fx:Component>
</fx:Declarations>
and then in your code define itemEditor refering to the id attribute of fx:Component :
datagridCol.itemEditor = inlineEditor;
Simple, isn’t it.
Posted in AS3, Flex, Flex 4, flash | 6 Comments »
July 13th, 2009 by Slav
Augmented reality is slowly becoming perhaps somewhat of a bevel effect/lensflare among the technology enthusiasts, but actually it’s only beginning to creep into consciousness of the “marketing people” (as I call them) so I though it’s high time I joined the ranks and pop my AR cherry. : - )
This demo is based on excellent ar tutorial by Lee Brimelow, you should definitely check it out if you want to play with AR.
One thing I discovered, the marker pickup up by FLARE toolkit can be quite tricky at times and it really helps if you do apply a threshold filter to an input bitmap data.
I added basic flying controls to helicopter and a helipad plane to ground it on the surface..

Demo was build with Adobe Flash Builder demo, but the most important class extends UIComponent, so should be easily transferable to Flex 3.
You can view the demo here and right click to view the source.
If you don’t have a web cam watch screencast here.
Posted in AS3, Augmented Reality, Flex 4, papervision | 9 Comments »
July 7th, 2009 by Slav
It all started when I decided to try out the new Flex 4 Beta. The aim was to build Collada viewer that loads the dae files from the users’ filesystem / harddrive using new flash 10 FileRef API. What seemed like a pretty straightforward task turned into a Nightmare Lite after I realised I can’t just grab a new BasicView and dump it into a new sparks group container! The problem was, the group container didn’t support rawChildren.addChild(), as it didn’t contain rawChildren property.
After spending couple of hours trying and failing I came upon a working solution :

Use UIComponent as a wrapper for a BaseView which is implemented via composition. UIComponent is compatible with Sparks containers and can be added via addElement(); Thankfully UIComponents allows adding BaseView via addChild.. If you need to access a camera, scene, light etc, just use public variables on your UIComponent class to expose them and link them to your baseview camera lights etc.
This simple example utilises camera and materials light color change, but you can expose and change anything you like of course..
It is implemented directly inside of mxml but of course you could still have a group with id (let’s say “scene”) and add the whole component BasicView3D programmatically.
e.g. :
scene.addElement(new BasicView3D);
Check out the sample and right click to view source script and download the entire project.
Posted in AS3, Flex 4, papervision | 8 Comments »