320 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

umm this is annoying… :impatient:

Why can’t I get pass this stupid error? It’s not making sense to me.

I have a MovieClip from the library being brought in another MovieClip and I’m trying to trigger a button to communicate with a movieclip on the stage gotoAndPlay(2);

When I hit the button I’m getting this error.
TypeError: Error #1034: Type Coercion failed: cannot convert Main@277a0041 to flash.display.MovieClip.
    at controlsTicker/saveTickerXML()

Any help?

I thought doing this would be the correct way?
MovieClip(root).ticker_mc.gotoAndPlay(2);

Thanks

1676 posts Envato Elite Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a Free File of the Month
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Europe
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
+1 more
Tean says

Why dont you use stage.getChildByName?

1161 posts
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Referred between 10 and 49 users
  • Bought between 50 and 99 items
FlashTang says

Try this ? :

(root as MovieClip).ticker_mc.gotoAndPlay(2);

or change your Main.as
public class Main extends MovieClip
(instead of exetnds Sprite)

if can’t not access to ticker_mc

try :
public var myTickerMC;

public function Main(){
    myTickerMC=ticker_mc;
}

MovieClip(root).myTickerMC.gotoAndPlay(2);
320 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

Thank you both!

@FlashTang This worked like a charm :)

public class Main extends MovieClip

Thanks again!

by
by
by
by
by
by