+ Reply to Thread
Results 1 to 2 of 2

preload OOP

This is a discussion on preload OOP within the Actionscript 3.0 avanzato forums, part of the Flash Italiano category; Salve Voglio realizzare un preload con le classi, ma per qualche ragione mi carica la barra solo alla fine del ...

  1. #1
    Junior Member Settled In Sorcery is on a distinguished road
    Join Date
    Sep 2009
    Posts
    23
    Rep Power
    0

    preload OOP

    Salve

    Voglio realizzare un preload con le classi, ma per qualche ragione mi carica la barra solo alla fine del preload, ovvero al 100%...da precisare che messo sulla root come funzione , funziona.
    Grazie per l'aiuto.

    La classe
    PHP Code:
    package mc 
    {
        
    import flash.display.MovieClip;
        
    import flash.events.ProgressEvent;
        
    import flash.display.LoaderInfo;
        
    import flash.display.Loader;
        
    /**
         * ...
         * @author 
         */
        
    public class McPreloading extends MovieClip
        
    {
            public var 
    chekPreload:Boolean;
            public function 
    McPreloading() 
            {
                
    chekPreload false;
                
                
    stage.loaderInfo.addEventListener(ProgressEvent.PROGRESSloading);
                
    //stage.loaderInfo.addEventListener(ProgressEvent.COMPLETE, loadComplete);
            
    }
            
            public function 
    loading(event:ProgressEvent):void {
                var 
    pcent:Number event.bytesLoaded event.bytesTotal 100;
                
    trace(pcent);
                
    lbar.scaleX=pcent/100;
                
    lpc.text=int(pcent)+"%";
                if (
    pcent == 100) {
                    
    removeChild(this);
                    
    this.gotoAndStop(2);
                    
    chekPreload true;
                }
            }
            
            public function 
    loadComplete() {
                
    //removeChild(this);
                
    this.gotoAndStop(2);
                
    chekPreload true;
                
                
            }
            
        }



  2. #2
    Administrator Living At The FlepStudio! Flep is on a distinguished road
    Join Date
    Jul 2007
    Posts
    5,762
    Rep Power
    11

    Re: preload OOP

    Ciao,
    quella classe è associata a qualche MovieClip in libreria ?
    Se sì, ti consiglio per prima cosa di usare Event.ADDED_TO_STAGE.

+ Reply to Thread

Similar Threads

  1. preload AS3
    By sergiooss in forum Actionscript 3.0 base
    Replies: 0
    Last Post: 21-07-10, 18:18
  2. preload e sound on e off
    By sciusciu83 in forum Actionscript 3.0 base
    Replies: 0
    Last Post: 18-12-09, 06:24
  3. Come si crea un preload ?
    By bartjsp in forum Flash Italiano
    Replies: 1
    Last Post: 02-11-08, 05:39
  4. Preload
    By agaetano in forum Flash Italiano
    Replies: 0
    Last Post: 15-10-08, 12:38
  5. preload
    By windex3000 in forum Flash Italiano
    Replies: 1
    Last Post: 23-10-07, 07:11

Bookmarks

Posting Permissions

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