320 posts
  • Has been part of the Envato Community for over 7 years
  • Has collected 100+ items on Envato Market
  • Located in 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

1677 posts Envato Elite Author
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
Tean says

Why dont you use stage.getChildByName?

1161 posts
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Had an item featured in an Envato Bundle
+4 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);
320 posts
  • Has been part of the Envato Community for over 7 years
  • Has collected 100+ items on Envato Market
  • Located in 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