• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

An animation question

Explorer ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

Hello all

New to Animate CC and believed I was making good progress but I have come up against a problem which I'm unable to solve (after a few hours of trying).

I have a simple animation which I want to the view to start by pressing a button.

I am using a HTML Canvas document (as I intend hosting some animations on my portfolio site)

All the elements to animate on various layers appear on frame 2, with a blank keyframe on frame 1.

The only elements on frame 1 are the background image and also the button. The button only appears on frame 1, and will disappear when the animation begins on frame 2.

The code on frame 1 start with this.stop( )'

This stops the animation from starting and all is good.

The code attached to the button is below:

this.btn.addEventListener("click", fl_MouseClickHandler_2.bind(this));

function fl_MouseClickHandler_2()

{

  gotoFrameAndPlay(2);

}

This code was taken largely from the code snippets Event Handlers/Mouse Click Event, and I inserted the line 'gotoFrameAndPlay(2);'

But this does not work??

This seems a simple, common task to achieve but I am having problem with this.

Any help would be really appreciated.

Views

230

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , May 18, 2017 May 18, 2017

this.btn.addEventListener("click", fl_MouseClickHandler_2.bind(this));

function fl_MouseClickHandler_2()

{

this.gotoAndPlay(2);

}

Votes

Translate

Translate
Enthusiast ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

this.btn.addEventListener("click", fl_MouseClickHandler_2.bind(this));

function fl_MouseClickHandler_2()

{

this.gotoAndPlay(2);

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

That's great, many thanks.
So it was just a case of placing the word 'this.' before the frame number line.

Should have realised. Appreciate your time.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 18, 2017 May 18, 2017

Copy link to clipboard

Copied

LATEST

It's also changing gotoFrameAndPlay() to gotoAndPlay(). There is no gotoFrameAndPlay() command.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines