Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package
- {
- public class Model extends
- {
- public static const SOUND_ON:String = "sound.volume.on";
- public static const SOUND_OFF:String = "sound.volume.off";
- private static var instance:Model;
- private var _soundVolume:String = SOUND_ON;
- public static function getInstance():Model
- {
- if (Model.instance == null) Model.instance = new Model();
- return Model.instance;
- }
- public function get soundVolume():String
- {
- return _soundVolume;
- }
- public function set soundVolume( v:String ):void
- {
- _soundVolume = v;
- }
- }
- }
- package
- {
- import src.clientname.Model;
- import flash.display.*;
- public class View extends Sprite
- {
- public function View()
- {
- // set sound off
- Model.getInstance().soundVolume = Model.SOUND_OFF;
- // set sound on
- Model.getInstance().soundVolume = Model.SOUND_ON
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement