This content has been marked as final. Show 3 replies
have you declared the rest of the SoundObject structure and attached the Library sound file?
You may want to write this more like below, place this code in frame one on a new layer in the same (root probably) timeline that you have the MC and the button in, call the layer 'actions', and remove the handlers that you have attached to the button. You will also need to give your button an 'instance name' (I used 'xmas_btn' in the code), and you will need to give the Sound file in the Library a 'Linkage identifier'. To do so, right-click the file in the Library, select ... you guessed it, Linkage ... , and enter a name for the id (I used the id of 'xmas_id' int he code) that should do it.
Thanks, your code example works perfect. The book I'm reading, "Show Me Macromedia Flash MX 2004" didn't say anything about declaring the rest of the SoundObject structure and attaching the Library sound file. I wish I could find a better book for learning actionscript. I'm very new to actionscript and programming. Thanks again for your time and help.
you're welcome Mike, one of the best resources (although sometime difficult to follow) is the Flash Help Guide/Manual (F1) there is a huge amount of information on everything that Flash can do, as well as several starter tutorials, it is one of the most heavily documented Manuals anywhere. the topics you ran into here are covered in 'Learning ActionScript>Working with Images, Sound and Video' and 'ActionScript Langauge Reference>Sound' class