dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: random error 1026?

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    13

    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

  2. #2
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    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
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


  3. #3
    Junior Member
    Join Date
    May 2008
    Posts
    13
    I don't know why it caused that particular error but I changed the class name and it worked for some reason... odd...

  4. #4
    Flactionscrish Baby Minion's Avatar
    Join Date
    Nov 2005
    Location
    Planet Earth
    Posts
    312
    that is odd, but glad it was resolved.
    ktu[k-two]
    he who hesitates is lost; so i guess i'll wander intently

    Are you sure this is real?
    Life is Love, Love is Blind, Blind we go through Life.
    Life isn't hard, dealing with your self is.

    The concept of life in a human brain is weakening day after day. Live every day like its your last. Take the chances, and opportunities, and never let authority push you around for fun.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center