Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-25-2013, 08:20 AM   PM User | #1
shaunthomson
New Coder

 
Join Date: May 2012
Posts: 89
Thanks: 51
Thanked 0 Times in 0 Posts
shaunthomson is an unknown quantity at this point
MVC - basic couple of questions

Gidday

Newbie MVC questions if you are able to help out...

Just wondering - say your model is storing user settings that relate to component settings - a whole bunch of checkBoxes in different views - and the model initially gets populated by an external xml file.

1. Should each and every user setting in the model have it's own dispatchEvent, with each checkBox listening for a change to it's specific event? Or is the idea that the model fires off one 'Update' event, and each checkBox (listening for this update event) then 'gets' it's relevant on/off setting from the model? So if it's the latter, and you have 100 checkboxes in your project, all 100 would be updated, even though only one was clicked?

2. I get how the MVC works when, say, clicking a button to change something

- view's button handler updates controller
- controller updates model
- model dispatches update event
- view, listening for event, makes the visual change

...but how does it work for something like a checkBox, where the visual change has already taken place? Say you want the checkBox selection to be stored by the model, how do you then tell the model "don't update the view - it's already updated" thus avoiding and endless loop?

3. Is this a good example of MVC for me to study? Would you regard it a loosely coupled? http://www.ndid.se/2010/12/as3-mvc-e...80%93-revised/

Thank for your help.

Last edited by shaunthomson; 02-25-2013 at 08:23 AM..
shaunthomson is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:43 PM.


Advertisement
Log in to turn off these ads.