|
From: Stephan B. <be...@xs...> - 2006-12-02 17:51:37
|
Hi Stephen!
Stephen Hueners wrote:
>
> Greetings=85I=92ve just downloaded .94 hoping to play around with some=20
> basic operation=85it=92s my first rigorous dive into an AS2 framework.
>
> I=92ve followed the instructions on the verbatim but perhaps ((probably=
)=20
> I=92m missing something drop dead obvious.
>
> At step #8=85that means create a .as file in the ./Scripts folder named=
=20
> AppController.as, right?
>
That's correct.
> And then the rest of the code down to step 11 belongs in AppController.=
as.
>
Very true.
>
> Compiling this tosses an syntax error pointing to:
>
> org.asapframework.management.movie.LocalController:
>
The problem here is that this is actually part of the whole sentence=20
before that. Sorry about the confusing formulation there.
I've changed point 8 in the HowTo to read as follows:
8. Create a class called AppController that extends the class=20
org.asapframework.management.movie.LocalController as found in the=20
framework:
Hope this clarifies the issue with the colon!
>
>
> class AppController extends LocalController {
>
> }
>
> public static function main (inTimeline:MovieClip) : Void {
>
> var controller:AppController =3D new AppController(inTimeline);
>
> inTimeline.controller =3D controller;
>
> controller.start();
>
> // trace("this " + this);
>
> }
>
> public function AppController (inTimeline:MovieClip) {
>
> super(inTimeline);
>
> }
>
The issue here is that the functions "main" and "AppController" have to=20
be inside the class scope as set by the first { and }. In other words,=20
the complete code for the AppController looks like this:
import org.asapframework.management.movie.LocalController;
class AppController extends LocalController {
public function AppController (inTimeline:MovieClip) {
super(inTimeline);
}
public static function main (inTimeline:MovieClip) : Void {
var controller:AppController =3D new AppController(inTimeline);
inTimeline.controller =3D controller;
controller.start();
}
}
I've adapted the HowTo to show the complete class file for easier=20
copying and pasting.
Hope this helps, and good luck!
Cheers,
Stephan
|