CO Binding Util

Like Chemical CoValent Bonding, Bind two Objects of Flex through this
AS3 Utility… ;) 

package
{
import flash.events.Event;
import mx.binding.utils.ChangeWatcher;
public class CovalentBindig
{
public static function Bond(obj1:Object, prop1:String, obj2:Object, prop2:String):void
{
var flag:Boolean = false;
ChangeWatcher.watch(obj1, prop1, function(event:Event):void
{
if(!flag)
{
flag = true;
obj2[prop2] = obj1[prop1];
flag = false;
}
});

ChangeWatcher.watch(obj2, prop2, function(event:Event):void
{
if(!flag)
{
flag = true;
obj1[prop1] = obj2[prop2];
flag = false;
}
});
}
}
}

  1. Great site. Thanks…🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: