Hi Bjorn

I think you will need to make create references from on class to the
other
Something like

In fla:
Controller.registerModel(model);

In Controller class:
Var myModel:Object;

Static public function registerModel(obj){
        myModel=obj;
}

Then you will be able to send calls to the model from within the
Controller class by using myModel.

Hope it helps

Sebastian


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:bounce-fugli-
> [EMAIL PROTECTED] On Behalf Of Bjorn
> Sent: Monday, 24 January 2005 9:03 PM
> To: Flash Developers List
> Subject: [fugli] MVC event handling with movieClips
> 
> Thanks sebastian with helping me with my last problem
> 
> This time, i've searched for helped but only found examples involving
> components.
> 
> My question is regarding MVC design pattern event handling
> 
> in my "View" i attach a movieClip from the library that acts as a next
> button;
> I am trying to recieve the event in my "Controller" which should call
a
> method in my "Model" which in turn updates the "Observers";
> 
> the problem i have is how do i set up this event handling without
using
> static methods?
> 
> So far my code looks something like this;
> 
> "View"
> mcNext.onPress = function():Void {
>       Controller.onPress(this._name);
> }
> 
> "Controller"
> public static function onPress(broadcaster:String):Void {
>       Model(getModel()).changeData(broadcaster);
> }
> 
> "Model"
> public function changeData(broadcaster:String):Void {
>         var infoObj:Update = new Update(broadcaster);
>       setChanged();
>       notifyObservers(infoObj);
> }
> 
> "Error"
> Line 274: Instance variables cannot be accessed in static functions.
>               Model(getModel()).changeData(broadcaster);
> 
> 
> Help please?????
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---
> You are currently subscribed to fugli as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/

---
You are currently subscribed to fugli as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to