<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jozef Chúťka&#039;s blog &#187; PROPERTY_CHANGE</title>
	<atom:link href="http://blog.yoz.sk/tag/property_change/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.yoz.sk</link>
	<description>My life, my work</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:40:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quick tip: invalidating properties on bindables changed</title>
		<link>http://blog.yoz.sk/2009/10/quick-tip-invalidating-properties-on-bindables-changed/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=quick-tip-invalidating-properties-on-bindables-changed</link>
		<comments>http://blog.yoz.sk/2009/10/quick-tip-invalidating-properties-on-bindables-changed/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 15:25:27 +0000</pubDate>
		<dc:creator>Jozef Chúťka</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Flash / Flex]]></category>
		<category><![CDATA[Bindable]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[commitProperties]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[invalidateProperties]]></category>
		<category><![CDATA[PropertyChangeEvent]]></category>
		<category><![CDATA[PROPERTY_CHANGE]]></category>

		<guid isPermaLink="false">http://blog.yoz.sk/?p=512</guid>
		<description><![CDATA[By default, flex bindable properties fires event PropertyChangeEvent.PROPERTY_CHANGE. Sure, those events can be listened thus you can play with them. This can be useful when you have a lot of bindable properties in your classes and you do not want to make getter and setter for each just to be able to catch the moment [...]]]></description>
			<content:encoded><![CDATA[<p>By default, flex <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=databinding_8.html">bindable</a> properties fires event PropertyChangeEvent.PROPERTY_CHANGE. Sure, those events can be listened thus you can play with them. This can be useful when you have a lot of bindable properties in your classes and you do not want to make getter and setter for each just to be able to catch the moment of update:</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mx:Application xmlns:mx=&quot;http://www.adobe.com/2006/mxml&quot; layout=&quot;horizontal&quot;
    creationComplete=&quot;creationCompleteHandler()&quot;&gt;
&lt;mx:Script&gt;
&lt;![CDATA[
    import mx.events.PropertyChangeEvent;

    [Bindable] private var bVar:uint = 0;
    [Bindable] private var btnLabel:String = &quot;&quot;;

    private function creationCompleteHandler():void
    {
        addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, propertyChangedHandler);
    }

    private function propertyChangedHandler(event:PropertyChangeEvent):void
    {
        if(event.property == &quot;bVar&quot;)
            invalidateProperties();
    }

    override protected function commitProperties():void
    {
        super.commitProperties();
        btnLabel = bVar.toString();
    }
]]&gt;
&lt;/mx:Script&gt;
&lt;mx:Button click=&quot;bVar++&quot; label=&quot;{btnLabel}&quot;/&gt;
&lt;/mx:Application&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.yoz.sk/2009/10/quick-tip-invalidating-properties-on-bindables-changed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

