Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

playing sound from library 1

Status
Not open for further replies.

Flashoid

Technical User
Dec 11, 2002
163
0
0
US
Hello -

I am trying to play a sound file from the library - this works fine when I have all code in root timeline, however when I put the code inside a movieclip it no longer works.

Here is the code I have in frame one of the root timeline:

var snd = new Sound( );
snd.attachSound("sound_01");

_root.snd.start(0, 1);

stop();

I have a wav file named sound_01 in the library.

Does anyone know how to play the sound from inside a movieclip using this code?

thanks!
 
I developed a screen for one to select any letter from the alphabet and if they click on any of the lettered objects a sound will play. I have 26 button symbols (one for each letter) and 26 mp3 sounds for each button symbol. In the button environment I added a layer and inserted keyframe above the "HIT" element and assigned the respective letter sound that should play. Also, when one clicks on a specific letter, they are directed to another web page specifically for that letter. All of the button symbols are on one layer and one keyframe.

When I compile/publish the swf file I get the following message (and no sound).

"Sound has no valid device sound path although device sounds was requested in the export settings, This sound will be ingnored"

Any help is appreciated

Thanks
CD
 
I have never seen the error message. In CS3 I just created a button with a mp3 attached to "Hit" frame (you should do so to the "Down" frame, but since you did) and it just worked fine.

Create a new FLA and create one button, assign a sound file to a "Down" frame. Does it work?

Kenneth Kawamoto
 
Thanks for the response but I tried both Down and Hit and neither worked. Perplexing as it worked earlier yesterday. Must be something I am doing wrong.

CD
 
I put this in the first frame of the movieclip:

var snd:Sound = new Sound(this);
snd.attachSound("sound_01");
_root.snd.start(0, 1);
play();

stop();



But it is not working -- I am using Flash 8 and publishing to flash 8 player but no luck. Am I missing something?

thanks
 
that did the trick!


thanks again!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top