Preloader on frame 1

OK, so it's probably a stupidly simple fix, BUT - I fiddled with it for a few hours now and im getting no where...

I have my tween site in a chart (my logo), and then the preloader will appear...

the preloader is on frame 15 inside his own MC...

inside the MC is another MC named loadBar, and here is the code:

function loadProgress(root:ProgressEvent):void {}

var percent: number = Math.floor ((root.bytesLoaded*100)/root.bytesTotal);

loadBar.width = p 3;

}

function loadComplete(e:Event):void {}

loadBar.width = 300;

MovieClip (root) .gotoAndPlay ("begin");

}

loaderInfo.addEventListener (ProgressEvent.PROGRESS, loadProgress);

loaderInfo.addEventListener (Event.COMPLETE, loadComplete);

now, if you have the MC who has the preloader on frame 1, it works... but since its plot about 15, is not to do anything...

what I forget? im sure that this question is at the beginner level - help or direction is appreciated...

as always - thanks!

wr3ck

you're not out of luck.

There is no point to have a preloader appears long after everything is loaded.  You can use the following if it makes feel you better:

var t:Timer = new Timer (500,1);

t.addEventListener (TimerEvent.TIMER, f);

t.Start ();

function f (e: Event) {}

MovieClip (root) .gotoAndPlay ("begin");

}

function loadProgress(e:ProgressEvent):void {}

var p: Number = Math.floor ((e.bytesLoaded*100)/e.bytesTotal);

t.Stop ();

loadBar.width = % * 3;

}

function loadComplete(e:Event):void {}

loadBar.width = 300;

MovieClip (root) .gotoAndPlay ("begin");

}

this.parent.loaderInfo.addEventListener (ProgressEvent.PROGRESS, loadProgress); this.parent.loaderInfo.addEventListener (Event.COMPLETE, loadComplete);

Tags: Adobe Animate

Similar Questions

  • Preloader a frame. It's simple and foolproof

    Anyone?

    Theres 1 million preloader tutorials, none are simple and I'm yet to find one that works in a single frame at the beginning of my site.

    I'm new to Flash and need help!

    Preloader me up right nice

    in frame 1, use:

    stop the timeline to move forward beyond 1

    until the loading is complete:

    Stop();

    your preloader code:

    {this.onEnterFrame = function ()}

    var bl:Number=this.getBytesLoaded();

    var bt:Number=this.getBytesTotal();

    It is an essential part of your preloader.

    from there, you can do a number of things.

    for example:

    yourPreloaderTF.text=100*bl/bt+"% Loaded. If you have a textfield named yourPreloaderTF on stage

    and

    preloaderMC.fillMC._width = preloaderMC._width * bl/bt; If you have a movieclip preloaderMC with a fill to animate

    end of the optional display code

    Finally, you should put an end to this loop when

    has finished loading

    if(BL==BT) {/ / finished loading}

    end the loop

    delete this.onEnterFrame;

    advance to nextframe to view your app

    nextFrame();

    }

    }

  • Preloader for multiple external images

    Hello

    I am currently trying to solve this problem.

    I create a 360 turn important .png files in each video clip. I wanted the preloader bar increase in size like all loads.

    Once the preloader on frame one, I go and stop on frame 2, but there is a white screen for a second view. I think that the images were still loading once the preloader was completed.

    I tried the getBytesTotal getBytesLoaded fucntion, but did not work too well.

    Here is the code example:

    this.onEnterFrame = function()

    {

    preloader._alpha = 100;  Preloader

    done = 0;

    t = 0;

    for (i = 0; i < 24; i ++)

    {

    (" this["CAR_BASE_"+(i+1)].loadMovie("img/car_"+(i+1)+".png ");

    finished = ((i+1)/24) * 100;

    preloader._xscale = finished.

    }

    {if(Completed==100)}

    gotoAndStop (2);

    preloader._alpha = 0;

    this.onEnterFrame = null;

    }

    }

    You are welcome.

  • Preloader for xml image gallery

    Hello

    I'm kinda stuck to know where to start; I have created a photo gallery and I now have to add some functions preloader. The images are routed through XMLList etc... What I have in mind, I would like to display a preloader until all images are ready for display - not wanting to preload one individual images ;)

    Also I have a document in the SWF Gallery class, I believe that this can cause conflicts with attaching a preloader for frame 1 - I tried preloading the SWF gallery via a preloader.swf; the end result still leaves me having to provide a preloader in the swf Gallery.

    Can someone tell me the good examples, for me to agree with it. Any help would be really appreciated people ;)

    Kind regards

    Boxing boom

    You should load your images into the order, not at the same time, or you'll have a mess.  You can then display the approximate progress as load fraction:

    x / n + bl /(bt*n)

    where you have total n to load images, x of them have completely loaded, one is currently loaded (and is bl/bt charge).

  • Frames random load - Please Help!

    I need assistance with Actionscript 3.0. I want to have my flash file to jump to a random image number in my table. But when I test the movie, I have 12 error messages. Here is the code that I have on the first image:

    var frameStarters:Array = new Array (2,22,42)
    var fs:Number = Math.round ((Math.random () * (frameStarters.length - 1)));
    gotoAndStop (frameStarters [fs]);
    Stop();

    Help, please!

    Fixed. Thanks kglad!

    What happened was that I didn't have a preloader. So whenever he was going randomly to an image in my table, it would run out of time before the third image in my table. Thus, the above code works for "Random frames loading", but you also need a preloader on frame 1.

  • unexpected behavior when the button is clicked - &amp; quot; playhead &amp; quot; jumps to wrong frame

    I'm working on a flash site and I'm running on an actionscript issue that has me a little deadlock.

    The timeline main .fla is long of 42 images. Images 1-23 are the preloader, each frame between the 24-31 images contains one of the sections of the site, and frames 36-42 contain paragraphs of one of the main sections. 32-35 are empty frames just to help me keep things visually separated while I work on this project.

    I have a subnavigation for this paragraph of installation in frames 36-42. For each of the buttons in this sub navigation, I have attached a very simple actionscript that links to other pages of the paragraph. I used actionscript as I've mentioned below, where 'web' is in this case, the name of the image I'm aiming:
    on (release) {}
    gotoAndPlay ("web");
    }

    When I click on a link to take me to the last image, that is be named "specevents" (special events), it takes me to which frame correctly. If I click on the "specevents" button once again within this framework, I picked the preloader screen. This type of jump also happens in some of the other secondary navigation buttons, that is, by clicking on a link for a framework which I am already in will take me to a quite unexpected setting (always the same framework for each button, however).

    In fact, looking a bit more closely, I find whenever I click on one of the sub - nav links, I have to move an image. As part of the "specevents" is the last image, it brings back me to the first frame of the movie.

    It's all a bit strange for me, because apparently, I used the same method on the main navigation buttons, and they do not have something unexpected when you click it.

    FYI - the page in question here, can be found at: http://gravitygroup.com/testflashy/ the 'our work' section sub navigation, that's what I'm looking at.

    Any ideas? Thank you!

    AHA! figured it out. The problem is that I got my sub - nav buttons grouped together so I could move around as a unit. I have them removed, and everything works now!

    Thank you for taking the time to help!

  • Sound, but no video when the stream of a file quicktime by shock wave

    When I listen to a quicktime movie into the html file hosted on localhost using the Apache Server, I hear, but no video. I saved the film quicktime as part of my casting, linked to http://localhost/~username/mymovie.mov

    When I play the movie quicktime itself in my browser, or in a projector or just on a Director, the video and audio play simultaneously. But in the browser after you convert the film to dir to html and dcr file and by hosting files dcr and html on the server, when I open the html file in my browser, only the sound pieces. Anyone have similar problems? Any help would be appreciated!

    Hi guys,.

    Here are a few quick notes on how to handle shockwave videos with my projects.

    I tend to find that video in .swf format work better under all browsers using shockwave

    easiest way:

    You can make one lump in importing a .swf video directly in your casting. (without link)

    the problem with this is that it tends to create a large dcr file for your users to download

    "preloadnetthing" way:

    Download your videos on a site url - something like www.mywebsite.com/the_programs_title/dsmedia/videos/video1.swf

    (I never use capital letters or spaces)

    file - import - internet-

    This will add the file to the list add

    media value: link to the external file (do not use block import)

    Now press import

    When this Director will try to connect to your url - and downloadable the linked file test

    If it works you should now see a new Member related video casting added to your casting

    If it fails (which mine tend to make half the time?) - try it once again until it works.

    Here I normally find property of the related videos Inspector - and change its settings - I disables loop - and of course be sure preload is not defined.

    Now comes the part of code

    To get your videos to play properly, you will need to preload them in memory, before playing them.

    (although it is possible to videos - I have never been able to get it works well - there is a whole bunch of code lingo to treat streaming videos)

    a script for a video preload swf frame *.

    on beginSprite

    floatPrecision = 2

    tellStreamStatus (TRUE)

    global gVideosName

    the value TEMP "http://www.mywebsite.com/my_program/dswmedia/videos/" & gVideosName & ".swf".

    global mynetID

    Set mynetID = preloadNetThing (TEMP)

    Set the text of the cast of "preload_results" to "0%".

    end beginSprite

    on exitFrame

    floatPrecision = 2

    global mynetID

    pStatList = getStreamStatus (mynetID)

    If (pStatList.bytesSoFar > 0) then

    pPercentDone = (pStatList.bytesSoFar * 100) / pStatList.bytesTotal

    If pPercentDone > 99 then go THEN

    end if

    Set the cast text 'preload_results' ((la chaîne de pPercentDone) & '%"))

    go to loop

    end exitFrame

    a script in frame for playback of a swf video *.

    on beginSprite

    -I create a blank "placeholder" cast member (a black filled rectangle) the same size as my video, my staging - in sprite 1

    Set the visible of sprite 1

    the puppet of sprite 1 set to TRUE

    Global gVideosName - REM the name of my bound member video casting

    the value of the castNum of the sprite 1 cast gVideoName

    updateStage

    Sprite (1). Play()

    updateStage

    end beginSprite

    on mouseDown

    Sprite (1). Stop () - This stops playback of SWF movie!

    end mouseDown

    on keyDown

    Sprite (1). Stop () - This stops playback of SWF movie!

    end keyDown

    on exitFrame

    If .playing sprite (1) = false then

    Set to false to the puppet of the sprite 1

    go to "somewhere" - REM somewhere, you want to go after finishing the video.

    abandon.

    end if

    go to loop

    end exitFrame

  • 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

  • Slideshow w / timer, navigation problem (once clicked off calendar)

    I have an AS3 flash slide show that uses the timer with function wait() method to change the slides.  So is the preloader on frame one and the first slide is on frame two and the second slide is on three framework and so on.  To each frame, there is a wait statement (7) so that the swf file is progressing to the next section every seven seconds. When I create an element of nav uses the function gotoAndPlay to target each frame, whenever the net asset value is clicked and moves to the corresponding slide the timing of slides is all messed up.

    Can someone help me by suggesting a solution to this?  I may be nieve, but it seems that once you click on the button in the NAV the timer keeps going on the slide, the user was doing when a user has clicked on the net asset value.  How can I clear the Timer wait() on click?  When I add just a remove. EventListener to the service in the context button is not available for the button, although they are both in the same framework.

    Here's the wait() I use in the chronology of stage of root:

    function wait(duration:Number) {}

    Stop();

    var: timer = new Timer(duration*1000,1);

    timer.addEventListener (TimerEvent.TIMER_COMPLETE, onWaitTimerComplete);

    Timer.Start ();

    }

    function onWaitTimerComplete(e:TimerEvent):void {}

    e.target.removeEventListener (TimerEvent.TIMER_COMPLETE, onWaitTimerComplete);

    stage.removeEventListener (Event.RESIZE, onStageResize);

    Play();

    Here is the code for the click within the button movieClip:

    B1.addEventListener (MouseEvent.CLICK, onClick);
    function onClick (event: MouseEvent): void

    {
    MovieClip (root) .gotoAndPlay (2);
    }

    THIS PROJECT IS LOCAL SO NO LINK AVAILABLE

    Look like int the Timerclass to see what other methods you can make use of.  It has a reset() and stop() method that might get you what you want.  One thing you will probably need to do is have code so well to decalre the timer outside the service so that he carried outside the thaat service you can other functions control.

  • See the scene and start playing as soon as possible before loading

    I do a flash - now game, the swf file is 3 MB in size and will be probably much more important at a time where he did.

    I have code preloader on frame 1 to display a progress bar and animation who expected the movie to load.

    However, the site displays not the SWF file until it is almost fully charged at the time you will see the progress bar, is 75% or more.

    The preloader is not any sound or graphic, just a progress bar and the text field.

    Is there a way I can force th Web page to view the flash swf file and start playing as soon as the frame 1 is loaded rather than wait for the whole thing?

    I tried to create an external movie loader, but which causes problems with all the code I've written so far, and more I think that it is necessary that I can't do that I need to have only the SWF 1 and 2 is a no-no.

    Thank you

    don't put no matter what code on frame 1 and you swf will begin to play as soon as frame 1 loads completely.

  • Flex 3: showing a progress bar during the Application loading time

    Hello

    I have 3 end Flex before Application.

    Currently, at the beginning of the Application, its shows a blank white page.
    I want to have a progress bar on this effect.

    I saw this thing

    < mx:ProgressBar id = "progressBar" minimum maximum = "100" = "100" = "manual" mode
    Label = "5%" labelPlacement = 'bottom' x = '207' y = '299' >
    < / mx:ProgressBar >

    I saw an example of using ProgressBar with Image, providing the source of the image of the ProgressBar?

    Could any body please let me know as how to provide my < mx:Application > as a source for this
    ProgresBar.

    Help, please.

    Thank you.

    Here's a brand preloader component that I created that allows you to have the text and image in the proloader:

    ---com/stardustsystems/preloader/BrandedPreloader.as---

    package com.stardustsystems.preloader
    {
      import flash.display.DisplayObject;
      import flash.geom.Rectangle;
      import flash.text.TextField;
      import mx.graphics.RoundedRectangle;
      import mx.preloaders.DownloadProgressBar;
    
      public class BrandedPreloader extends DownloadProgressBar{
        private var _title:String = "DEFAULT APPLICATION TITLE";
        private var _titleObj:TextField;
        private var _titleX:Number = 80;
        private var _titleY:Number = 15;
        private var _titleWidth:Number = 165;
        private var _titleHeight:Number = 32;
        private var _titleTextColor:Number = 0xFFFFFF;
        private var _marquee:String = "DEFAULT MARQUEE";
        private var _marqueeObj:TextField;
        private var _marqueeX:Number = 80;
        private var _marqueeY:Number = 80;
        private var _marqueeWidth:Number = 165;
        private var _marqueeHeight:Number = 32;
        private var _marqueeTextColor:Number = 0xFFFFFF;
        private var _logoX:Number = 15;
        private var _logoY:Number = 15;
        private var _borderRectX:Number = 0;
        private var _borderRectY:Number = 0;
        private var _borderRectWidth:Number = 260;
        private var _borderRectHeight:Number = 120;
        private var _borderRectCornerRadius:Number = 4;
        private var _labelRectX:Number = 80;
        private var _labelRectY:Number = 55;
        private var _labelRectWidth:Number = 165;
        private var _labelRectHeight:Number = 16;
        private var _barRectX:Number = 80;
        private var _barRectY:Number = 72;
        private var _barRectWidth:Number = 165;
        private var _barRectHeight:Number = 6;
        private var _barRectCornerRadius:Number = 0;
        private var _barFrameRectX:Number = 80;
        private var _barFrameRectY:Number = 73;
        private var _barFrameRectWidth:Number = 165;
        private var _barFrameRectHeight:Number = 4;
    
        // The logo file should be in the same directory as this file.
        // Embed the logo file because using Loader is not efficient,
        //   because a Loader would load with the application, and we
        //   need it to load before the application, because it is
        //   displayed in the preloader.
        [Embed("SDSLogo1.png")]
        [Bindable] public var logoCls:Class;
        private var logoDO:DisplayObject;
        // Config file allowing configuration of various areas of the preloader.
        [Embed("config.txt", mimeType="application/octet-stream")]
        [Bindable] public var configCls:Class;
        private var configObj:Object;
        private var configProps:Object;
    
        public function BrandedPreloader(){
          super();
          // Load the config file.
          configObj = new configCls();
          // Parse the config property key/value pairs.
          configProps = getConfigProps(configObj.toString());
          // Apply the config properties.
          applyConfiguration();
        }
    
        private function applyConfiguration():void{
          if(configProps.title){
            _title = configProps.title;
          }
          if(configProps.marquee){
            _marquee = configProps.marquee;
          }
          if(configProps.titleX){
            _titleX = configProps.titleX;
          }
          if(configProps.titleY){
            _titleY = configProps.titleY;
          }
          if(configProps.titleWidth){
            _titleWidth = configProps.titleWidth;
          }
          if(configProps.titleHeight){
            _titleHeight = configProps.titleHeight;
          }
          if(configProps.titleTextColor){
            _titleTextColor = configProps.titleTextColor;
          }
          if(configProps.marqueeX){
            _marqueeX = configProps.marqueeX;
          }
          if(configProps.marqueeY){
            _marqueeY = configProps.marqueeY;
          }
          if(configProps.marqueeWidth){
            _marqueeWidth = configProps.marqueeWidth;
          }
          if(configProps.marqueeHeight){
            _marqueeHeight = configProps.marqueeHeight;
          }
          if(configProps.marqueeTextColor){
            _marqueeTextColor = configProps.marqueeTextColor;
          }
          if(configProps.logoX){
            _logoX = configProps.logoX;
          }
          if(configProps.logoY){
            _logoY = configProps.logoY;
          }
          if(configProps.borderRectX){
            _borderRectX = configProps.borderRectX;
          }
          if(configProps.borderRectY){
            _borderRectY = configProps.borderRectY;
          }
          if(configProps.borderRectWidth){
            _borderRectWidth = configProps.borderRectWidth;
          }
          if(configProps.borderRectHeight){
            _borderRectHeight = configProps.borderRectHeight;
          }
          if(configProps.borderRectCornerRadius){
            _borderRectCornerRadius = configProps.borderRectCornerRadius;
          }
          if(configProps.labelRectX){
            _labelRectX = configProps.labelRectX;
          }
          if(configProps.labelRectY){
            _labelRectY = configProps.labelRectY;
          }
          if(configProps.labelRectWidth){
            _labelRectWidth = configProps.labelRectWidth;
          }
          if(configProps.labelRectHeight){
            _labelRectHeight = configProps.labelRectHeight;
          }
          if(configProps.barRectX){
            _barRectX = configProps.barRectX;
          }
          if(configProps.barRectY){
            _barRectY = configProps.barRectY;
          }
          if(configProps.barRectWidth){
            _barRectWidth = configProps.barRectWidth;
          }
          if(configProps.barRectHeight){
            _barRectHeight = configProps.barRectHeight;
          }
          if(configProps.barRectCornerRadius){
            _barRectCornerRadius = configProps.barRectCornerRadius;
          }
          if(configProps.barFrameRectX){
            _barFrameRectX = configProps.barFrameRectX;
          }
          if(configProps.barFrameRectY){
            _barFrameRectY = configProps.barFrameRectY;
          }
          if(configProps.barFrameRectWidth){
            _barFrameRectWidth = configProps.barFrameRectWidth;
          }
          if(configProps.barFrameRectHeight){
            _barFrameRectHeight = configProps.barFrameRectHeight;
          }
        }
    
        private function getConfigProps(configStr:String):Object{
          var retVal:Object = new Object();
          var linesArray:Array = configStr.match(/".*"/g);
          for each(var line:String in linesArray){
            line = line.substring(1,line.length-1);
            if(line != "0"){
              var parts:Array = line.split("$$$");
              if(parts.length==2){
                retVal[parts[0]] = parts[1];
              }
            }
          }
          // trace for debugging
          for(var key:String in retVal){
            //trace("key: " + key);
            //trace("value: " + retVal[key]);
          }
          return retVal;
        }
    
        override protected function createChildren():void{
          super.createChildren();
          // Attach the logo image.
          logoDO = new logoCls();
          logoDO.x = (stageWidth/2)-(borderRect.width/2)+_logoX;
          logoDO.y = (stageHeight/2)-(borderRect.height/2)+_logoY;
          addChild(logoDO);
    
        // Attach the title TextField.
        _titleObj = new TextField();
        _titleObj.x = (stageWidth/2)-(borderRect.width/2)+_titleX;
        _titleObj.y = (stageHeight/2)-(borderRect.height/2)+_titleY;
        _titleObj.width = _titleWidth;
        _titleObj.height = _titleHeight;
        _titleObj.selectable = false;
        _titleObj.defaultTextFormat = super.labelFormat;
        _titleObj.htmlText = _title;
        _titleObj.multiline = true;
        _titleObj.wordWrap = true;
        _titleObj.textColor = _titleTextColor;
        this.addChild(_titleObj);
      // Attach the marquee TextField.
        _marqueeObj = new TextField();
        _marqueeObj.x = (stageWidth/2)-(borderRect.width/2)+_marqueeX;
        _marqueeObj.y = (stageHeight/2)-(borderRect.height/2)+_marqueeY;
        _marqueeObj.width = _marqueeWidth;
        _marqueeObj.height = _marqueeHeight;
        _marqueeObj.selectable = false;
        _marqueeObj.defaultTextFormat = super.labelFormat;
        _marqueeObj.htmlText = _marquee;
        _marqueeObj.multiline = true;
        _marqueeObj.wordWrap = true;
        _marqueeObj.textColor = _marqueeTextColor;
        this.addChild(_marqueeObj);
        }
        // Determines the dimensions of the large rectangle for the preloader.
        override protected function get borderRect():RoundedRectangle{
          return new RoundedRectangle(_borderRectX, _borderRectY, _borderRectWidth, _borderRectHeight, _borderRectCornerRadius);
        }
        // Determines the dimensions of the rectangle for the "loading..." and "initializing..." string.
        override protected function get labelRect():Rectangle{
          return new Rectangle(_labelRectX, _labelRectY, _labelRectWidth, _labelRectHeight);
        }
        // Determines the dimensions of the rectangle for the preloader bar.
        override protected function get barRect():RoundedRectangle{
          return new RoundedRectangle(_barRectX, _barRectY, _barRectWidth, _barRectHeight, _barRectCornerRadius);
        }
        // Determines the dimensions of the frame rectangle for the preloader bar.
        override protected function get barFrameRect():RoundedRectangle{
          return new RoundedRectangle(_barFrameRectX, _barFrameRectY, _barFrameRectWidth, _barFrameRectHeight);
        }
      }
    }
    

    ---com/stardustsystems/preloader/config.txt---

    # Comments in this file should start with #
    # Entries in this file should be formatted as follows:
    #    - enclose entries in standard double-quotes (not locale specific double-quotes)
    #    - do not use double quotes within the entries (use single quotes)
    #    - entries are key/value pairs, with key and value separated by $$$
    #    - keys and values can only contain characters in ISO-8859-1 (English and latin characters)
    # The file should be saved in Windows ansi encoding. To support characters in other
    #   character sets, further enhancement is necessary.
    # config properties for the application title string
    "title$$$Image Browser"
    "titleX$$$80"
    "titleY$$$15"
    "titleWidth$$$165"
    "titleHeight$$$32"
    "titleTextColor$$$0xFFFFFF"
    # config properties for the application marquee string
    "marquee$$$Stardust Systems Application"
    "marqueeX$$$80"
    "marqueeY$$$80"
    "marqueeWidth$$$165"
    "marqueeHeight$$$32"
    "marqueeTextColor$$$0xFFFFFF"
    # config properties for the logo x and y
    "logoX$$$15"
    "logoY$$$15"
    # config properties for the border rectangle
    "borderRectX$$$0"
    "borderRectY$$$0"
    "borderRectWidth$$$260"
    "borderRectHeight$$$120"
    "borderRectCornerRadius$$$4"
    # config properties for the label rectangle
    "labelRectX$$$80"
    "labelRectY$$$55"
    "labelRectWidth$$$165"
    "labelRectHeight$$$16"
    # config properties for the preloader bar rectangle
    "barRectX$$$80"
    "barRectY$$$72"
    "barRectWidth$$$165"
    "barRectHeight$$$6"
    "barRectCornerRadius$$$0"
    # config properties for the preloader bar frame rectangle
    "barFrameRectX$$$80"
    "barFrameRectY$$$73"
    "barFrameRectWidth$$$165"
    "barFrameRectHeight$$$4"
    

    -BrandedPreloader.mxml-

    
    
      
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
      
        
          
          
          
        
      
    
    

    ----------------- states.xml -----------------

    
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    
    

    If this post answers your question or assistance, please mark it as such. Thank you!

    http://www.stardustsystems.com
    Adobe Flex development and Support Services

  • Empty MC plays not mp4 no external

    Before playing the mp4 I set preloader in frame 1 place

    to preload the movie and play in frame 3.

    myLoaded = Math.round (getBytesLoaded ());
    myTotal = Math.round (getBytesTotal ());
    myLoaded/myTotal = myPercent;
    If (myLoaded == myTotal) {}
    gotoAndStop (3);
    } else {}
    gotoAndPlay (1);
    }

    I have an empty clip mc that uses this code to call in an external mp4 (image 3) HD video:

    var loader: MovieClipLoader = new MovieClipLoader();
    this.createEmptyMovieClip("emptyMC",1);
    loader.loadClip ("Yes we different.mp4", emptyMC);

    When tested with the mp4 or one of these work items.

    Can I use this method to play the mp4 video or I have to convert it to another format?

    If your mp4 is not displayed properly (or), you have a mp4 frame that is not correct.

    I'm not an expert in the video settings, but I would like to know the correct settings using google to search for: flash mp4 settings.

  • Flash animation does not correctly load in Internet Explorer only

    I have a simple flash animation which through text and pictures. I have a (AS3) preloader on frame 1, which sends the playhead to the frame 2, once the film is loaded 100%. For some reason, in Internet Explorer, the preloader bar will load completely, but fail to move the playhead to the frame 2, so it will just stay here with prestressing bar to 100%. However, this does not happen every time. For example, at the present time, the flash animation will play when I initially on the site, but when I click on another page, the same flash header (same swf on each page) just goes to show the preloader bar but will not play the rest of the film. Didn't help not reload the page. Close the browser and reopen it don't help. Clearing the cache of the browser did not help either. Thus, the flash animation will play correctly on the first page of the site I'm going to (be it the home page or another page) but then when I go to any other page that has flash animation, he won't play, he's there with the preloader bar showing. And then when to return to the original page, I entered the site, the flash movie play there anymore, either. I have not seen this problem in another browser than Internet Explorer (6 and 7). I checked in Firefox on Mac and PC and Safari on Mac. I use flash player 10.0.22.87 on my Mac and PC. The flash animation was made in Flash CS3, flash player 9, actionscript code 3.

    So to see the problem, here in Internet Explorer: http://demo.matthewpavkov.com/adairsolar . Wait for the movie to load and start playing. This works. Then go to one of the other pages and you will see that the same swf will not play. Go to the homepage, the swf file does not play.

    Here is the preloader code:

    import flash.display.*;
    this.stop();
    
    this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
    
    function PL_LOADING(event:ProgressEvent):void {
        var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
        lbar.scaleX=pcent/100;
        lpc.text=int(pcent)+"%";
        if (pcent>=100) {
            this.gotoAndStop(2);
        }
    }
    

    , If I remove the preloader ActionScript flash animation plays correctly. You can see it here: http://demo.matthewpavkov.com/adairsolar/no-preload

    The .fla is available for those who want to take a closer look.

    mjjp,

    Can just that in IE, the ProgressEvent never triggers - because your content is already cached.  See what happens if you add the following lines again (end of the sample code):

    this.stop();
    
    this.loaderInfo.addEventListener(  ProgressEvent.PROGRESS, PL_LOADING);function PL_LOADING(event:ProgressEvent):void {  var pcent:Number=event.bytesLoaded/event.bytesTotal*100;  lbar.scaleX=pcent/100;  lpc.text=int(pcent)+"%";  if (pcent>=100) {    this.gotoAndStop(2);  }}if (this.loaderInfo.bytesLoaded >= this.loaderInfo.bytesTotal) {  this.gotoAndStop(2);}
    

    See what's happening?  In this way, even the Manager ProgressEvent never triggers, you always compare the bytesLoaded, bytesTotal property property.

    David Stiller
    Adobe Community Expert
    Dev blog, http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Preloader: part 1 stop, on 100% goto frame 2 (AS2)

    Hi all

    at first, I thought I could handle myself looking for "preloader" forums, but none of the solutions seem to work. I think it has to do with the fact that I use the FLVPlayer with an external file.

    What I'm looking for?

    1. well, the preload setting 1 code that ensures that external F4V (movie.f4v in the same directory) is charged to 100% before it jumps to frame 2, where the movie should start playing...

    2. If possible, a progress bar.

    I will continue to try, but I'm afraid, I need your help because I can't make it work...

    Thank you all!

    use:

    Stop()

    var OL: Object = new Object();
    Lo.Progress = {function(eo:Object):Void}
    use eo.bytesLoaded and eo.bytesTotal for your progress bar

    {if(EO.bytesLoaded==eo.bytesTotal)}

    gotoAndStop (2);

    }
    };
    flv.addEventListener ('progress', lo);
    FLV. Load ("yourvid. F4V");

  • Preload a number of frames instead of the whole movie?

    So, I have a movie containing the content I want to preload. I did the pre-loader and it works fine, but it might be easier for the user. Because the movie is enough long term, I think that its good enough if I load that say the first 35% of the movie and let the other 65% download while the user watches the first 35%. Is it possible that I can change my script to preload for it to say something like: "load content executives from 10 to 200, play 10 '.»

    Preload AS2 code is as follows:

    Stop();

    rectMask_mc._height = 1;

    this.onEnterFrame = function (): Void {}

    var loadedData:Number = this.getBytesLoaded ();

    var allData:Number = this.getBytesTotal ();

    var p: Number = Math.round(loadedData/allData*100);

    rectMask_mc._yscale = %;

    If (loadedData > = allData) {}

    gotoAndPlay (10);

    delete this.onEnterFrame;

    }

    };

    Any advice / suggestions?

    Thank you!

    :

    Stop();

    rectMask_mc._height = 1;

    this.onEnterFrame = function (): Void {}

    var loadedData:Number = this.getBytesLoaded ();

    var allData:Number = this.getBytesTotal ();

    var p: Number = Math.round(loadedData/allData*300);

    rectMask_mc._yscale = %;

    If (loadedData * 3 > = allData) {}

    gotoAndPlay (10);

    delete this.onEnterFrame;

    }

    };

Maybe you are looking for