Skip to main content
This topic has been closed for replies.
Correct answer kglad

no, you'll probably want to use something like the following where mc1 and mc2 are your duplicate movieclips (that vary in color).

this.mc2.visible = false;

stage.addEventListener('stagemousedown',downF.bind(this));

function downF(){

this.mc1.visible=!this.mc1.visible;

this.mc2.visible=!this.mc2.visible;

if(this.mc1.visible){

this.mc1.gotoAndPlay(this.mc2.currentFrame);

} else {

this.mc2.gotoAndPlay(this.mc1.currentFrame);

}

}

3 replies

Colin Holgate
Inspiring
August 28, 2017

The other two helping are quite expert, so I'm not going to get into how to solve your issue. Just wanted to say that's one of the neatest animate gif demos I've ever seen.

ProjectorBach
Known Participant
August 28, 2017

Colin Holgate haha.  Thank you.  It was extremely easy to make.  All I did was use screenflow to capture my desktop and exported to animated gif. 

Colin Holgate
Inspiring
August 28, 2017

Well, the rotating tapping messaging isn't the same thing most screenflow users would achieve.

Brainiac
August 28, 2017

Please don't ever do that again. The generated JS and HTML output is huge and not useful for discussion.

To put your HTML content online, you have to upload everything that Animate generates when you publish, in precisely the same folder structure. If you can't or don't want to do that, you can go into the publish settings and click the folder button next to all the asset/script paths. That will make Animate dump everything into the same folder as the FLA.

To swap out one image for another, just put all your swapping images in a named movieclip with a this.stop(); in the first frame. When you want to display something else do this.theNameOfMyMovieClip.gotoAndStop(1); or 2 or 3 or whatever.

kglad
Community Expert
August 28, 2017

1.  you need to upload your html, js and images folder (with that sprite sheet)

2.  create duplicate movieclips and change their color.  then toggle which is displayed on click.

ProjectorBach
Known Participant
August 28, 2017

thank you.  So would I add the onClick code to the images changing (that I'll but in their on symbol), and the duplicate of that?

ProjectorBach
Known Participant
August 29, 2017

This would all be so much simpler if you weren't duplicating the entire animation for every color-changing symbol.


ClayUUID​ thanks Clay but I'm going the other route.  kglad here is how my movie clips are structured.  Same for "mc2". So should I rename "app-window" to "mc" then put the action in "mc"?  Thanks!