Addlistener to watch what the currentframe of a movieclip is at.

I need to create an add lsterner that triggers a function when a movieclip reaches frame 65 and then remove the listner. Now the listner is located on level1 and the mc is on level0. I tried with the following code and no luck. Never used listners before but if I can use on here it would work perfect.
var mclListener:Object = new Object();
			mclListener.onLoadInit = function(target_mc:MovieClip) {
				trace("watching");
				if (_level0.loader_mc._currentframe > 65){
					trace("done loading");
					//remove 
				}
			
			};
		
			_level0.loader_mc.addListener(mclListener);

Open in new window

SelphProgrammerAsked:
Who is Participating?
 
Eaddy BarnesITCommented:
0
 
Eaddy BarnesITCommented:
after the MC gets to 65 would it loop and play from 1 again or dose it stop at 65?

GE
0
 
SelphProgrammerAuthor Commented:
It stops after 100 I think. What it is I have a loader with an animation before the loader appears and after. after the page loads I dont want the swf to do anything until the loader animation disappers. All I need is a listner to watch the mcs _currentframe when it reaches 65 I will call a function that animates the page.
0
 
Eaddy BarnesITCommented:
you could place the script  on the 65 frame so when it gets there it will run the function it's self

GE
0
 
SelphProgrammerAuthor Commented:
that will work but I also need it in other areas that call a function won't is there a way to do this can you give me an example?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.