• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Flash CS3, AS2.0, Conflicting event listeners ???

Have two event listeners with the same function name doing two different tasks. Each event listener is on a different scene. Is there any way to not have them see each other? Or is there a better way to achieve my same goal?
Scene 1
 
stage.newscreen = new Object();
stage.newscreen.onMouseMove = function () {
//this goes to scene 2
	gotoAndStop("button2");
}
Mouse.addListener(newscreen);
 
 
Scene 2
 
// create a variable to hold the interval
var interval:Number;
// Create a mouse listener object
var mouseListener:Object = new Object();
mouseListener.onMouseMove = function() {
    killTimeOut();
	setTimeOut();
}
Mouse.addListener(mouseListener);
// method that sets the interval to be called after 1 minute (60000ms)
function setTimeOut(Void):Void {
	interval = setInterval(goScene, 60000);
}
 
// method called when interval fires
function goScene(Void):Void {
//this line goes to scene one
gotoAndPlay("play")
}		
 
// method to kill the interval
function killTimeOut(Void):Void {
	clearInterval(interval);
	delete interval;
}

Open in new window

0
shanebrwn
Asked:
shanebrwn
1 Solution
 
blue-genieCommented:
Hi, i don't see the 2 functions with the same name you're referring to.


P.s a word of advice, don't use scenes. they eventually result in things not working as you would hope/expect.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now