
View Class
Tolga Ozdemir
Tolga Özdemir is professionally interested in the usage areas of the internet namely for education and for marketing. Both topics convey somehow the meaning of information engineering, to him. He is a flex/flash developer who has a view on designing but he is indifference to become a designer.
You can reach his writings on actionscript, internet marketing, and e-learning via his web site http://www.tolgaozdemir.net
import net.tolgaozdemir.games.slotmachine.data.SlotMachineData;
import mx.utils.Delegate;
class net.tolgaozdemir.games.slotmachine.view.SlotView extends MovieClip {
private var slot:SlotMachineData;
private var btnRoll:MovieClip;
public function SlotView(s:SlotMachineData) {
if(s!=undefined) this.slot = s;
else this.slot = new SlotMachineData();
this.slot.onRoll = Delegate.create(this, slot_onRoll);
btnRoll.onPress = Delegate.create(this, onPress);
}
public function slot_onRoll(e:Object):Void{
trace( "slot : " + this.slot.Slot );
}
public function onPress(){
this.slot.roll();
trace( "_______________\n");
trace( "roll : " + slot.Slot.toString() );
trace( "score : " + slot.Slot.score );
trace( "win : " + slot.Slot.win );
}
}
Here, we register the class to catch the onRoll event. When the event is invoked, we updated the interface accordingly.
Well, that’s all I can jote about. Use design patterns to learng how effective they are in your applications.

