google-code-export / papervision3d

Automatically exported from code.google.com/p/papervision3d
1 stars 1 forks source link

Possible null reference in Sound3D #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The play method in sound 3D should possibly be changed from

public function play(startTime:Number = 0, loops:int = 0,
sndTransform:SoundTransform = null):void
{
    soundChannel = sound.play(startTime, loops, sndTransform);
    setVolume(0);
    setPan(0);
}

to

public function play(startTime:Number = 0, loops:int = 0,
sndTransform:SoundTransform = null):void
{
    soundChannel = sound.play(startTime, loops, sndTransform);
    if (soundChannel)
    {
        setVolume(0);
        setPan(0);
    }
}

This is because sound.play() will return null in some circumstances, such
as the maximum of 32 sound channels already being reached.

Original issue reported on code.google.com by o...@bryangale.com on 6 Apr 2008 at 10:42

GoogleCodeExporter commented 9 years ago
Thank you for the fix. Implemented.

Original comment by r.hauw...@gmail.com on 8 Apr 2008 at 12:30