PDA

View Full Version : hard times with packages



GrndMasterFlash
July 30th, 2007, 05:52 PM
i have not had to hard of a time getting used to the new syntax of AS3, however i cannot figure out packages, i sniped this enter frame script that is defined in a package, but when ever i publish it it gives an error report

THE CODE
package {
import flash.display.*;
import flash.events.*;

public class TestEnterFrame extends Sprite {
public function TestEnterFrame() {
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}

private function onEnterFrame(ev:Event):void {
trace("onenterframe:"+ev);
}
}

}

THE ERROR
1037: Packages cannot be nested.

senocular
July 30th, 2007, 05:54 PM
that code is meant for an external .as file. It cannot be used in the frame of an FLA

GrndMasterFlash
July 30th, 2007, 06:00 PM
that code is meant for an external .as file. It cannot be used in the frame of an FLA

so i there any time when you can used packages in your main fla, or are they to always be external:+)

senocular
July 30th, 2007, 06:03 PM
always external :)