Permalink
Browse files

Made FlxG.play() accept a Sound instance as the first parameter, in a…

…ddition to a class.
  • Loading branch information...
1 parent 06c113f commit 77ae29675b8613874148527b0b38c80894ce2e5a @noonat committed Sep 19, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 com/adamatomic/flixel/FlxG.as
@@ -129,7 +129,9 @@ package com.adamatomic.flixel
//@param Volume How loud to play it (0 to 1)
static public function play(SoundEffect:Class,Volume:Number=1):void
{
- (new SoundEffect).play(0,0,new SoundTransform(Volume*_muted*_volume*_masterVolume));
+ if (!(SoundEffect is Sound))
+ SoundEffect = new SoundEffect;
+ SoundEffect.play(0,0,new SoundTransform(Volume*_muted*_volume*_masterVolume));
}
//@desc Plays or resumes the music file set up using setMusic()

0 comments on commit 77ae296

Please sign in to comment.