Hi,

You should place the var declaration in the body of the class, but the call
to createEmptyMovieClip and loadMovie should be within some method.

// var declaration
private var posterMc:MovieClip;

// var use
private function someMethod():Void {
     posterMc = this.createEmptyMovieClip('posterMc',100);
     this.posterMc.loadMovie('adv_saleposter.swf');
}


Cheers
Juan Pablo Califano


2008/4/28, Jim McIntyre <[EMAIL PROTECTED]>:
>
> I'm working in a framework for the first time (Gaia). I'll be including
> games on some of the site's "pages," and most of the games will need to load
> a few external SWFs.
>
> In the (AS2) class file for the page I'm trying to modify, I'm trying to
> add this code inside the class constructor function (which is provided in
> the Gaia AS template), so that the SWF is loaded when the page is
> initialized:
>
> --code begins--
>  private var posterMc:MovieClip =
> this.createEmptyMovieClip('posterMc',100);
>  this.posterMc.loadMovie('adv_saleposter.swf');
> --code ends--
>
> The second line of the above code is producing a compile error that says
> "This statement is not permitted in a class definition." (The script is
> actually full of lines that produce the same error, which indicates I'm way
> off base.)
>
> Can someone help me pull my head out of my AS2 and tell me what's wrong
> with my approach? I'm sure this points to a bigger design problem than I
> realize...
>
> TIA,
> Jim
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to