Need Help on Creating a Character Select Menu Screen
Hello! I am making a short interactive animation using Adobe Animate's HTML5 canvas and javascript. The goal was to make a functioning title, menu, and character select screen for an ideal fighting game. The problem is I can't get the character select menu to function like I want it to.
The idea is that, when the character select screen opens up and the menu screen leaves via a sliding tween I made, the user will click on a character's icon. When they do, an image of that character will appear on the left side of the screen within a light blue rectangle shape, a sound effect will play, and a voice line will play. I have been using the Windows > Actions panel to accomplish this.
For example, there is a button symbol called "WonderWoman_btn" that is placed where her icon is on the character select screen. There is also a graphic symbol for a light blue panel on the screen where a character's image will appear after being chosen, named "player1_L". This graphic symbol has two frames and two layers: the first frame shows no character, only that light blue shape, and the second frame shows that character within the shape (the layer on top is masking the bottom layer so that the character image doesn't go past the boundaries of the shape). In my code, I have this written at frame 75, when my character select screen is fully visible to the user:
var _this = this;
_this.player1_L.gotoAndStop(1);
_this.WonderWoman_btn.on('click', function(){
_this.player1_L.gotoAndStop(2);
});
In theory, the user will see only the first frame of player1_L, which has no image. When the user clicks the WonderWoman_btn, it will go to frame 2, showing her image within the light blue rectangle shape I've made, while any other animations going on at that time will continue regardless of this change. However, I have edited this numerous times to no avail. I've tried changing the code, changing the symbol's properties and type to movie clip instead, quit and reloaded adobe animate...no luck! To make matters worse, I was not able to figure out how to get the whole voice line to play when this occurs either--attaching a sound to the hit state of a button symbol only last for that frame; I want to hear the entire voice clip, not just one frame of it. If you know how to achieve this goal of mine or, better yet, know a much easier and more efficient way of programming this, please help me out!