Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Ross Sclafani
My takes:

I generally have a dataTypes folder at the same level as the MVC folder for 
'transfer objects'
I'd probably have an events folder at the same level in your case, but I can't 
see much of an argument for custom events in a properly architected MVC 
application. Since every write to the model throws a CHANGE event, the Entire 
app is evented in nature. What is an example of a custom event you'd like to 
support in your MVC app? I want to test my theory.

As for Files, that screams controller to me.

In an app that does file system manipulation via the OS, I'd likely have a 
fileSystemController class in my controller tree. The built-in browse for files 
UI is not likely something I'd concern my view tree with, I'd probably just 
treat it the same way I treat a web service: the controller talks to it and 
passes any result my app needs to access into the model.
If I was making my own views to the file system, thats when I would involve the 
view tree.


Ross P. Sclafani
Owner / Creative Director
Neuromantic Industries
http://www.neuromantic.com

347.204.5714
http://ross.sclafani.net
http://www.twitter.com/rosssclafani

On Feb 27, 2012, at 4:19 PM, "Mattheis, Erik (MIN-WSW)" 
 wrote:

> I've been putting all my class files in one of three folders, model, view, 
> controller. I'm mostly concerned with making the code as easy to understand 
> as possible.
> entire 
> Where would you expect transfer object class - a class that just defines a 
> set of values to pass as a group?
> 
> Where would you expect a custom event class?
> 
> Where would you put a class that reads from and writes to the file system? 
> Air.File has methods that produce UI elements. What are benefits/drawbacks to 
> writing the extra code to get File.browseForOpen() somewhere in the View?
> 
> What about a class that holds string values to display ion dialog boxes, on 
> buttons, etc? Is that part of the view or should it be defined in the model?
> 
> 
> 
> _ _ _
> Erik Mattheis | Weber Shandwick
> P: (952) 346.6610
> M: (612) 377.2272
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Paul Andrews
I don't think that it makes sense to categorise every class in terms of 
the MVC trinity.


Classes that implement the MVC pattern, sure, but not everything else.

There's no need to put a sound processing class within the view class 
hierachy, even if the view uses it to play audio from the model. It 
would make it harder to see the actual classes involved in implementing 
views. A given class could be used inside a view and also in a controller.



On 27/02/2012 21:19, Mattheis, Erik (MIN-WSW) wrote:

I've been putting all my class files in one of three folders, model, view, 
controller. I'm mostly concerned with making the code as easy to understand as 
possible.

Where would you expect transfer object class - a class that just defines a set 
of values to pass as a group?

Where would you expect a custom event class?

Where would you put a class that reads from and writes to the file system? 
Air.File has methods that produce UI elements. What are benefits/drawbacks to 
writing the extra code to get File.browseForOpen() somewhere in the View?

What about a class that holds string values to display ion dialog boxes, on 
buttons, etc? Is that part of the view or should it be defined in the model?



_ _ _
Erik Mattheis | Weber Shandwick
P: (952) 346.6610
M: (612) 377.2272
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Mattheis, Erik (MIN-WSW)
I've been putting all my class files in one of three folders, model, view, 
controller. I'm mostly concerned with making the code as easy to understand as 
possible.

Where would you expect transfer object class - a class that just defines a set 
of values to pass as a group?

Where would you expect a custom event class?

Where would you put a class that reads from and writes to the file system? 
Air.File has methods that produce UI elements. What are benefits/drawbacks to 
writing the extra code to get File.browseForOpen() somewhere in the View?

What about a class that holds string values to display ion dialog boxes, on 
buttons, etc? Is that part of the view or should it be defined in the model?



_ _ _
Erik Mattheis | Weber Shandwick
P: (952) 346.6610
M: (612) 377.2272
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Kevin Newman
Well, not every object has to be a Model, a View, or a Controller. You 
can have your controller and view work with an instance of an adapter. 
You wouldn't want an adapter hanging out in the ether - but but your MVC 
objects could certainly have a "uses a" relationship to an adapter object.


For example, you could have the controller create an adapter, wire it to 
the model, and set it to the dataSource of a view. This is clean because 
the view only needs to know how to get data from the adapter, it doesn't 
need to know anything about how the data lives in the model.


Kevin N.


On 2/26/12 8:45 PM, Karl DeSaulniers wrote:
So is the basic construct to choose between a controller or multiple 
adaptors?

It seems (to me) that a combination of the two is overkill.
If you cant fit everything your trying to do within a MVC or MVA style 
pattern, your coding it wrong.
Not setting flame, just inquiring. :) 


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Ross Sclafani
In my world, an adapter is code I write to shoehorn code I didn't write into my 
framework. Code sealed in a third party SWF loaded by one of my views is a 
common candidate for an adapter.
>From a completely green field, I can't imagine needing to adapt any code I 
>write to other code I've written.

The name adapter implies two things that do not natively fit together.

Ross P. Sclafani
Owner / Creative Director
Neuromantic Industries
http://www.neuromantic.com
http://ross.sclafani.net
http://www.twitter.com/rosssclafani
347.204.5714

On Feb 27, 2012, at 8:35 AM, John McCormack  wrote:

> It was a good example of MVC Ross, I think Henrik was saying it should have 
> been designed using MVC.
> 
> I did see a nice example on a Microsoft poster using a clock with: analog and 
> digital views; data in the model and the controller enabling the views etc.
> 
> I am wondering what an adapter might get up to.
> 
> John
> 
> On 27/02/2012 13:17, Ross Sclafani wrote:
>> I'm not implying that the code even adheres to my personal MVC file 
>> structure, but its functional operation is a good example to illustrate my 
>> MVC paradigm.
>> 
>> 
>> 
>> Ross P. Sclafani
>> Owner / Creative Director
>> Neuromantic Industries
>> http://www.neuromantic.com
>> http://ross.sclafani.net
>> http://www.twitter.com/rosssclafani
>> 347.204.5714
>> 
>> On Feb 27, 2012, at 6:39 AM, Henrik Andersson  wrote:
>> 
>>> Ross Sclafani skriver:
 An MVC Example
 
 FLVPlayback is an interesting MVC  component:
 
 it holds a NetStream as a model of the video
 
 it holds a Video as a view of the Video
 
 It acts as controller to set the model in motion by connecting it to a 
 stream
 
 the ui is also a view of the video: the percent elapsed is represented n 
 the scrub bar, ther is a play button while paused, a pause button while 
 playing, then there are the time readouts..
 
>>> Sadly, that is not true.
>>> 
>>> First sentence of the manual page for the FLVPlayback class:
 FLVPlayback extends the Sprite class and wraps a VideoPlayer object.
>>> I don't have enough time to figure out how much this matters, but I
>>> assume that if you care you are better of reading the source code anyway.
>>> ___
>>> Flashcoders mailing list
>>> Flashcoders@chattyfig.figleaf.com
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>> 
>> 
>> 
>> 
> 
> 
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread John McCormack
It was a good example of MVC Ross, I think Henrik was saying it should 
have been designed using MVC.


I did see a nice example on a Microsoft poster using a clock with: 
analog and digital views; data in the model and the controller enabling 
the views etc.


I am wondering what an adapter might get up to.

John

On 27/02/2012 13:17, Ross Sclafani wrote:

I'm not implying that the code even adheres to my personal MVC file structure, 
but its functional operation is a good example to illustrate my MVC paradigm.



Ross P. Sclafani
Owner / Creative Director
Neuromantic Industries
http://www.neuromantic.com
http://ross.sclafani.net
http://www.twitter.com/rosssclafani
347.204.5714

On Feb 27, 2012, at 6:39 AM, Henrik Andersson  wrote:


Ross Sclafani skriver:

An MVC Example

FLVPlayback is an interesting MVC  component:

it holds a NetStream as a model of the video

it holds a Video as a view of the Video

It acts as controller to set the model in motion by connecting it to a stream

the ui is also a view of the video: the percent elapsed is represented n the 
scrub bar, ther is a play button while paused, a pause button while playing, 
then there are the time readouts..


Sadly, that is not true.

First sentence of the manual page for the FLVPlayback class:

FLVPlayback extends the Sprite class and wraps a VideoPlayer object.

I don't have enough time to figure out how much this matters, but I
assume that if you care you are better of reading the source code anyway.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders







___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Ross Sclafani
I'm not implying that the code even adheres to my personal MVC file structure, 
but its functional operation is a good example to illustrate my MVC paradigm.



Ross P. Sclafani
Owner / Creative Director
Neuromantic Industries
http://www.neuromantic.com
http://ross.sclafani.net
http://www.twitter.com/rosssclafani
347.204.5714

On Feb 27, 2012, at 6:39 AM, Henrik Andersson  wrote:

> Ross Sclafani skriver:
>> An MVC Example
>> 
>> FLVPlayback is an interesting MVC  component:
>> 
>> it holds a NetStream as a model of the video
>> 
>> it holds a Video as a view of the Video
>> 
>> It acts as controller to set the model in motion by connecting it to a stream
>> 
>> the ui is also a view of the video: the percent elapsed is represented n the 
>> scrub bar, ther is a play button while paused, a pause button while playing, 
>> then there are the time readouts..
>> 
> 
> Sadly, that is not true.
> 
> First sentence of the manual page for the FLVPlayback class:
>> FLVPlayback extends the Sprite class and wraps a VideoPlayer object.
> 
> I don't have enough time to figure out how much this matters, but I
> assume that if you care you are better of reading the source code anyway.
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Air3.2

