This question cannot be answered as it...
Why do you want to make separate class files if all the code is not OOP based and resides on the Timeline? Please be more specific. What is the problem that you face when trying to make Objects from your app???
Normally, you need a main class in the document property of your main .fla file.
This mainClass should extends MovieClip.
This is an example in org/Main.as
Create an empty flash file in a folder, then create a folder inside named "org".
Place this code in an file named Main.as in this folder and set org.main as main Class in the document class property.
On the first frame of the fla in the actions panel :
var aVarOnFirstFrame:String = "some variable value";
This example show you how to call the main container for your flash movie and how your class may interact with the doc.
I hope this will be helpful.
You'll see how to call your variables and methods.
package org {
import flash.display.DisplayObjectContainer;
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.Event;
public class Main extends MovieClip{
private var mainStageObject:DisplayObjectContainer;
private var theStage:Stage;
public function Main(){
mainStageObject = this.parent;
theStage = this.stage;
// Let's call this :
trace(this + " == \"[object Main]\"\nAND NOT \"[object MainTimeLine]\"");
trace("which is the default if no main class is specified for the .fla root Document")
// this.stage is a shortcut to the top level element
trace(this + ", paced on " + this.parent + " == " + this.stage + " == " + theStage);
trace("comparaison for the three calls : ");
var equalityParentStage:Boolean = (this.parent === this.stage);
var equalityStageAndTheStage:Boolean = (this.stage === theStage);
var equalityParentAndTheStage:Boolean = (this.parent === theStage);
var equalityDisplayOContainer:Boolean = (this.parent === mainStageObject);
var equalityForAllThreeProps:Boolean = ((this.parent === this.stage) && (this.stage === theStage) && (this.parent === mainStageObject));
trace("this.parent === this.stage ? " + equalityParentStage);
trace("this.stage === theStage ? " + equalityStageAndTheStage);
trace("this.parent === theStage ? " + equalityParentAndTheStage);
trace("this._parent ==== mainStageObject ? " + equalityDisplayOContainer);
trace("this.parent === this.stage === theStage === mainStageObject ? " + equalityForAllThreeProps);
this.addEventListener(Event.ADDED_TO_STAGE,onMainIsOnStage,false,0,false);
this.addEventListener(Event.ACTIVATE,onMainIsActivated,false,0,false);
}
private function onMainIsOnStage(e:Event):void{
trace(e.target.aVarOnFirstFrame);
// -> outputs : null;
}
private function onMainIsActivated(e:Event):void{
trace(e.target.aVarOnFirstFrame);
// -> outputs : some variable value;
}
}
}
/*
[object Main] == "[object Main]"
AND NOT "[object MainTimeLine]"
which is the default if no main class is specified for the .fla root Document
[object Main], paced on [object Stage] == [object Stage] == [object Stage]
comparaison for the three calls :
this.parent === this.stage ? true
this.stage === theStage ? true
this.parent === theStage ? true
this._parent ==== mainStageObject ? true
this.parent === this.stage === theStage === mainStageObject ? true
null
some variable value
*/