Hillel Coren made a nice auto complete text input in flex.
Tags: autocomplete, Flex
Tags: asynctoken, Flex, php, remoteobject, responder
There are a few ways to handle responses after calling a method on one of your Flex RemoteObjects. You can define catch all result handlers in the MXML tag for your RemoteObject. You can also declare the methods you are going to call inside the MXML tag and set result handlers for each method.
The method I have found to work for me is to save the AsyncToken from a RemoteObject call and then add a responder to the token. I can do this in one line, saving me time in writing code. For example, suppose I am calling the getUsers method on my remote PHP UserManager class. I would write something like this.
addResponder(new mx.rpc.Responder(getUsers_result, fault));
I use the full path to mx.rpc.Responder since the Flex 3 compiler gives me warnings when I import mx.rpc.Responder and then use the short hand in MXML files.
How do you write your RemoteObject calls?
Categories: Flash, FlashDen
I do Flash work as well so when I created an MP3 player for a client’s website, I took the resulting player, improved it, and released it on flashden.net. Here’s a link to it: http://flashden.net/item/dynamic-skinnable-xml-mp3-player/49068
Tags: Flex, tabnavigator
I had to color individual tabs in a Flex TabNavigator component. I found the solution online so I will repost it here in my own words for the benefit of myself and others.
First, you have to wait for the TabNavigator’s creationComplete event if you defined your TabNavigator’s children at compile time. In your creationComplete event listener, you can use the getTabAt method of the TabNavigator to retrieve tabs by their index. With the case of a TabNavigator, getTabAt returns Buttons. So to style the first tab, you would create a style called FirstTab in your CSS file, and then write the following code:
tabNavigator.getTabAt(0).styleName = “FirstTab”;
If you create your tabs at runtime, the tabs will not be immediately available after you add children to the TabNavigator. I found that listening for the updateComplete event for the TabNavigator and then executing getTabAt was successful.
Tags: cache, firefox, Flex
Private browsing is useful for Flex development because it does not keep a cache. That way, you never have to worry about whether or not you are viewing a cached version of your swf.
Tags: Flex, servicecapture, upload
I created a Flex form that uploads a file to a PHP script. I kept getting a File I/O error in the Flash Player, even though I knew the URL path to the PHP script was correct. I then closed ServiceCapture so that I could run my example in Internet Explorer, and suddenly the upload worked! I opened Firefox, switched off the ServiceCapture proxy, and finally the upload worked in Firefox too.
It seems that the ServiceCapture proxy and the Flash Player file upload do not work well together.