MOUSE OVER, ANIMATE
hi guys,
i student , trying show movie clip when mouse reaches invisible button (on second frame).
well, it's not working @ all.
and also, every time put eventlistener, button on first frame stop working.
// frame 2:
this.stop();
var keycode_lef = 37;
var keycode_righ = 39;
this.whisky1.visible = false;
this.b1.addeventlistener("mouseover",onover.bind(this));
this.b1.addeventlistener("mouseout",onout.bind(this));
function onover(){
this.whisky1.visible = true;
this.b1.removealleventlisteners();
}
function onout(){
this.whisky1.visible = false;
this.b1.removealleventlisteners();
}
document.onkeydown = handlekeydown.bind(this);
function handlekeydown(e) {
if (!e) {
var e = window.event;
}
switch (e.keycode) {
case keycode_lef:
console.log("left");
this.bagsymalone1.x -= 25;
if (this.bagsymalone1.x <= 60){
this.gotoandstop(2);
}
return false;
case keycode_righ:
console.log("right");
this.bagsymalone1.x += 25;
if (this.bagsymalone1.x >= 450){
this.gotoandstop(3);
}
return false;
}
}
// frame i:
this.stop();
this.justplay1.addeventlistener("click", gotonextframeandstop.bind(this));
var keycode_left = 37;
var keycode_right = 39;
document.onkeydown = handlekeydown.bind(this);
function handlekeydown(e) {
if (!e) {
var e = window.event;
}
switch (e.keycode) {
case keycode_left:
console.log("left");
if (this.bagsymalone1.x >= 60){
this.bagsymalone1.x -= 10;
return false;
}
case keycode_right:
console.log("right");
if (this.bagsymalone1.x <= 450){
this.bagsymalone1.x += 10;
return false;
}
}
}
function gotonextframeandstop()
{
this.justplay1.removealleventlisteners();
this.gotoandstop(1);
}
the forum lounge not technical help, please provide name of program using message may moved correct program forum
More discussions in Adobe Animate CC - General
adobe
Comments
Post a Comment