views:

49

answers:

0

Hallo,

I have my own sound class that is derived from the Flash Sound class. I would very much like to add a Copy function to my extended class. I had it working for a while by using the following code:

var newSoundClass : Class = Class(getDeninitionByName(soundName));
var newInstance = new newSoundClass();

I have tried registering the class using registerClassAlias() without any luck.

I worked most of the time, but it fails every now and then and I am not sure why. But the main problem is that I am now trying to load my .swf file from an other swf. So when I run it now I get errors saying that it can not find the variable MySoundClip. I am thinking that the sound file should now be called MyChildSWF.MySoundClip, but if that is the case I cant figure out the naming convention. It does work if I run it using the flash IDE, but I needed it to always work.

Anyone have any ideas on what I could do to fix this or some other way that I could make copies of a sound?

Regards,