# Playing music through action script

**URL:** <https://forum.kirupa.com/t/playing-music-through-action-script/121363>\
**Category:** Uncategorized\
**Created:** [September 2, 2004, 8:08am UTC](https://forum.kirupa.com/t/playing-music-through-action-script/121363 "2004-09-02T08:08:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blenderben](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/blenderben/32/74_2.png) [@Blenderben](https://forum.kirupa.com/u/Blenderben)\
**Post date:** [September 2, 2004, 8:08am UTC](https://forum.kirupa.com/t/playing-music-through-action-script/121363/1 "2004-09-02T08:08:36Z")

</div>

i have this swf file where i play individual songs through actionscript

this is my code

1st frame

\_root.music = new Sound();  
\_root.music.attachSound(“file1”);  
\_root.music.start(0,99);

1st button

\_root.music.stop();  
\_root.music.attachSound(“file2”);  
\_root.music.start(0,99);

2nd button  
\_root.music.stop();  
\_root.music.attachSound(“file3”);  
\_root.music.start(0,99);

if i start the movie, it plays file1…_duh_ i press button 1, it plays file2…and so on…this whole thing works locally, but it doesn’t work on the internet. i posted it up on my webpage when it first loads, it plays like 1 sec of the music file and stops -\_- why?
