bytesLoaded HELP? !!

Everything works perfectly except for one thing... for the life of me I can't get the text per cent go to "" after it is loaded.
Ive tried several ways that you can see and track returns true. I load this way: main.sfw <-videoPlayer.swf <-video/TTH768K_314x210.flv. Evereything works great exept to get rid of the text "100".

Oh help them

No No. I need to clearInterval not otherwise specified in the text, it's just the value keeps checking the bytesLoaded.

Tags: Adobe Animate

Similar Questions

  • Help with public static functions.

    Hey everyone, I worked on a problem for a while and have finally understood just wrong. Google is not helped me to find the right way, so I'm posting it here. I sort of understand what's wrong with my code, but I have no idea how to do right. I'm a total noob to AS3, this is my first project.

    I have a main FLA file called game.fla with nothing on the stage, starting with. The document class is Main.as (shown below). The main class is supposed to manage the switching between the preLoader, mainMenu and game itself. The preloader loads and the player must press play to go to the main menu. The main menu is controlled by MainMenu.as, which adds event listeners for buttons game, instructions and credits. At the present time, instructions and credits just draw responses. When you click on play, I want to remove the mainmenu (not a problem with parent.removeChild (this)); and add the game. This is my problem comes in. I can't say parent.addChild (game), because honestly, I don't know how (I need to set a variable in hand or MainMenu and must it be public, static, etc?). Simplicity seems to be a function called initializeGame() that I could simply call of mainMenu. Problem: I have to do a static function, which doesn't let me use addChild, removeChild or any other variable that I create. Could someone please explain how I could do this job (even if it means change my structure. "I would be happy to learn a better way to deal with this kind of thing). Also, on a side note: if I can't use the static function with add or remove a child, can I optimize the effect later? I want later in my game, that I would need to call functions between classes, on a button click, for example, that affect the scene (or objects in the scene). Can I do it another way? For example, by clicking on an icon of the video game card clip, I would map the movieclip to load. A function that could be described seems the best way to do it, but I'm sure he can otherwise. Thank you much in advance. My code is below.

    Main.As

    package
    {
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.MouseEvent;
    
        public class Main extends MovieClip
        {
            private var preLoader:PreLoader;
            private var mainMenu:MainMenu;
            private var game:Game;
            
            public function Main()
            {
                preLoader = new PreLoader;
                addChild(preLoader);
                preLoader.gotoAndStop(1);
                addEventListener(Event.ENTER_FRAME, barLoading);
            }
            private function barLoading(event:Event):void
            {
                var total:Number = stage.loaderInfo.bytesTotal;
                var loaded:Number = stage.loaderInfo.bytesLoaded;
                preLoader.loadingBar.scaleX = loaded/total;
                
                if (loaded==total)
                {
                    removeEventListener(Event.ENTER_FRAME, barLoading);
                    preLoader.gotoAndStop(2);
                    preLoader.doneLoading.addEventListener(MouseEvent.CLICK, doneLoading);
                    loaded = null;
                    total = null;
                }
            }
            private function doneLoading(event:MouseEvent):void
            {
                preLoader.doneLoading.removeEventListener(MouseEvent.CLICK, doneLoading);
                mainMenu = new MainMenu;
                addChild(mainMenu);
                removeChild(preLoader);
            }
            static public function initializeGame():void
            {
                game = new Game;
                removeChild(mainMenu);
                addChild(game);
            }
        }
    }
    

    MainMenu.as

    package
    {
        import flash.display.MovieClip;
        import flash.events.Event;
        import flash.events.MouseEvent;
    
        public class MainMenu extends MovieClip
        {
            
            public function MainMenu()
            {
                playGameButton.addEventListener(MouseEvent.CLICK, playGameButtonFunction);
                instructionsButton.addEventListener(MouseEvent.CLICK, instructionsButtonFunction);
                creditsButton.addEventListener(MouseEvent.CLICK, creditsButtonFunction);
            }
            private function playGameButtonFunction(event:MouseEvent):void
            {
                playGameButton.removeEventListener(MouseEvent.CLICK, playGameButtonFunction);
                instructionsButton.removeEventListener(MouseEvent.CLICK, instructionsButtonFunction);
                creditsButton.removeEventListener(MouseEvent.CLICK, creditsButtonFunction);
                            
            }
            private function instructionsButtonFunction(event:MouseEvent):void
            {
                instructionsButton.removeEventListener(MouseEvent.CLICK, instructionsButtonFunction);
                trace("instructions");
            }
            private function creditsButtonFunction(event:MouseEvent):void
            {
                creditsButton.removeEventListener(MouseEvent.CLICK, creditsButtonFunction);
                trace("credits");
            }
        }
    }
    

    In addition, anny comments on my coding habits and how to improve are welcome.

    in the hand

    var preloader: Preloader = new Preloader (();)

    preloader.addEventListener ("preloadCompleted", preloadCompletedF);

    in the Preloader, loading complete:

    this.dispatchEvent (new Event ("preloadCompleted"));

  • Error #1009 Help!

    Dear all,

    I hope you can help me with what is probably something very simple but seems to touch most of the people! However, I spent all day researching it and try all sorts of codes to solve the error!

    I am trying to build a new website using Flash CS5 and I'm very new to any script business (as3).  After finishing the main content of the site, I created an external preloader, so it can load the main SWF file. However, when I debug or test the scene I get this error:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
       at Index_fla::MainTimeline/frame1()[Index_fla.MainTimeline::frame1:11]

    After many hours, I find the publication settings, publication of debugging that actually tells me what mount / the origin of the problem! If I go to my main file (called Index.Fla) and look at picture 1, line 11, it says:

    var buttonsArray:Array = [works_btn,about_btn,contact_btn];

    ... that sounds right, seem to consider when the preloader is finished the file flash main (work/comments/contact) navigation buttons does not quite right. They still work take back you to the right pages (or frames) but the mouse, mouse click, functions do not work.

    Now, I'm not really sure how to deal with this, because all the buttons (which are video clips) are located on the frame one and carry the name of the instance to the right and MORE when I debug the Index.Fla file, everything works normally.

    Should I assume that there is something wrong with my preloader file?

    Below is the script for the preloader and frame a fo the index file. I hope you can help me! Thank you!

    PRELOADER:

    var l:Loader = new Loader();

    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    l.load(new URLRequest("Index.swf"));

    function loop(e:ProgressEvent):void
    {
       var perc:Number = e.bytesLoaded / e.bytesTotal;
       percent.text = Math.ceil(perc*100).toString() + "% Complete";
    }

    function done(e:Event):void
    {
       removeChildAt(0);
       removeChild(preloader)
       percent = null;
       addChild(l);

       l.contentLoaderInfo.removeEventListener( ProgressEvent.PROGRESS, loop);
       l.contentLoaderInfo.removeEventListener(Event.COMPLETE, done);

    }

    INDEX (MAIN - FRAME ONE FILE)


    stop();

    works_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
    about_btn.addEventListener(MouseEvent.CLICK, navigationClicked);
    contact_btn.addEventListener(MouseEvent.CLICK, navigationClicked);

    stage.frameRate = 30;
    var buttonsArray:Array = [works_btn,about_btn,contact_btn];

       function setButtons():void
       { for (var i:int=0; i<buttonsArray.length; i++)
          {   buttonsArray[i].id = i;  
             buttonsArray[i].buttonMode = true;  
             buttonsArray[i].mouseChildren = false;  
             buttonsArray[i].mouseEnabled = true;  
             buttonsArray[i].addEventListener(MouseEvent.ROLL_OVER,playOver);  
             buttonsArray[i].addEventListener(MouseEvent.ROLL_OUT,playOut);  
             buttonsArray[i].addEventListener(MouseEvent.CLICK,doClick);  
          }
    }

    function playOver(event:MouseEvent):void
       {   event.currentTarget.gotoAndPlay("over");
       }
    function playOut(event:MouseEvent):void
       {   event.currentTarget.gotoAndPlay("out");
       }

    function doClick(event:MouseEvent):void{
      
       var currentBtn:int = event.currentTarget.id;  

       setSelectedBtn(currentBtn);
    }

    function setSelectedBtn(id:int):void{  
       for (var i:int=0; i< buttonsArray.length; i++) {  
          if (id == i) {  
             buttonsArray[i].gotoAndStop("down");  
             buttonsArray[i].buttonMode = false;  
             buttonsArray[i].mouseEnabled = false; 
             buttonsArray[i].removeEventListener(MouseEvent.ROLL_OVER,playOver);  
             buttonsArray[i].removeEventListener(MouseEvent.ROLL_OUT,playOut); 
             buttonsArray[i].removeEventListener(MouseEvent.CLICK,doClick);
             } else {  
                if(buttonsArray[i].currentLabel =="down"){
                   buttonsArray[i].gotoAndPlay("out");  
                   }  
                   buttonsArray[i].buttonMode = true;  
                   buttonsArray[i].mouseEnabled = true;  
                   buttonsArray[i].addEventListener(MouseEvent.ROLL_OVER,playOver);  
                   buttonsArray[i].addEventListener(MouseEvent.ROLL_OUT,playOut);  
                   buttonsArray[i].addEventListener(MouseEvent.CLICK,doClick);
                   }  
             }
          }
    setButtons();

    function navigationClicked(Event:MouseEvent):void
    {
       var frmLabel:String = '';

        switch (Event.target)
       {
          case works_btn :
                frmLabel = "Portfolio_frm";
                break;
            case about_btn :
                frmLabel = "About_frm";
                break;
            case contact_btn :
                frmLabel = "Contact_frm";
                break;
       }
         
       if (currentFrame != frmGoto)
       {
         
          var frmPortfolio:Number = this.getFrame("Portfolio_frm");
               
          gotoAndPlay(frmGoto);
       }
    }


    function getFrame(frameName:String):Number
    {
        var frame:Number = 1;

           for (var i = 0; i < currentLabels.length; i++)
        {
            if (currentLabels[i].name == frameName)
            {
                frame = currentLabels[i].frame;
                break;
            }
        }

        return frame;
    }

    Ahh! I'm sorry. I did it again (error code of purpose), and I think that the problem was:

    stage.frameRate = 30;

    I took it out and the notification of the error #1009 is gone! Don't know how or why he's done right! It is perhaps unnecessary coding?

    Thanks for your help if Kglad. Very appreciated

  • Preloader pls help

    Hi all I have a burning question that I really need an answer

    Basically, I have a preloader and I want it to load each section when it is called with this code:

    callback function///////////////////////////////////////////////////////////////////////////////// ///////////

    caps_mc.btn_continue_mc.addEventListener (MouseEvent.CLICK, nextpls);

    function nextpls(e:MouseEvent):void {}
    MovieClip (parent.parent) .nextSWF ("home page", parent);
    }

    the code above shows the preloader is finished with the home page and in the preloader, it should then load faq,

    but I get an error saying that nextSWF is not a function when it is clearly,

    It is even possible to use a preloader to load SWFs in this way?

    preloader///////////////////////////////////////////////////////////////////////////////// //////////////////////

    import flash.display. *;
    import flash.events. *;
    import flash.net.URLRequest;

    var loadedSWF:Loader
    var progressPercent:Number;

    function startLoad(SWFName:String):void {}
    loadedSWF = new Loader();
    loadedSWF.contentLoaderInfo.addEventListener (Event.COMPLETE, gameLoaded);
    loadedSWF.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, onProgressHandler);
    loadedSWF.load (new URLRequest (SWFName + ".swf"));

    }
    follow the progress
    function onProgressHandler(loadingProgress:ProgressEvent) {}

    var p: Number = loadingProgress.bytesLoaded/loadingProgress.bytesTotal;

    progressPercent = Math.round ((percent*100));
    preload_mc.gotoAndStop (progressPercent);
    preload_mc.myloadtext_txt. Text = (progressPercent + '%')
    preload_mc.myloadbar_mc. ScaleX = %;
    preload_mc.mc_mask. Height =(progressPercent * 3).
    preload_mc.ofBytes_txt. Text = loadingProgress.bytesLoaded + "bytes."
    preload_mc.totalbytes_txt. Text = loadingProgress.bytesTotal + "bytes."

    }

    function gameLoaded(e:Event):void {}

    removeChild (preload_mc);
    this.addChild (loadedSWF);

    loadedSWF.contentLoaderInfo.removeEventListener (Event.COMPLETE, gameLoaded);
    loadedSWF.contentLoaderInfo.removeEventListener (ProgressEvent.PROGRESS, onProgressHandler);
    }
    function nextSWF (whichSWFName, removeSWF) {}
    this.removeChild (removeSWF.parent);
    If (whichSWFName == "startPages") {}
    startLoad ("faq");
    }

    }
    startLoad ("startPages");

    ////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////

    Here is the error

    TypeError: Error #1006: nextSWF is not a function.
    at startPages_fla::MainTimeline/nextpls() [startPages_fla. MainTimeline::frame1:7]

    If anyone can help I would be very grateful, I'm hoping to be able to have a reusable preloader

    Thanks in advance

    fonzio

    is startPage() in frame 1 of the main timeline of your main swf?

    If so, what show the following trace():

    caps_mc.btn_continue_mc.addEventListener (MouseEvent.CLICK, nextpls);

    function nextpls(e:MouseEvent):void {}

    trace (MovieClip (parent.parent);
    MovieClip (parent.parent) .nextSWF ("home page", parent);
    }

  • HELP: Preloader and AS3 button

    Hi guys!

    I'm used to working on AS2 to make my animations, portfolios and buttons, but now that I had to use AS3 to make some forms interact with a PHP script.

    TextInputs and buttons on the COMPONENTS work and interact normally with PHP. My PreLoader works fine too. But what should the simpler does not: MY SIMPLE BUTTONS! It was so easy in AS1 and 2, but now on AS3 it does not work. I put all the codes and my action in a FRAMEWORK of ACTIONS at the top of my animation, but it does not work!

    I have my Preloader on my frame work 1, calling my animation on frame 2. The code is here (it works):

    Stop();

    addEventListener (Event.ENTER_FRAME, loading);

    function loading(event:Event) {}

    var stage.loaderInfo.bytesTotal = bytesTotal;

    var stage.loaderInfo.bytesLoaded = bytesLoaded;

    var sclbar = Math.round(bytesloaded*100/bytestotal);

    custom_animation.gotoAndPlay (sclbar);

    If (bytesloaded > = bytestotal) {}

    removeEventListener (Event.ENTER_FRAME, loading);

    removeChild (custom_animation);

    gotoAndPlay (2);

    }

    }

    Then I placed my actions to buttons on the frame 2.

    If I use the action:

    home_btn.addEventListener (MouseEvent.Click, clickHome);

    function clickHome(evt:MouseEvent):void {}

    gotoAndPlay (2) ;}

    release_btn.addEventListener (MouseEvent.Click, clickRelease);

    function clickRelease(evt:MouseEvent):void {}

    gotoAndPlay (2690) ;}

    My film breaks and no action is added to my buttons.

    I get this error: TypeError: Error #1009: cannot access a property or method of a null object reference.

    to index_Scene1_fla::MainTimeline/frame2()

    If I use the action:

    addEventListener ("addedToStage", OAS);

    function oas (ev) {}

    init();

    }

    home_btn.addEventListener (MouseEvent.Click, clickHome);

    function clickHome(evt:MouseEvent):void {}

    gotoAndPlay (2) ;}

    release_btn.addEventListener (MouseEvent.Click, clickRelease);

    function clickRelease(evt:MouseEvent):void {}

    gotoAndPlay (2690) ;}

    The movie plays full, but I get no action buttons and an error in my textinput and button components (they look like shake).

    I get this error: 1180: call to a method maybe not defined init.

    I tried to use import flash.display.SimpleButton too, but it does not work too.

    Could someone help me?

    Thank you

    Pedro

    You are welcome.  Remember that when you place the code in a frame, if this code is the target of objects then these objects must also be in the frame.

  • addFrameScript(); Help.

    Hello

    I have a Document class, to frame 1 of my FLA I'm loading background image. On the 2nd picture of my FLA I set the MovieClip in addFrameScript. its working fine... But in my document class, I have a function that is (stageResize). Can anyone tell me how I can use my addFrameScript (stageResize). Basically, I am trying to align my MovieClip with (stageResize) function... Help, please...

    Thank you...

    Document class...

    package com.ahmad.bg
    {
         //import all classes
         import caurina.transitions.Tweener;
         import flash.display.Loader;
         import flash.display.MovieClip;
         import flash.display.Sprite;
         import flash.display.StageAlign;
         import flash.display.StageDisplayState;
         import flash.display.StageScaleMode;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.net.URLRequest;
         import flash.events.ProgressEvent;
    
         public class MainClass extends MovieClip
         {
    
              private var loader:Loader;
              private static const IMAGE_PATH:String = "bgs/bg.jpg";
              public function MainClass()
              {
                   addFrameScript(1,botNav);
    
                   stage.align = StageAlign.TOP_LEFT;
                   stage.scaleMode = StageScaleMode.NO_SCALE;
                   stage.addEventListener(Event.RESIZE, stageResize);
    
                   loader = new Loader();
                   loader.load(new URLRequest(IMAGE_PATH));
                   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, showImage);
                   pic.addChild(loader);
                   loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preload_image, false, 0, true);
    
              }
              private function preload_image(event:ProgressEvent):void
              {
                   var percent = int((event.bytesLoaded / event.bytesTotal) * 100);
    
                   myloader.bar.scaleX = percent / 100;
                   myloader.bar.scaleY = percent / 100;
                   myloader.lpc.text = int(percent) + "%";
    
              }
              private function showImage(e:Event):void
              {
                   try
                   {
                        e.target.content.alpha = 0;
                        Tweener.addTween(e.target.content, { alpha:1, time:1, transition:"easeOutSine" } );
                        e.target.content.smoothing = true;
    
                   }
                   catch (e:Error)
                   {
                   }
                   myloader.visible = false;
                   stageResize();
                   nextFrame();
              }
              private function stageResize(e:Event=null):void
              {
                   pic.x = 0;
                   pic.y = 0;
                   pic.scaleX = pic.scaleY = 1;
    
                   if ((stage.stageHeight / stage.stageWidth) < pic.height / pic.width)
                   {
                        pic.width = stage.stageWidth;
                        pic.scaleY = pic.scaleX;
                   }
                   else
                   {
                        pic.height = stage.stageHeight;
                        pic.scaleX = pic.scaleY;
                   }
    
                   pic.x = stage.stageWidth / 2 - pic.width / 2;
                   pic.y = stage.stageHeight / 2 - pic.height / 2;
    
              }
              public function botNav():void
              {
                   bottomNav.x = stage.stageWidth / 2 - bottomNav.width / 2;
                   bottomNav.y = stage.stageHeight - bottomNav.height - 0;
                   
              }
         }
    }
    

    I want to set my botNav function with stageResize function.

    then use:

    package com.ahmad.bg
    {
         //import all classes
         import caurina.transitions.Tweener;
         import flash.display.Loader;
         import flash.display.MovieClip;
         import flash.display.Sprite;
         import flash.display.StageAlign;
         import flash.display.StageDisplayState;
         import flash.display.StageScaleMode;
         import flash.events.Event;
         import flash.events.MouseEvent;
         import flash.net.URLRequest;
         import flash.events.ProgressEvent;
    
         public class MainClass extends MovieClip
         {
    
              private var loader:Loader;
              private static const IMAGE_PATH:String = "bgs/bg.jpg";
              public function MainClass()
              {
                   addFrameScript(1,botNav);
    
                   stage.align = StageAlign.TOP_LEFT;
                   stage.scaleMode = StageScaleMode.NO_SCALE;
                   stage.addEventListener(Event.RESIZE, stageResize);
    
                   loader = new Loader();
                   loader.load(new URLRequest(IMAGE_PATH));
                   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, showImage);
                   pic.addChild(loader);
                   loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, preload_image, false, 0, true);
    
              }
              private function preload_image(event:ProgressEvent):void
              {
                   var percent = int((event.bytesLoaded / event.bytesTotal) * 100);
    
                   myloader.bar.scaleX = percent / 100;
                   myloader.bar.scaleY = percent / 100;
                   myloader.lpc.text = int(percent) + "%";
    
              }
              private function showImage(e:Event):void
              {
                   try
                   {
                        e.target.content.alpha = 0;
                        Tweener.addTween(e.target.content, { alpha:1, time:1, transition:"easeOutSine" } );
                        e.target.content.smoothing = true;
    
                   }
                   catch (e:Error)
                   {
                   }
                   myloader.visible = false;
                   stageResize();
                   nextFrame();
              }
              private function stageResize(e:Event=null):void
              {
                   pic.x = 0;
                   pic.y = 0;
                   pic.scaleX = pic.scaleY = 1;
    
                   if ((stage.stageHeight / stage.stageWidth) < pic.height / pic.width)
                   {
                        pic.width = stage.stageWidth;
                        pic.scaleY = pic.scaleX;
                   }
                   else
                   {
                        pic.height = stage.stageHeight;
                        pic.scaleX = pic.scaleY;
                   }
    
                   pic.x = stage.stageWidth / 2 - pic.width / 2;
                   pic.y = stage.stageHeight / 2 - pic.height / 2;botNav();           }
              public function botNav():void
              {if(bottomNav){                bottomNav.x = stage.stageWidth / 2 - bottomNav.width / 2;
                   bottomNav.y = stage.stageHeight - bottomNav.height - 0;
            }  
              }
         }
    }
    
    
  • Preloader works well in Explorer 8. NEED HELP!

    Hello

    I'm just starting to use flash.

    I designed a site flash with Flash CS4 and Actionscript 3.0.

    I use this simple preloader, basically, I learned from a tutorial:

    Stop();

    Preloader
    loaderInfo.addEventListener (ProgressEvent.PROGRESS, updatePreloader);

    function updatePreloader(evtObj:ProgressEvent):void
    {
    container for the progress of the site (download)
    var p: Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
    preloader_txt. Text = % + '% ';
    If (p == 100) {}
    nextFrame();

    }
    }

    Can someone please please help me to refresh correctly in explorer 8, such that it works well once, but if you refresh, it stops working and stays on 0%.

    All of this is the case, it is a number up to 100 percent, nothing complicated until I better learn Flash.

    If anyone can help.

    Thank you

    use:

    Stop();

    Preloader
    loaderInfo.addEventListener (ProgressEvent.PROGRESS, updatePreloader);

    {if(this.framesLoaded==This.totalFrames)}

    nextFrame();

    }

    function updatePreloader(evtObj:ProgressEvent):void
    {
    container for the progress of the site (download)
    var p: Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
    preloader_txt. Text = % + '% ';
    If (p == 100) {}
    nextFrame();
     
    }
    }

  • Swf loader help

    Hello all, I use Flash CS4 with AS3.


    I have a problem with the preloader site. When I simulate the load it is 'invisible' for awhile and then appear from loading of ~ 24-27% or perhaps ~ 55%
    To resolve this problem some people suggested to create a loader.swf (where you want to preload) and the site.swf: when the loader.swf have loaded the site.swf then it appear.


    Well, I tried this with the following code:

    var file:Loader=new Loader();
    var: path string.
    load.bar.scaleX = 0;

    run the preLoader (event: Event): void {}
    If (file.contentLoaderInfo.bytesTotal! = 0)
    {
    load.bar.scaleX = (file.contentLoaderInfo.bytesLoaded / file.contentLoaderInfo.bytesTotal);
    Load.txt_perc. Text = String (Math.round ((file.contentLoaderInfo.bytesLoaded/file.contentLoad erInfo.bytesTotal)*100))+"%";))
    }
    trace (file.contentLoaderInfo.bytesLoaded);
    }

    function stopLoader (event: Event): void {}
    trace ("Downloaded");
    file.removeEventListener (Event.ENTER_FRAME, preLoader);
    load.bar.scaleX = 0;
    Load.txt_perc. Text ="";
    }

    file.contentLoaderInfo.addEventListener (Event.COMPLETE, stopLoader);

    function loadMovie (): void {}
    load.bar.scaleX = 0;
    var swf:URLRequest = new URLRequest (path);
    leader. Load (SWF);
    file.addEventListener (Event.ENTER_FRAME, preLoader);
    stage.addChild (file);
    }

    function path1(e:Event):void {}
    path = "example.swf";
    loadMovie();
    }

    stage.addEventListener (Event.ENTER_FRAME, path1);


    But he returns this error:

    #2044 error: Unhandled IOErrorEvent:. Text = #2036 Error: incomplete loading.


    Someone told me that this error is due to the impossibility to find the URL of the swf file, but this is false since the swf file is finished.

    If I look at the load simulation I see multiple copies of the swf file are "loaded", but nobody is 100%.

    However, I said "responsible" because if I put a trace (file.contentLoaderInfo.bytesLoaded); I see a 0 permanent.


    Please help me I'm going crazy!

    where did,

    removeChild (file);

    come from?   which removes your swf loaded from the display list.  remove this line of code.

  • Help of preload. FLV

    I have a project where I need to preload a couple of .FLVs... There is only 1 per .swf... I imported them on stage for the contentPath FLVPlayback (wwms_video.flv) is defined in the components Inspector. I have already built a preloader for loading external .swfs and it works very well. Can someone help me to change the code so that it points to my FLVPlayback component instead of myLoader? THX!

    var mcLoader:MovieClipLoader = new MovieClipLoader();
    var myListener:Object = new Object();
    mcLoader.addListener (myListener);

    myListener.onLoadProgress = {function (target_mc, bytesLoaded, bytesTotal)}
    extLoader_mc._visible = true;
    _root.btnWebsite_btn._visible = false;
    var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
    extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
    If (bytesLoaded > = bytesTotal) {}
    extLoader_mc._visible = false;
    }
    }

    like almost everything in actionscript, use the name of the instance.  you create a loop (like enterframe) and when the loading is complete, start your flv (if that's what you want):

    flv.contentPath = whatever; If flv is the name of your component instance

    flv.autoPlay = false

    flv.onEnterFrame = preloadFLV;

    function preloadFLV() {}

    {if(FLV.bytesLoaded>0&&FLV.bytesLoaded>=FLV.bytesTotal)}

    delete flv.onEnterFrame;

    FLV. Play();

    }

    }

  • Please help: AS3 loading ChildNodes

    Good so I'll try to get my information from XML into movieclips called "button_1' - 'button_7' I have my XML ChildNodes showing in my window out when I export my swf.

    I used the xml class to load in an xml instance, so how can I assign the data to my clips.

    I had nothing else to extreme difficulties to get that much and I'm super stuck what to do next

    Here is my code so far:

    Stop();

    import flash.display. *;
    import flash.events. *;
    import flash.net.URLRequest;
    to import flash.net.URLVariables;
    var numOfImages = 90;
    var imgNum = 0;

    ImageLoad ("aboutus.jpg", holderClip, 0, 0);

    function ImageLoad (u: String, target, Ypos, Xpos)}
    preLoader.alpha = 100;
    var targetClip = target;
    var positionY = 175;
    var positionX = 112;
    var _loader:Loader = new Loader();
    var request: URLRequest = new URLRequest (u);
    _loader. Load (request);
    targetClip.addChild (_loader);
    targetClip.y = positionY;
    targetClip.x = positionX;
    _loader.contentLoaderInfo.addEventListener (ProgressEvent.PROGRESS, loadProgress);
    _loader.contentLoaderInfo.addEventListener (Event.COMPLETE, completeHandler);
    }

    function loadProgress(event:ProgressEvent):void {}
    var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
    percentLoaded = Math.round(percentLoaded * 100);
    preLoader.gotoAndPlay (percentLoaded);
    trace ("loading:" + percentLoaded + "%");
    }

    function completeHandler (event): void {}
    trace ("Done");
    preLoader.alpha = 0;
    }

    var myXML:XML;

    var myLoader:URLLoader = new URLLoader();
    myLoader.load (new URLRequest ("links.xml"));
    myLoader.addEventListener (Event.COMPLETE, processXML);
    function processXML(e:Event):void {}
    myXML = new XML (e.target.data);
    trace (myXML.*);
    }

    Any help I appreciate completely.

    See you soon-

    Graeme

    That's how I access to information in xml:

    http://www.vbforums.com/showthread.php?t=574389

  • Help with a problem of Preloader

    Hello world.
    I tried to set up a preloader .swf. I've tried three different "models". None of them work, but each preloader has the same 'Symptoms '. Each model uses a bar that grows as the .swf load and dynamic text that lists the percentage has been loaded.

    When I try the preloader, the loading bar appears, then the .jpg I am trying to load, and they continue to switch very quickly.

    I have three layers - shares (which has my actionscript in only 1 Forum), charger (has my load bar, boarder and text field in image 1) and the content layer (which gets .jpg in frame 2). My action script looks like this:

    Stop();
    this.addEventListener (Event.ENTER_FRAME, loading);
    function loading(e:Event):void {}

    var total: Number = this.stage.loaderInfo.bytesTotal;
    var loaded: number = this.stage.loaderInfo.bytesLoaded;

    bar_mc. ScaleX = loading/total;
    loader_txt. Text = Math.floor ((loaded/total) * 100) + "%";

    If (total == load) {}
    Play();
    this.removeEventListener (Event.ENTER_FRAME, loading);
    }
    }

    Anyone has any ideas that might help?

    Thanks in advance for any help.

    Brian

    Timothy and Webqaflash,
    Thank you both very much for taking the time to help. He works now (after I added the freeze frame two and made sure that everything was on the right layer.

    Thanks again.

    Brian

  • I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    I have a lg 4 k tv (40 "40UH630V TV LG ULTRA HD 4 K) with HDMI 2. 0 and if I buy apple tv 4 can be used with HDMI 2. 0 port or do I HDMI 3 port to use this? Please help me

    You can use it with your TV.

  • Need help to find an adapter for a third-party monitor

    Hi all! I find myself in need of a little guidance, and I hope that someone out there will have a quick n easy for me...

    I have a Mid-2011 27 'iMac. which has two ports Thunderbolt It is taken with a Wacom tablet that I use constantly, and the other is made by an external hard drive to a solid state, which has a built-in cable to Thunderbolt (no way to hang it on a different port). I also have a 27 "HP monitor that is currently connected via an HDMI USB adapter.

    The problem is that the HP monitor is actual "jiggy" - the USB does not seem fast enough to deal with requests for the monitor. It is almost unusable. I know I should run it via a HDMI adapter Thunderbolt, but as I have already mentioned the two my Thunderbolt ports are already in use.

    Someone at - it ideas? I need sort of three to two ports Thunderbolt hooks, but I can't seem to find anything for less than $300 that would work. (I am illiterate when it comes to the different cables, adapters, ports, etc., so I hope someone can point me in the right direction by using short words... Most of the products that I travel through list specifications that me Chicane).

    The monitor has two HDMIs and a VGA port, and my iMac has a Firewire 800 port, if that helps at all...

    2011 iMac have only 1 Thunderbolt port and there is no such thing as a Mid-2011, you must have an iMac of year later, if it has 2 ports Thunderbolt. All the 27 "iMacs, from 2012 to 2015 the current have 2 ports Thunderbolt.

  • Help with Safari!

    My macbook air from apple not to open the Web page like www.investing.com! Help! Different Web pages all okey, but it's not working!

    Works fine for me.

    What extension you have installed and activated?

    Do you have any adware installed on your MBA?

  • He can't change the region of my account! Help, please! Thank you ~ ~ ~

    Hello

    I want to change my account area. But I still balance ($0.02) so I couldn't change. Please delete my balance.

    Thank you!

    and now I can not contact the Apple Support it's always show

    We're sorry.

    We are unable to respond to your request at this time. Please try again or come back later.

    1c14bb55-ED82-4B43-9c22-fc79914a022c

    is could someone please help me contact the apple support to clear my balance or help me another way to change the region on my account please!

    Thank you!!

Maybe you are looking for