下記のようにindex.htmlから外部のjsに記述している
関数:onbtn_abc()を実行したいのですが、うまく実行されないので質問させて頂きました。
どのように記述すれば良いでしょうか?
---index.html---
javascript
1<script type="text/javascript"> 2 3function handleComplete() { 4 5 exportRoot = new lib.test(); 6 7 stage = new createjs.Stage(canvas); 8 stage.addChild(exportRoot); 9 stage.update(); 10 11 createjs.Ticker.setFPS(lib.properties.fps); 12 createjs.Ticker.addEventListener("tick", stage); 13 14 $("#btn_smile").click(function () { 15 16 //test.jsのonbtn_abc()を実行したい! 17 18 }); 19 20} 21 22</script> 23
--- test.js---
javascript
1(lib.test = function(mode,startPosition,loop) { 2if (loop == null) { loop = false; } 3 this.initialize(mode,startPosition,loop,{}); 4 5 // timeline functions: 6 this.frame_0 = function() { 7 8 this.gotoAndPlay(1); 9 10 function onbtn_abc(){ 11 this.gotoAndPlay(100); 12 } 13 14 } 15 16 this.frame_300 = function() { 17 this.gotoAndPlay(1); 18 } 19 20}).prototype = p = new cjs.MovieClip(); 21p.nominalBounds = new cjs.Rectangle(326.6,1015.6,253.1,94); 22 23})(lib = lib||{}, images = images||{}, createjs = createjs||{}, ss = ss||{}); 24var lib, images, createjs, ss; 25
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。