2012-02-27 Thread Ima Newsletta

Impressive, most impressive:
http://www.youtube.com/watch?v=ZPHATCbnHE0&feature=player_embedded#

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Henrik Andersson
Ross Sclafani skriver:
> An MVC Example
> 
> FLVPlayback is an interesting MVC  component:
> 
> it holds a NetStream as a model of the video
> 
> it holds a Video as a view of the Video
> 
> It acts as controller to set the model in motion by connecting it to a stream
> 
> the ui is also a view of the video: the percent elapsed is represented n the 
> scrub bar, ther is a play button while paused, a pause button while playing, 
> then there are the time readouts..
> 

Sadly, that is not true.

First sentence of the manual page for the FLVPlayback class:
> FLVPlayback extends the Sprite class and wraps a VideoPlayer object.

I don't have enough time to figure out how much this matters, but I
assume that if you care you are better of reading the source code anyway.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] MVC style Correction

2012-02-27 Thread Karl DeSaulniers
That actually makes a lot of sense to me and I haven't written one MVC  
yet.

Thanks for the break-down!
In relation to what Henrik said about using adaptors,
I see the sub controllers as the adaptors, but they are not actually  
adaptors, just sub controllers with targets to the main controller.

Yes?

Best,
Karl


On Feb 27, 2012, at 1:16 AM, Ross Sclafani wrote:


thanks, its just how i do MVC

it really get interesting when you follow a mitosis development  
pattern... You start with one model, controller, and view, add  
features to each in parallel, and as each class gets too big, you  
break them out into subcontrollers, submodels, and subviews. Then  
sub-sub. My projects have a triple-tree structure branching out from  
the core model, controller, and view classes


finer granularity as you reach further in, and always broken into M,  
V, and C:


Models contain properties only. they dispatch a CHANGE Event every  
time one of their properties change,.


Views display properties of the model. they listen for the CHANGE  
Event, and update their appearance with the new values stored in the  
model every time it changes.


Controllers manipulate properties of the model. Whether trigger by  
event handlers in the views, or internal timers or network activity,  
any command that sets any value of any property of the model is  
placed in a controller. Controllers might use other controllers to  
trigger changes in submodels outside its subdomain


the project starts off very compact, then grows with its  
functionality as required, always growing out from the center so you  
never paint yourself into a corner


then later to optimize, you can get specific about which submodel a  
particular view is listening to, in turn limiting the number of  
change events it receives to those actually represented in the view.


all subcontrollers hold a reference to the root controller, so it is  
easy to target any node on the controller tree from anywhere inside  
of it.


same with the model tree. some submodel properties can emit the  
CHANGE Event only on a local level, and not send the event up the  
hierarchy, isolating the scope of view updates


An MVC Example

FLVPlayback is an interesting MVC  component:

it holds a NetStream as a model of the video

it holds a Video as a view of the Video

It acts as controller to set the model in motion by connecting it to  
a stream


the ui is also a view of the video: the percent elapsed is  
represented n the scrub bar, ther is a play button while paused, a  
pause button while playing, then there are the time readouts..


if the video its playing,
the user clicks pause in the view,
it tells the controller to pause the stream in the model,
which notifies the views, so the Video is paused, and  pause button  
becomes a play button.


thats how i do MVC.
data is stored in mvc.models,
data is displayed in mvc.views, and
data is manipulated in mvc.controllers.


Ross P. Sclafani
design / technology / creative

http://ross.sclafani.net
http://www.twitter.com/rosssclafani
http://www.linkedin.com/in/rosssclafani
[347] 204.5714

On Feb 26, 2012, at 11:09 PM, Karl DeSaulniers wrote:


BTW Ross, I thought your example was great.

Karl DeSaulniers
Design Drumm
http://designdrumm.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Karl DeSaulniers
Design Drumm
http://designdrumm.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Importing A Button or Other Component Dynamically With Pure AS 3

2012-02-27 Thread Glen Pike

I think you can compile an SWC and link against that.

http://jessewarden.com/2009/05/creating-modules-in-flash-cs4.html


On 26/02/2012 20:23, it...@aol.com wrote:

Hello Actionscript Experts,


Scenario: I have a shared library *.swf file with most of my  assets.  It
is loaded after the main  introductory *.swf file is already loaded. I then
call from the Shared Library  file the needed assets.
Appears that this scenario of importing assets works great with all  my
custom ones (Sprite, MovieClip, Bitmap, etc).  However, when trying to do the
same with  any of the components like Button, Datgrid..etc, I get an  error.
Right now it appears, the component must be stored in the library  of the
main introductory file, and be linked, which thereby makes this  introductory
file large.
Any idea and/or solution/comments will be appreciated.
Thanks,
Dan
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders