troubleshooting Question

How can I make a function call from inside an eventListener

Avatar of nooch44
nooch44 asked on
Adobe Flash
17 Comments1 Solution229 ViewsLast Modified:
good day,

i am having an issue launching a public function from inside an eventListener function defined to listen for cuePoints. Inside the listener function is also a trace statement, but the trace statement fires every time and the function is ignored. I have attempted debugging the movie but that even ignores the function, its like its not even there. I have also tried renaming the function and even reordering the functions but nothing works. any ideas or help would be appreciated.

thanks

ps - ive attached some of the class as and commented out the function in the constructor that i need to launch from the listener

 
import caurina.transitions.*;

class CLASSNAME {
	
	public var questionCuePoint:Object = new Object();
	
	public function CLASSNAME(){

		_root.scrubBar.questionBubble._alpha = 0;
		_root.scrubBar.questionBubble._xscale = 0;
		_root.scrubBar.questionBubble._yscale = 0;		
		_root.scrubBar.questionsTab.questionTabSheen._alpha = 0;
		_root.scrubBar.questionBubble.questionBubbleSheen._alpha = 0;
		_root.scrubBar.questionBubble.questionBubble_mark._alpha = 0;		
		_root.scrubBar.questionsTab.questionTab_question._alpha = 0;		
		
		_root.FLVPlayer.setSize(720, 406);
		_root.FLVPlayer.skin = null;		
		_root.FLVPlayer.contentPath = "testFLV_cuePoint.flv";
		
		questionCuePoint.time = 5;
		questionCuePoint.name = "questionCue";
//		questionCuePoint.type = "event";
		_root.FLVPlayer.addASCuePoint(questionCuePoint)

//LAUNCHING THIS WAY WORKS FINE
//		questionBubble(); 

		questionTabMouse();
		_root.FLVPlayer.addEventListener("cuePoint", cuePointListener);
	}
	
	private function questionBubble(){		
		Tweener.addTween(_root.scrubBar.questionBubble, {_alpha:100, _xscale:100, _yscale:100, time:.32, transition:"easeOutBack", onComplete:questionTabSheen});
	}

	public function cuePointListener(eventObject:Object){

		
		trace(eventObject.info.name);

		switch(eventObject.info.name){
			case "questionCue":

//LAUNCHING THIS WAY DOES NOT WORK
			questionBubble();
			trace("questionBubble();");
			break;
		}
		
	}	
	
	public function questionTabSheen(){		
		
		Tweener.addTween(_root.scrubBar.questionsTab.questionTab_question, {_alpha:100, time:.5, transition:"easeInExpo", onComplete:function(){Tweener.addTween(_root.scrubBar.questionsTab.questionTab_question, {_alpha:0, time:.5, transition:"easeOutExpo"});}});
		Tweener.addTween(_root.scrubBar.questionsTab.questionTabSheen, {_alpha:48, _x:381, time:1, transition:"easeOutExpo"});

		Tweener.addTween(_root.scrubBar.questionBubble.questionBubbleSheen, {_alpha:48, _x:102, delay:.5, time:1, transition:"easeOutExpo"});
		Tweener.addTween(_root.scrubBar.questionBubble.questionBubble_mark, {_alpha:100, delay:.5, time:.5, transition:"easeInExpo", onComplete:function(){Tweener.addTween(_root.scrubBar.questionBubble.questionBubble_mark, {_alpha:0, time:.5, transition:"easeOutExpo"});}});

	}	

	public function questionTabMouse(){
		
		_root.scrubBar.questionsTab.onRelease = function(){
			Tweener.addTween(_root.scrubBar.questionBubble, {_alpha:100, _xscale:0, _yscale:0, time:.32, transition:"easeInBack", onComplete:function(){Tweener.addTween(_root.scrubBar.questionsTab, {_y:50, delay:.5, time:.64, transition:"easeOutExpo"});}});
		}
		
		_root.scrubBar.questionsTab.onRollOver = function(){
			_root.scrubBar.questionsTab.questionTabSheen._alpha = 0;
			_root.scrubBar.questionsTab.questionTabSheen._x = 0;					
			Tweener.addTween(_root.scrubBar.questionsTab.questionTab_question, {_alpha:100, time:.5, transition:"easeInExpo", onComplete:function(){Tweener.addTween(_root.scrubBar.questionsTab.questionTab_question, {_alpha:0, time:.5, transition:"easeOutExpo"});}});
			Tweener.addTween(_root.scrubBar.questionsTab.questionTabSheen, {_alpha:48, _x:381, time:1, transition:"easeOutExpo"});
		}
		
	}
	
}
ASKER CERTIFIED SOLUTION
moagrius

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 17 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros