We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

Medium Priority
266 Views
Last Modified: 2013-11-11
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

Comment
Watch Question

after the MC gets to 65 would it loop and play from 1 again or dose it stop at 65?

GE

Author

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.
you could place the script  on the 65 frame so when it gets there it will run the function it's self

GE

Author

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?

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.