# Stack overflow on Custom Sound Object

**URL:** <https://forum.kirupa.com/t/stack-overflow-on-custom-sound-object/289295>\
**Category:** flash\
**Created:** [May 28, 2009, 4:57pm UTC](https://forum.kirupa.com/t/stack-overflow-on-custom-sound-object/289295 "2009-05-28T16:57:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gathan](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Gathan](https://forum.kirupa.com/u/Gathan)\
**Post date:** [May 28, 2009, 4:57pm UTC](https://forum.kirupa.com/t/stack-overflow-on-custom-sound-object/289295/1 "2009-05-28T16:57:29Z")

</div>

I have a custom sound object base class, and every sound object in the library extends this.Here is a basic stripped down version of my sound object.

```auto

package {
    import flash.media.*;
 
 public class SoundObject extends Sound {
        public function SoundObject() {
        }
  public function Play(startTime:Number = 0, loops:int = 0, sndTransform:SoundTransform = null):SoundChannel {
   var sndc:SoundChannel;
   return sndc;
  }
    }
}

```

Now once I have made a new sound object and attempt to call the custom method I have defined like

```auto

sound.Play();

```

The output window prints out this strange error message.  
What makes it even weirder is the fact that if I put a trace inside of the Play method the code works fine and nothing it printed in the output window.

> 

verify SoundObject/Play()  
stack:  
scope: [global Object$ flash.events::EventDispatcher$ flash.media::Sound$ SoundObject$]  
locals: SoundObject Number int flash.media::SoundTransform? \*  
0:getlocal0  
stack: SoundObject  
scope: [global Object$ flash.events::EventDispatcher$ flash.media::Sound$ SoundObject$]  
locals: SoundObject Number int flash.media::SoundTransform? \*  
1:pushscope  
stack:  
scope: [global Object$ flash.events::EventDispatcher$ flash.media::Sound$ SoundObject$] SoundObject  
locals: SoundObject Number int flash.media::SoundTransform? \*  
2:pushnull  
stack: null  
scope: [global Object$ flash.events::EventDispatcher$ flash.media::Sound$ SoundObject$] SoundObject  
locals: SoundObject Number int flash.media::SoundTransform? \*  
3:coerce flash.media::SoundChannel  
stack: flash.media::SoundChannel?  
scope: [global Object$ flash.events::EventDispatcher$ flash.media::Sound$ SoundObject$] SoundObject  
locals: SoundObject Number int flash.media::SoundTransform? \*  
5:dup  
VerifyError: Error #1023: Stack overflow occurred.  
at SoundObject/Play()  
at NewFlashDocument\_fla::MainTimeline/NewFlashDocument\_fla::frame1()

If anybody could make some sense of this for me it would be most appreciated, because I’m sort of lost:puzzled:
