czwartek, 22 lipca 2010

Flash/Flex debugger and FireFox Flash plugin crash

Someone at Mozilla had this 'great' idea to introduce Flash plugin timeout settings. I'm not really sure what it was supposed to do but it does one thing for sure - crashes my Flash plugin whenever I spend more than 45 second on debugging a single breakpoint in Flex.

Although guys at Mozilla might not think twice about what they are going to implement next they've got a pretty good support.

Here's the solution to this problem: http://support.mozilla.com/pl/kb/The+Adobe+Flash+plugin+has+crashed

środa, 14 lipca 2010

Pass reference to "this" to child object generated by Repeater.

Let's assume that we've got a component named Item. This component has a public property named controller.

The idea is that we want to pass reference to this (usually a parent object of Repeater) to Repeater children.

You could use basic logic and try to do something like this:
<mx:Repeater dataProvider="{dP}">
    <layouts:Item controller="{this}" />
</mx:Repeater>
But unfortunately Flex is not a place where you should use logical solutions. In shown example scope of this is fubar. Thus the necessary workaround which is displayed below. Please note that XXX should be the name of the Class which is represented by this pointer.
[Bindable] private var _this:XXX; 
private function init():void
{
_this = this; 
}
<mx:Repeater dataProvider="{dP}">
    <layouts:Item controller="{_this}" />
</mx:Repeater>