[Papervision3D] add/remove Event Listener for an Interactive Material..
mikotondria
mike at tol23.com
Thu Nov 8 12:07:03 PST 2007
Halloo...
In my app, I have set up an InteractiveMovieAssetMaterial, then added an
eventListener to it, that calls a function, thusly:
//____inside function that creates a plane and adds it to the 'scene'..
var biosmaterial:InteractiveMovieAssetMaterial = new
InteractiveMovieAssetMaterial("bios", initMats);
biosmaterial.movie.addEventListener(MouseEvent.CLICK, handleMainClick);
when the plane that uses this material is clicked, I want to remove the
event listener (the plane becomes the background for some 2nd level
content), and I thought I could just refer to the biosmaterial.movie, as I
did when I constructed it..by:
public function handleMainClick(e:MouseEvent):void {
//trace("you clicked", e.currentTarget);
biosmaterial.movie.removeEventListener(MouseEvent.CLICK, handleMainClick);
}
but I am getting the ubiquitous:
TypeError: Error #1009: Cannot access a property or method of a null object
reference.
at myExperiment/handleMainClick()
What do I need to do to access this material's movie, or am I going about it
all wrongly :/
Mr Grden, if you have 0.8 seconds, I would be eternally grateful, lol :D
Many thanks talented people.
--
View this message in context: http://www.nabble.com/add-remove-Event-Listener-for-an-Interactive-Material..-tf4773257.html#a13654729
Sent from the Papervision3D mailing list archive at Nabble.com.
More information about the Papervision3D
mailing list