321 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

1680 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?

1162 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);
321 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!

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by