4n6design
4n6design

Reputation: 11

createjs button mouse over not working

This is using a button on the stage in Flash CC 2014 in Canvas mode (html 5). The button has a mouse over look on frame 2 of the button movie clip. I am using this code to go to the frame 2 of the button but it is not working:

function mouseOver(event) {
    // frame 2 the button is darker in tint
    event.currentTarget.gotoAndStop(2);
    stage.update(event); 
}

Upvotes: 0

Views: 1658

Answers (1)

RafelSanso
RafelSanso

Reputation: 33

Maybe you need to enable the mouse over effect. For example:

var stage = new createjs.Stage("canvas");
stage.enableMouseOver(10);

// Draw circles
var c1 = new createjs.Shape().set({name:"large-purple"});
c1.graphics.f("purple").dc(100,100,75);
c1.addEventListener("mouseover", function(event) {
    c1.scaleX = c1.scaleY = 1.1;
});
c1.addEventListener("mouseout", function(event) {
    c1.scaleX = c1.scaleY = 1;
});

You need to use this function stage.enableMouseOver(10); to enable mouse events.

Upvotes: 3

Related Questions