332 posts
  • 8 Years of Membership
  • Collector Level 4
  • 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

1689 posts Envato Elite Author
  • Affiliate Level 2
  • Author Level 8
  • Collector Level 1
  • Top Monthly Author
+8 more
Tean
says

Why dont you use stage.getChildByName?

1163 posts
  • Affiliate Level 2
  • Author Level 6
  • Collector Level 3
  • Top Monthly Author
+6 more
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);
332 posts
  • 8 Years of Membership
  • Collector Level 4
  • 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