LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-09-2009, 09:32 AM
jinackman jinackman is offline
Registered User
 
Join Date: Aug 2009
Location: United Kingdom
Posts: 1
Rep Power: 0
jinackman is on a distinguished road
button to play random number +sound help

Hi
i have just followed a tutorial on random number which plays mp3 files, so if random number is 3 it plays sound file sound3.mp3 and so on.
the tutorial can be seen here
http://www.webdesign.org/web/flash-&...cs3.14609.html

the problem is when i click the button i get a different number but no sound, i keep getting this error.

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at sound_fla::MainTimeline/playSound()

i have loaded all the mp3 files into the libary can't seem to find the problem.
iam new to actionscript please help
here is my actionscript code.
Code:
button.addEventListener(MouseEvent.CLICK, playSound);
 
function playSound(e:Event){   
 SoundMixer.stopAll();   
 var num:Number = Math.ceil(Math.random()*4);   
 bigNum.text = num.toString();    
var path:String = "sound" + bigNum.text + ".mp3";   
 var s:Sound = new Sound(new URLRequest(path));   
 s:play();}
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can't get soundclip to play when i click on a button (movieclip) thh022 Flash MX 2004 1 04-09-2006 01:06 PM
How to Play sound? AjAy2 Sound and Music 1 04-04-2006 02:12 AM
play all button Captain Kirk Flash MX ActionScript 0 07-17-2005 01:41 AM
flash does not play sound hippobean Newbies 1 06-06-2005 11:17 AM
On/Off Sound Button Problem modeman Newbies 0 01-28-2005 05:28 PM




All times are GMT. The time now is 01:41 PM.