This is AS2
import mx.utils.Delegate; import mx.transitions.Tween; import mx.transitions.easing.*;
class com.site.content.Book extends MovieClip { private var bookMusic:Sound = new Sound(); ... }
The error I get is: > A class's instance variables may only be initialized to compile-time constant expressions.
and then it lists the var declaration shown above as the issue.
Is there an include I'm missing (if so I looked through the MX folder but couldn't find it). Can I not use Sound in a MovieClip object?
i'm not sure if you can instantiate sounds at declaration-time.
try :
import mx.utils.Delegate; import mx.transitions.Tween; import mx.transitions.easing.*;
class com.site.content.Book extends MovieClip { private var bookMusic:Sound;
public function Book()
{
bookMusic = new Sound();
}
}
haven't worked in as2 for years so it might be a long shot :shrug:
A.
Yeah, that was it. I had tried that earlier, but an ID10T error prevented it from working as it should, which is why I was so lost.
Got it working now.
Thanks for the reply 