This issue came to me from a customer who wanted to catch the timeout of a webservice and then repeatedly re-dispatch the same webservice passing the parameters/data from the original call, but with a larger timeout, until some max timeout or max number of tries was reached.
Read the rest of this post»
No Comments »
If in the dataGrid control you set showHeader = false and if the dataProvider has no items in it, then the vertical column lines don’t show up.
The vertical column separator lines only appear when the dataProvider has items populating the grid (or if there is no data and showHeader=true).
In the Datagrid code, drawing the vertical column separator lines is keyed off of the listData, which would have a “row 0†containing the header row if the headers where to be visible.
The solution to this is to extend the datagrid and override the drawLinesAndColumnBackgrounds method in which you can iterate over the column array rather than the listItems to draw the vertical lines.
Read the rest of this post»
No Comments »
You technically cannot do this, since callLater() actually takes a function as an argument and a setter is an accessor.
However, rules where meant to be broken (or at least worked around).
You can do it by creating a function inline which sets the property within your callLater invocation.
Here is a simple class with a method and a setter:
package
{
import mx.controls.Alert;
public class MyClass
{
public function set stuff(value:String):void{
Alert.show("setter for stuff: " + value);
}
public function junk(value:String):void{
Alert.show("function junk: " + value);
}
}
}
Here is a simple app demonstrating the workaround:
<?
xml version=
"1.0" encoding=
"utf-8"?>
<mx:Application xmlns:mx=
"http://www.adobe.com/2006/mxml" creationComplete=
"init()">
<mx:Script>
<!
[CDATA
[
public var foo:MyClass;
public function init
():
void{
foo=
new MyClass
();
}
]]>
</mx:Script>
<!–
The following will not compile with this error:
Error 1119: Access of possibly undefined property stuff through a reference with static type MyClass.
<mx:Button label="call setter within callLater"
click="callLater(foo.stuff,['bunch of stuff'])"/>
–>
<mx:Button label="call function within callLater"
click="callLater(foo.junk,['bunch of junk'])"/>
<mx:Button label="call setter within callLater"
click="callLater(function():void{foo.stuff=’bunch of stuff’})"/>
</mx:Application>
A complete Flex Builder 2.0.1 Project Archive (.zip) of this sample can be found here.
No Comments »
Recent Comments