[Update] After some comment by Jens (Parsley dev) i updated the workflow. See striked comment below [/Update]
This is a _very_ basic example of the new Parsley framework version (2.0).
Although useless and ugly :), it uses a few of Parsley new features such as injection via metadata and the messaging capabilities (read event system).
If you haven't given it a try... you should!
Right-click for source (or see it here)
You are missing some Flash content that should appear here! Perhaps your browser cannot display it, or maybe it did not initialize correctly.
A few explanations:
- on the structure:
Obviously there are easiest ways of getting the same result, the goal here is to demonstrates the use of a basic MVC structure using Parsley.
I didn't use a Mediator/PresentationModel as it wouldn't add anything new to show.
- on the workflow:
Beans.mxml is the context file which defines the main elements.
It is loaded by the base Application (Parsley2Flex.mxml), which dispatches a custom ON_APPLICATION_COMPLETE event.
With the use of some metadata (see Parsley2Flex.mxml), this event is managed by the Parsley message system, and handled by the controller (see Controller.as).
The controller uses Parsley MetaData [PostConstruct] to react when context is ready.
It then calls methods on the Model (injected by Parsley, see Model.as) and the view uses bindings to react to the model changes (see Main.mxml)
oh! and it logs to SOS console using S.Rohde extension, which makes the whole thing very easy.
Here you can find more or less the same example built on flash (ie. not flex). I really like the fact that Parsley is not flex only, so depending on your requirement you can choose which way to go...
Comments
Line 35 of Parsley2Flex.mxml should read:
// INITIALIZE PARSLEY
FlexContextBuilder.build(Beans,this);
This is a very nice example to demonstrate the flow of parsley's application framework. This example works with parsley 2.0 swc but not with the latest version of parsley.
true.. i need to update those examples
thanks. i think it IS view source enabled. Anyway, i added a link too.
Nice work dude,
but you forgot the view source.
Regards
Post new comment