Re: [flashmn] [flashcoders] Flash 8 - Custom databinding

2006-09-19 Thread Scott Hyndman

It isn't in the alpha release. If you grab from SVN you can see the
code in the org.actionstep.test.ASTestBinding class. The source root
can be found in the /test subdirectory.

Scott

On 19/09/06, slangeberg <[EMAIL PROTECTED]> wrote:

Scott,

Is there an example of where the databinding is used in ActionStep?

I have downloaded the sourcecode from the site.

Thanks,

Scott

On 9/19/06, Scott Hyndman <[EMAIL PROTECTED]> wrote:
>
> I wrote a databinding system for ActionStep that "wraps" setters with
> proxy functions that notify observers whenever a change is detected.
> All you have to do, you replace the setter method with your own that
> dispatches the change event, then call the original. This system is
> also reliant upon the use of the setters internally set things,
> otherwise it will not detect all changes. It's modelled after Cocoa's
> key-value observation framework, which is in my opinion the defacto
> standard for binding. It's a great system, and not nearly as
> complicated as MM's or other similar systems.
>
> Scott (Hyndman)
> ___
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>



--

: : ) Scott
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [flashmn] [flashcoders] Flash 8 - Custom databinding

2006-09-19 Thread slangeberg

Scott,

Is there an example of where the databinding is used in ActionStep?

I have downloaded the sourcecode from the site.

Thanks,

Scott

On 9/19/06, Scott Hyndman <[EMAIL PROTECTED]> wrote:


I wrote a databinding system for ActionStep that "wraps" setters with
proxy functions that notify observers whenever a change is detected.
All you have to do, you replace the setter method with your own that
dispatches the change event, then call the original. This system is
also reliant upon the use of the setters internally set things,
otherwise it will not detect all changes. It's modelled after Cocoa's
key-value observation framework, which is in my opinion the defacto
standard for binding. It's a great system, and not nearly as
complicated as MM's or other similar systems.

Scott (Hyndman)
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--

: : ) Scott
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [flashmn] [flashcoders] Flash 8 - Custom databinding

2006-09-19 Thread Scott Hyndman

I wrote a databinding system for ActionStep that "wraps" setters with
proxy functions that notify observers whenever a change is detected.
All you have to do, you replace the setter method with your own that
dispatches the change event, then call the original. This system is
also reliant upon the use of the setters internally set things,
otherwise it will not detect all changes. It's modelled after Cocoa's
key-value observation framework, which is in my opinion the defacto
standard for binding. It's a great system, and not nearly as
complicated as MM's or other similar systems.

Scott (Hyndman)
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [flashmn] [flashcoders] Flash 8 - Custom databinding

2006-09-19 Thread slangeberg

Wow,

I looked at Adobe's generated code for some simple databindings and it's
truly as gnarly as I'd feared!

Danny,

You'd said:


You should broadcast specific events for each property changedThis can

all be done "manually" without much effort.

This much I'd basically done on my own, but then you said:


and many of us AS Developers have been doing this for years.


Does anyone know of any clean systems for doing this? I have my ideas, but
if someone out there has some kind of framework in place to automate this,
i'd love to see it!

Scott

On 9/14/06, Danny Patterson <[EMAIL PROTECTED]> wrote:


   This is done in with the *-keep-generated-actionscript* compiler flag.
You can enable it on by following these steps:

   1. Right-click on your Flex Project
   2. Select Properties
   3. Select Flex Compiler
   4. Enter *-keep-generated-actionscript* into the 'Additional
   compiler arguments' field.
   5. Click 'OK' to apply the changes.

Now when you look in your bin directory you should see a new folder named
*generated*.  This has all the ActionScript files generated by your MXML
code.  Remember MXML is first compiled into ActionScript and then the SWF is
compiled.  MXML is not a not language really, its just a simplified way of
writing ActionScript.  FooBar.mxml is the same as FooBar.as.

DP


 --
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *slangeberg
*Sent:* Thursday, September 14, 2006 4:44 PM

*To:* [EMAIL PROTECTED]
*Subject:* Re: [flashmn] Flash 8 - Custom databinding

 I shall, I shall!

What are you using and/or how are you looking at the generated code?
Are you talking about decompiling the .swf?

-Scott


On 9/14/06, Danny Patterson <[EMAIL PROTECTED]> wrote:
>
>Well, Flex2 binding is doing the same thing.  Look at the generated
> code, it just uses the event system to handle notifications.
>
> DP
>
>
>  --
>  *From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *slangeberg
> *Sent:* Thursday, September 14, 2006 3:23 PM
> *To:* [EMAIL PROTECTED]
> *Subject:* Re: [flashmn] Flash 8 - Custom databinding
>
>   Thanks Danny,
>
> You've just confirmed my innermost suspicions!
>
> There probably would be a way to roll your own binding mechanism, to
> make it a bit more elegant.
>
> I'm sort of spoiled after being exposed to the Flex 2 binding!
>
> Scott
>
> On 9/14/06, Danny Patterson <[EMAIL PROTECTED]> wrote:
> >
> >You should broadcast specific events for each property changed.  If
> > you only need to know when the entire object changes, you can have one event
> > but it should be broadcast inside each setter function.  Don't use MM's
> > databinding component, its crap.  This can all be done "manually" without
> > much effort.  Steve is right, this is core to the "M" portion of MVC and
> > many of us AS Developers have been doing this for years.
> >
> > If you're having specific problems with your code, just post the code
> > and we can help you through it.
> >
> > DP
> >
> >
> >  --
> > *From:* [EMAIL PROTECTED] [mailto:flashmn@ yahoogroups.com] *On
> > Behalf Of *slangeberg
> > *Sent:* Wednesday, September 13, 2006 1:04 PM
> > *To:* Flashcoders mailing list; [EMAIL PROTECTED];
> > flexcoders@yahoogroups.com
> > *Subject:* [flashmn] Flash 8 - Custom databinding
> >
> >   I'm adapting Cairgorm 0.99 for Flash 8. I want to set up databinding
> > on my ModelLocator, to update a view, and I'm wondering if anyone has done
> > anything like this before?
> >
> > Currently, my model is emitting a 'change' event when properties are
> > changed through getter / setters. I'm guessing I could set this up using
> > MM's DataBinding component, to listen for the change, however, I'm wondering
> > if there's a better way, that only gets triggered when the specific variable
> > I want changes?
> >
> >
> > : : ) Scott
> >
> >
>
>
> --
>
> : : ) Scott
>
>


--

: : ) Scott

 __._,_.___  Messages in this topic
(
15)  Reply (via web post)
|
 Start
a new topic

 
Messages|
Files