※このページは書きかけです。
new Theater({
img: [
"img/sample1.gif",
"img/sample2.gif",
"img/sample3.gif"
],
scenario:[
function(){
this.work.count = 0;
this.act({
img: "img/sample1.gif",
msg: "カウント:" + this.work.count
});
},
function(){
this.work.count++;
this.act({
img: "img/sample2.gif",
msg: "カウント:" + this.work.count
});
},
function(){
this.work.count++;
this.act({
img: "img/sample3.gif",
msg: "カウント:" + this.work.count
});
}
]
});
new Theater({
img: [
"img/sample1.gif",
"img/sample2.gif",
"img/sample3.gif"
],
scenario:[
function(){
this.act({
img: "img/sample1.gif",
msg: "trueを返却・・・"
});
return true;
},
function(result){
this.act({
img: "img/sample2.gif",
msg: "前のシナリオ関数の返却値:" + result
+ "。falseを返却・・・"
});
return false;
},
function(result){
this.act({
img: "img/sample3.gif",
msg: "前のシナリオ関数の返却値:" + result
});
}
]
});
var subScenario = [
function(){
this.act({
img: "img/sample2.gif",
msg: "サブシナリオ1"
});
},
function(){
this.act({
img: "img/sample3.gif",
msg: "サブシナリオ2"
});
}
];
new Theater({
img: [
"img/sample1.gif",
"img/sample2.gif",
"img/sample3.gif",
"img/sample4.gif"
],
scenario:[
function(){
this.act({
img: "img/sample1.gif",
msg: "メインシナリオ1"
});
},
function(){
this.push(subScenario);
this.keep();
},
function(){
this.act({
img: "img/sample4.gif",
msg: "メインシナリオ2"
});
}
]
});
new Theater({
img: [
"img/sample1.gif",
"img/sample2.gif",
"img/sample3.gif"
],
scenario:[
function(){
this.alert("alertメソッド。");
},
function(){
this.confirm("confirmメソッド。");
},
function(result){
this.act({
img: "img/sample1.gif",
msg: "confirmの結果:" + result
});
},
function(){
this.prompt("promptメソッド。", "初期値です。");
},
function(result){
this.act({
img: "img/sample2.gif",
msg: "promptの結果:" + result
});
},
function(){
this.choice(["choice1", "choice2", "choice3"]);
},
function(result){
this.act({
img: "img/sample3.gif",
msg: "choiceの結果:" + result
});
}
]
});
※このページは書きかけです。