Posts filed under 'FlexTips'
If you're new here, you may want to subscribe to my RSS feed. If you like my site, consider linking back. I prefer text "Free Flash Tutorials" to http://blog.franto.com
Thanks for visiting my site! If you need anything just contacting through Contact page or Gtalk widget
I’m curious if anyone need handle both events on same component in same time. Just imagine situation: You got circle. On MouseEvent.CLICK you want to decrease radius by 10px, on MouseEvent.DOUBLE_CLICK increase radius by 10px. It is obvious that when you double click on circle, you dont want to fired both: decrease and increase radius.
Sure, there can be some “workarounds” with timer or “somehow” canceling CLICK event on DOUBLE_CLICK, but I hope there is “normal solution” from Adobe. Can anyone point me to that “normal solution”
P.S. Do not forget to set doubleClickEnabled=”true” to be able to listen to MouseEvent.DOUBLE_CLICK
Adobe, Flash, Flex, FlexTips
May 29th, 2008
Add to your FavLinks
Here is quick Flex Tip. If you don’t want to display focus rectangle on pressing TAB key, you should use focusEnabled = false;
It’s quick solution for 1 component, but if you want disable focus for all components in your application just use focusManager.deactivate();
That’s all, hope it helps to anyone…
AIR, AirTips, Flash, Flex, FlexTips
May 29th, 2008
Add to your FavLinks
It seems that my site got some problem with traffic and is so slow (at least for me), so I want to do anything with that. Change webhost provider, or change it to dedicated server and then provide Flex, AIR, Flash tutorials for anyone who want to learn new Adobe technology. Because this costs money, I’ve create Franto.com Supporters page, when I will list all supportes for my site (PR7). So if you wish support it and let me try to do anything to speed up this site and provide good free tutorials for anyone you can just support this site.
Thanks in advance.
AIR, AirTips, Flash, Flex, FlexTips, Free Tutorials, Macromedia Tips, Paypal, tutorials, Useful links
April 29th, 2008
Add to your FavLinks
This is new post in my DataGrid Series Flex Tutorials. This tutorial shows you how to filter rows for searched keyword. It's quite easy, since dataProvider for DataGrid is ArrayCollection, and ArrayCollection has variable filterFunction. It simple expect function which will filter correct rows for you. So basically, you have Datagrid and dataProvider is defined like this
Actionscript:
-
[Bindable] public var dpRows:ArrayCollection;
then you can create filter function in this simple way:
Actionscript:
-
public function filterResults():void
-
{
-
dpRows.filterFunction = _sortRows;
-
dpRows.refresh();
-
}
and finally function, which filters results. It returns true for row, which will be visible, and false for row which will be hiden.
Actionscript:
-
private function _sortRows(item:Object):Boolean
-
{
-
var col:String = cmbCol.selectedItem.data as String;
-
var key:String = keyword.text;
-
-
key = key.toLowerCase();
-
-
if (key != "")
-
{
-
if (col != "any")
-
{
-
var value:String = item[col];
-
value = value.toLowerCase();
-
-
if (value.indexOf(key)>= 0)
-
{
-
return true;
-
}
-
} else {
-
for (var o:String in item)
-
{
-
value = item[o];
-
value = value.toLowerCase();
-
if (value.indexOf(key)>= 0)
-
{
-
return true;
-
}
-
}
-
}
-
} else {
-
return true;
-
}
-
-
return false;
-
}
It's quite simple tutorial. Here you can see source code for example which follows.

In next tutorial for DataGrid I will show you how you can add Button into cell. We will use custom itemRenderer for DataGridColumn.
If you have any questions, or suggestions for tutorial, please let me know...
Enjoy.
AIR, AirTips, Flash, Flex, FlexTips, Macromedia Tips, Tutorial, tutorials
April 29th, 2008
Add to your FavLinks

FlexSpy - Kind of what Firebug does for HTML/Ajax applications but for Flex 2.0/3.0 applications.
This is another quick help in Flex/AIR development. If you need component inspector in your application, FlexSpy is great library for you. All you need to do, is add lib into your project (Flex 2 or Flex 3 version) and call
FlexSpy.show(); That's all and you can inspect your classes right in Flash player. You can also change values and change will be reflected in your app. You can also Find Component for inspecting with dragging cursor over component. So download FlexSpy from Google Code and try it. It will help you in your Flex/AIR development.
Live example: http://www.mieuxcoder.com/data/2007/12/FlexSpy-1.2/dashboard.html
AirTips, Flash, Flex, FlexTips, Library, Useful links
April 18th, 2008
Add to your FavLinks
This is just quick but big help, if you're developing Flex in FlexBuilder. (or Eclipse). Maybe most of you know Quick Outline feature (Ctrl + O shortcut, I'm using Windows, so really do not know other shortcuts for other OS), but I didn't use it before. But after 360Flex conference in Milan I'm using it frequently and it's really big help. For everyone who doesn't know what's Quick Outline, it's exactly like Outline View, but interactive. Just press Ctrl + O and start typing name of function you're looking for. For example you want to find function commitProperties()... just start typing comm and after few strokes, your function is filtered and press Enter. It's really fast way to find your functions
If you know about another great shortcuts for speeding up your development let us know.
AirTips, Flash, Flex, FlexTips, Tips
April 17th, 2008
Add to your FavLinks
Table of contents for AsDoc
- AsDoc with Flex Library Project
This is question, not solution. But I hope that at the end, there will be solution posted here. I'm playing with AsDoc tool for my project and I'm stuck this thing.
I have project which uses Flex library project. It uses custom MXML component, let's say . Everything works, but when I want generate AsDoc for my project, it can't find
Here is AsDoc call
"c:\Program Files\Adobe\Flex Builder 3\sdks\3.0.0\bin\asdoc.exe" -source-path=. -doc-sources com -main-title "My API Documentation" -window-title "MyAPI Documentation"
There can be 2 options I think:
- Add Flex Library Project to Asdoc call
- Exclude Flex Library Project to Asdoc call
I have try few options, but I have to confess, I can't make it work. Does anyone had similar problem, and got solution?
Please post it in comment, and I will add it here for other people, which have similar problem with generating AsDoc help.
Thank you
AsDoc, Flash, Flex, FlexTips
March 12th, 2008
Add to your FavLinks
This is answer of my question asked at the end of tutorial Custom header in DataGrid. Question was if it is possible to set as many custom properties to custom header renderer as you want, and how can it be done. So here are answer...
First of all I want to thank Tink for pointing me to the right direction with extending DataGridColumn. Afterward I've found tutorial Thinking About Item Renderers and there were my answer...
So, you have to extend DataGridColumn to MyDataGridColumn to add there our custom properties for header. In our case there are new properties text and topText.
Actionscript:
-
package controls
-
{
-
import mx.controls.dataGridClasses.DataGridColumn;
-
-
public class MyDataGridColumn extends DataGridColumn
-
{
-
private var _text:String;
-
private var _topText:String;
-
-
public function get text():String
-
{
-
return _text;
-
}
-
public function set text( value:String ):void
-
{
-
_text = value;
-
}
-
public function get topText():String
-
{
-
return _topText;
-
}
-
public function set topText( value:String ):void
-
{
-
_topText = value;
-
}
-
}
-
}
Pretty simple, and now you can change your commitProperties function in MyDataGrid class where you're creating DataGrid columns. Just set your new properties there
Actionscript:
-
var colName:MyDataGridColumn = new MyDataGridColumn();
-
colName.headerRenderer = new ClassFactory(MyDataGridHeader);
-
colName.text = "Name";
-
colName.topText = "Web";
-
colName.dataField = "name";
-
-
var colLink:MyDataGridColumn = new MyDataGridColumn();
-
colLink.headerRenderer = new ClassFactory(MyDataGridHeader);
-
colLink.text = "Link";
-
colLink.topText = "URL";
-
colLink.dataField = "url";
all other parts of MyDataGrid class are same from previous example (look to the source code on right click or download them).
And we're done. Simple when you know how to do it
And here you can try this example (Source code is available on right click):

If you want another Flex or AIR tutorial, please ask in comments here
AIR, Flash, Flex, FlexTips, Tutorial
November 19th, 2007
Add to your FavLinks
Previous Posts