Can i create a function to tell a button to open a movie clip of the same name
I am new to the actionscript side of flash,
I am working on a map that has say 20 popups(movieclips) and the countries are the buttons, i have just been informed i need to add 60 more.
Below is an example of the code i have been using
english_movie.visible=french_movie.visible=turkish_movie.visible=false
english_btn.addEventListener(MouseEvent.CLICK, englishButtonClick);
french_btn.addEventListener(MouseEvent.CLICK, frenchButtonClick);
turkish_btn.addEventListener(MouseEvent.CLICK, turkishButtonClick)
function englishButtonClick(event:MouseEvent😞void {
english_movie.visible=true;
english_movie.play();
french_movie.visible=turkish_movie.visible=false }
function frenchButtonClick(event:MouseEvent😞void {
french_movie.visible=true;
french_movie.play();
english_movie.visible=turkish_movie.visible=false }
function turkishButtonClick(event:MouseEvent😞void {
turkish_movie.visible=true;
turkish_movie.play();
english_movie.visible=french_movie.visible=false }
Im thinking there must be an easier way to do this than replicating the code over and over.
Any help would be much appreciated.
