- Home
- Articles
- Best Practices
- Flex and MVC - Part I
Flex and MVC - Part I

Creating the Model
package classes.MVCPart1
{
[Bindable]
public class Model
{
private static var _model:Model;
public static function getInstance():Model
{
if(_model == null)
{
_model = new Model();
}
return _model;
}
public function Model()
{
_model = this;
}
public var result:String = "Hello ";
}
}
Some key things to note:
- The class has been marked as [Bindable], so that any changed to any of the members should update the view.
- The variable "result" holds the data and will be responsible for updating the view

