Skip to main content
January 25, 2012
Answered

Error #1034: Type Coercion failed ?

  • January 25, 2012
  • 1 reply
  • 2672 views

Hi there,

I'm using Action Script 3 and CS4

I'm trying to create a product and when i play it I get this error:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@16ed7e1 to flash.display.SimpleButton.

at flash.display::MovieClip/gotoAndPlay()
at Homepage_fla::MainTimeline/after()[Homepage_fla.MainTimeline::frame88:5]

The coding for the scene is:


stop();

function Goto (event:MouseEvent): void {
gotoAndPlay (1,"The Course");
}
function GoBack(event:MouseEvent): void {
gotoAndPlay (1,"Aperture");
}
function Home(event:MouseEvent): void {
gotoAndPlay (1,"Homepage");
}

btn_bac.addEventListener(MouseEvent.CLICK, GoBack);

btn_thecourse.addEventListener(MouseEvent.CLICK, Goto);

btn_homepagee.addEventListener(MouseEvent.CLICK, Home);

This topic has been closed for replies.
Correct answer _spoboyle

The error doesn't really make sense and I am no expert on timeline coding, I never use it.

Having goToAndPlay(1, "The Cource"); on the main timeline is telling the the playhead to go to frame 1 in the scene called "The Cource"

Do you have separate scene for all these pages, and do you have a separate scene called "The Cource"? Is this a spelling mistake and should be "The Course"?

The thing I don't understand is why its thinking the main timeline is a SimpleButton.

1 reply

_spoboyle
Inspiring
January 25, 2012

this is the code from frame 88 on the main timeline?

which line is line 5?

January 25, 2012

gotoAndPlay (1,"The Course");

I think sorry not very good at Flash, don't know what i'm doing!

_spoboyle
_spoboyleCorrect answer
Inspiring
January 25, 2012

The error doesn't really make sense and I am no expert on timeline coding, I never use it.

Having goToAndPlay(1, "The Cource"); on the main timeline is telling the the playhead to go to frame 1 in the scene called "The Cource"

Do you have separate scene for all these pages, and do you have a separate scene called "The Cource"? Is this a spelling mistake and should be "The Course"?

The thing I don't understand is why its thinking the main timeline is a SimpleButton.