※このページは書きかけです。


解説/上級編

Theaterクラスインスタンス生成時、およびactメソッドの引数について

Theaterクラスインスタンス生成時、actメソッド共通プロパティ

Theaterクラスインスタンス生成時固有プロパティ

メニュー表示

new Theater({
  img: [
    "img/sample1.gif"
  ],
  scenario: [
    function(){
      this.act({
        img: "img/sample1.gif",
        msg: "メニューテスト"
      });
    },
    function(){
      var _theater = this;
      this.menu({
        contents: "MENU TEST<br/>"
                + "<input type='text' name='IN' value='DEFAULT_VALUE'/><br/>"
                + "<button name='btn' class='menu-contents-control'>入力<\/button>",
        actions: {
          'btn': function(menu){
            _theater.setResult(this.form.IN.value);
            menu.close();
          }
        },
        focusName: 'IN',
        title: "入力"
      });
    },
    function(result){
      this.speak("結果:" + result);
    },
    function(){
      var _theater = this;
      this.menu({
        contents: "どっち?<br/>"
          + "<button name='yes' class='menu-contents-control'>はい<\/button>"
          + "<button name='no' class='menu-contents-control'>いいえ<\/button>",
        actions: {
          'yes': function(menu){
            _theater.setResult(true);
            menu.close();
          },
          'no': function(menu){
            _theater.setResult(false);
            menu.close();
          }
        },
        title: "確認"
      });
    },
    function(result){
      this.speak("結果:" + result);
    }
  ]
});

※このページは書きかけです。


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS