The metadata belongs to the class, so you have to put it directly before the
class definition like this:

package
{
  import flash.display.Sprite;

  [SWF(backgroundColor="#ff0000")]
  public class SampleClass extends Sprite
  {
    public function SampleClass()
    {
    }
  }
}

Haykel Ben Jemia

Allmas
Web & RIA Development
http://www.allmas-tn.com




On Tue, Mar 3, 2009 at 1:34 AM, elevight <[email protected]> wrote:

>   I have created an empty actionscript class, and I'm trying to use
> metadata to change the background color:
>
> package
> {
> [SWF(backgroundColor="#ff0000")]
>
> import flash.display.Sprite;
>
> public class SampleClass extends Sprite
> {
> public function SampleClass()
> {
> }
> }
> }
>
> But the background color is not changing to red. Can anybody see what
> I'm doing wrong?
>
> Thanks.
>
>  
>

Reply via email to