-
random error 1026?
I am new to as3, and my first project has hit a wall. I keep getting error 1026 for what seems like no reason... my constructor is not static... I have searched everywhere and cannot find a solution for why this is happening...
it gives me the error for line 1...
Code:
package{
//imports
import flash.display.MovieClip;
import flash.events.Event;
public class docMain extends MovieClip{
public var myload:loadingScreen;
//Constructor
public function docMain():void
{
//add loading screen here and add to stage
myload = new loadingScreen();
stage.addChild(myload);
//add preload progress bar updater to be run every frame.
addEventListener(Event.ENTER_FRAME, updateProgress);
}
//This function checks how much is loaded and updates the
// progress bar accordingly. I use Enter_frame because I
// have heard progress events and complete events have
// issues on some browsers sometimes...
public function updateProgress(e:Event)
{
//variables for loaded info
var loaded:Number = stage.loaderInfo.bytesLoaded;
var total:Number = stage.loaderInfo.bytesTotal;
var percent:Number = loaded/total;
if(loaded<total)
{
//change loading screen to reflect progress here
var frame:int = percent*200;
myload.setFrame(frame);
}
else
{
//remove progress bar updater from functions to run every frame.
removeEventListener(Event.ENTER_FRAME, updateProgress);
//add game object and remove loading screen from stage here
stage.removeChild(myload);
var game:gameManager = new gameManager();
}
}
}//end docMain Class
}//end package
-
are you getting that as a compile error?
If so, make sure that your document swf is set to AS3 in the publish settings
thats all I can think of without more info
P.S. this may just be a translation issue from code to web, but in your constructor you need your () here:
myLoad = new loadingScreen();
you forgot them
-
I don't know why it caused that particular error but I changed the class name and it worked for some reason... odd...:confused:
-
that is odd, but glad it was resolved.