A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Error: The class or interface 'Event' could not be loaded.

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    6

    Unhappy Error: The class or interface 'Event' could not be loaded.

    Hey, I'm new to the forums and I have problems with Flash that i just cant fix. I have this error that keeps telling me how "The class or interface 'Event' could not be loaded. The error is on the 5th line of the code:


    1 stop();
    2
    3 addEventListener(Event.ENTER_FRAME, preLoad);
    4
    5 function preLoad(e:Event):void{
    6 var bytestoLoad:Number = loaderInfo.bytesTotal;
    7 var numberLoaded:Number = loaderInfo.bytesLoaded;
    8 if(bytestoLoad == numberLoaded){
    9 removeEventListener(Event.ENTER_FRAME, preLoad);
    gotoAndStop(2);
    } else {
    _root.preLoader.preLoaderFill.scaleX = numberLoaded/bytestoLoad;
    _root.preLoader.bytesPercent.text = Math.floor(numberLoaded/bytestoLoad*100) + "%";
    }
    }

    I know that the code is for AS3 but I cant switch to AS3 atm and I need the same code, but for AS2. So, can anyone convert this for me? Thanks in advance

  2. #2
    Junior Member
    Join Date
    May 2013
    Posts
    6

    Unhappy

    By the way, this is supposed to be a preloader and I am putting this on the 1st frame. I have so extensions (.as), just the .fla file.

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    6
    Also, I am using the newest Flash, Adobe Flash CS6.

  4. #4
    Junior Member
    Join Date
    May 2013
    Posts
    2
    I just had a similar error and was able to correct it by removing the Class label from the symbol.

    I'm pretty new to all this though so am not sure if you would have a symbol named "event".

  5. #5
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    stop();
    
    this.onEnterFrame = function() {
            var amount= this.getBytesLoaded() / this.getBytesTotal()*100;
            _root.preLoader.preLoaderFill._xscale = amount;
            _root.preLoader.bytesPercent.text = Math.round(amount)+"%";
            if(amount == 100) {
                    this.gotoAndStop(2);
                    delete this.onEnterFrame;
            }
    }

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