Papervision Event Listener Idea

The problem:
While working on a Papervision3D Flash Project I had a problem where a back button that sits above the 3d canvas and acts as a main navigational item was required to change Events according to where the site was in 3d space at the time.

The solution:
Everytime I’m about to add a new EventListener to the back button movieclip I call the function “delBB()” and then add my event listener using addBB(with the event here).

It seems to work correctly and is a faster way of working.

var currentBackListener = null;
function addBB(whatever) {
back_mc.addEventListener(MouseEvent.CLICK,whatever);
currentBackListener = whatever;
}
function delBB() {
if (currentBackListener!=null) back_mc.removeEventListener(MouseEvent.CLICK,currentBackListener);
currentBackListener = null;
}

Usage:

delBB();
addBB(CLOSE_OBJECT_CLICK_MC);

Share This Article

Related Posts

Comments

There are no comments on this entry.

Trackbacks

There are no trackbacks on this entry.

Add a Comment

Required

Required

Optional

Latest Domains

1. teledyne.com
(6 hours ago)
2. ngtechonology.com
(7 hours ago)
3. nonude.in
(7 hours ago)
4. spicyhunt.com
(13 hours ago)
5. whpromotions.co.uk
(16 hours ago)
6. seslihome.com
(17 hours ago)
7. sesliislam.com
(20 hours ago)
8. woopra.com
(1 day ago)
9. wapdam.com
(1 day ago)
10. 193.105.134.194
(1 day ago)

Services

PHP MySQL Apache Flash Air Java C++ Python