Sound in smartfox ?

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

dungkos
Posts: 8
Joined: 23 Jan 2008, 02:01

Sound in smartfox ?

Postby dungkos » 26 Sep 2008, 09:08

I am making a 2-player game in smartfox. In small game, I intend to use some sound file but it does not work. I do not know whether it is problem with Flash or problem with Smartfox.

My code :

var punch:Sound = new Sound();
punch.attachSound("punch");

mouseListener.onMouseDown = function ()
{
punch.start(0, 1);
}

Small game is a SWF file I load into main game. If I play the small game seperately to test. it works. If I play it in main game, it does not work.

Could anybody help me ?
User avatar
thecreatrix
Posts: 19
Joined: 20 Aug 2008, 02:32
Contact:

Postby thecreatrix » 26 Sep 2008, 12:55

Smartfox doesn't have anything to do with playing sounds, so it's probably not the place to look for the problem. :)
dungkos
Posts: 8
Joined: 23 Jan 2008, 02:01

Postby dungkos » 29 Sep 2008, 02:07

I find the solution from another website. Change

From

var punch:Sound = new Sound();

To

var punch:Sound = new Sound(this); // for external swf sound file

And it works. :lol:

Thanks anyway.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 73 guests