我已將.fla文件轉換爲.js文件,我在該文件中的多個元素上添加了多個偵聽器。其中'點擊','mousedown'&'鼠標懸停'工作正常,但'pressmove'&'新聞'事件沒有響應,他們甚至沒有產生任何錯誤。這裏是我的代碼片段:EaselJS CreateJS'pressmove','pressup'not working
/****this snippet is from converted .js file *********/
(lib.knob_rot_but = function(mode,startPosition,loop) {
this.initialize(mode,startPosition,loop,{});
// Layer 2
this.shape = new cjs.Shape();
this.shape.graphics.f().s("#999999").ss(0.5,1,1).p("ABlhlQArArAAA6QAAA7grAqQgqArg7AAQg6AAgrgrQgqgqAAg7QAAg6AqgrQArgqA6AAQA7AAAqAqg");
this.shape.setTransform(26.4,0);
this.shape_1 = new cjs.Shape();
this.shape_1.graphics.rf(["#FFFFFF","#CCCCCC","#999999","#666666"],[0.239,0.8,0.941,1],-0.2,0.2,0,-0.2,0.2,14.8).s().p("AhlBlQgqgqAAg7QAAg6AqgqQArgqA6gBQA7ABAqAqQAqAqAAA6QAAA7gqAqQgqAqg7AAQg6AAgrgqg");
this.shape_1.setTransform(26.4,0);
this.timeline.addTween(cjs.Tween.get({}).to({state:[{t:this.shape_1},{t:this.shape}]}).wait(4));
}).prototype = p = new cjs.MovieClip();
/******* My Listeners ******/
var helpButtonDown = DeviceService.getHelpButtonDown();
helpButtonDown.addEventListener("click", function(){alert("helpButtonDown button clicked")}); //works fine
var powerButtonUp = DeviceService.getPowerButtonUp();
powerButtonUp.addEventListener("click", function(){alert("powerButtonUp clicked")});//works fine
/*** Knob Listener***/
var knob = DeviceService.getKnob();
knob.addEventListener("mousedown", function(){console.log("mousedown on knob")}); //woks fine
knob.addEventListener("pressmove", function(evt){console.log("proess move on knob evt :" + evt)}); // doesn't work :(
量變到質變到V0.7.0爲我工作。非常感謝。 :) – user3099736