Pre-loading the next swf

Guys,
i gonna tell the situation from the very beginning:
I'm doing a book, wich each chapter is separated by swf (chapter_1.swf, chapter_2.swf, etc).
In the final of each swf, he calls the next by the command: _root.loadMovie("next.swf")
(PS: i'm not using the MovieClip load method)
The problem is; when the swf are uploaded on my server, and i click to load the next swf, my screen goes blank while he download it.
All i want to do, is pre-load the next swf, while the user is reading the actual chapter, to avoid this blank screen time. Is it possible?
I read something about getBytesLoaded/Total, but don't know how to execute it.
Please explain it clear cuz i'm new with this. And thank you very much for the support!

If you want to have information regarding the loading progress of a file then you need to use the MovieClipLoader class.
If you search Google you should be able to find a tutorial using search terms like "AS2 MovieClipLoader tutorial"

Similar Messages

  • How syncronize with the data base after pre-loading the data

    Hi,
    I have pre-loaded the data from the database table into the cache.
    If the key is not found in the cache i want to it to connect to database and get the value from the table. How to achieve this?

    Hi JK,
    I have pasted my cache loader code, config file and the main class in the other post but i m not sure what is the issue with it. Its not working. Please can you tell me what might be the issue with that piece of code. I m not getting any exception either but the load() or loadAll() method is not at all getting triggered on invoking cache.get() or cache.getAll() method. What might be the cause for this issue?
    Can you give me the coherence-cache-config.xml contents?
    I m not sure whether its the issue with the config file because i have read some where that refreshaheadfactor is required to trigger the loadAll() method.
    Edited by: 943300 on Jul 4, 2012 9:57 AM

  • Pre-loading the cache

    I'm attempting to pre-load the cache with data and have implemented controllable caches as per this document (http://wiki.tangosol.com/display/COH35UG/Sample+CacheStores). My cache stores are configured as write-behind with a 2s delay:
    <cache-config>
         <caching-scheme-mapping>
         <cache-mapping>
              <cache-name>PARTY_CACHE</cache-name>
              <scheme-name>party_cache</scheme-name>
         </cache-mapping>
         </caching-scheme-mapping>
         <caching-schemes>
              <distributed-scheme>
                <scheme-name>party_cache</scheme-name>
                <service-name>partyCacheService</service-name>
                <thread-count>5</thread-count>
                <backing-map-scheme>
                    <read-write-backing-map-scheme>
                         <write-delay>2s</write-delay>
                        <internal-cache-scheme>
                            <local-scheme/>
                        </internal-cache-scheme>
                        <cachestore-scheme>
                            <class-scheme>
                                <class-name>spring-bean:partyCacheStore</class-name>
                            </class-scheme>
                        </cachestore-scheme>
                    </read-write-backing-map-scheme>
                </backing-map-scheme>
                <autostart>true</autostart>
            </distributed-scheme>
         </caching-schemes>
    </cache-config>
    public static void enable(String storeName) {
            CacheFactory.getCache(CacheNameEnum.CONTROL_CACHE.name()).put(storeName, Boolean.TRUE);
    public static void disable(String storeName) {
            CacheFactory.getCache(CacheNameEnum.CONTROL_CACHE.name()).put(storeName, Boolean.FALSE);
    public static boolean isEnabled(String storeName) {
            return ((Boolean) CacheFactory.getCache(CacheNameEnum.CONTROL_CACHE.name()).get(storeName)).booleanValue();
    public void store(Object key, Object value) {
            if (isEnabled(getStoreName())) {
                throw new UnsupportedOperationException("Store method not currently supported");
        }The problem I have is that what seems to be happening is:
    1) bulk loading process calls disable() on the cache store
    2) cache is loaded with data
    3) bulk loading process calls enable() on the cache store ready for normal operation
    4) the service thread starts to attempt to store the data as the check to see if the store is enabled returns true because we set it to true in step 3
    so is there a way of temporarily disabling the write-delay or changing it programatically so step 4 doesn't happen?

    Adding
    Thread.sleep(10000);after loading the data seems to solve the problem but this seems dirty, any better solutions?

  • Pre-loading the Cache from Database during application start-up

    We are using Spring, Hibernate, Oracle Coherence 3.5.2 Weblogic Webservices
    Our requirement is to pre-load the cache during the application start-up most probably during Authentication/Authorization Service is invoked.
    We plan to load the data for other services from database into Coherence cache so that whenever user access that particular service he ends up hitting the Cache instead of database.
    We would greatly appreciate sample code snippets on how to write CacheInitializerBean with marker to demonstrate the state of cache.

    Hi Rob,
    Thanks for pointing to the article: Pre-Loading the Cache
    In fact i already looked at that article before posting. It just mentions how to load the data from database into Cache.
    What i am looking for is how to make this happen during application start-up. This is my first hurdle.
    The second one is as mentioned in the article http://coherence.oracle.com/display/COH35UG/Pre-Loading+the+Cache
    i wrote following code which never gets populated into cache. Not sure whats going wrong even though i see Hibernate loadAll() method loading all the objects in the console
    public   void populateCache() throws SQLException
        Map<Long, Object>  buffer = new HashMap<Long, Object>();
        int count = 0;
         List<Contract> contractList = this.getHibernateTemplate().loadAll(Contract.class);
         log.debug("contractList size="+contractList.size());
         for(Contract contract : contractList)
             Long key   = new Long(contract.getId());
             Object  value = contract;
             buffer.put(key, value);
             // this loads 1000 items at a time into the cache
             if ((count++ % 1000) == 0)
                  contractCache.putAll(buffer);
                 buffer.clear();
         if (!buffer.isEmpty())
              contractCache.putAll(buffer);
        }We would greatly appreciate your time in helping us resolving two hurdle blocks.

  • Pre-load the Cache during Application-Start Up

    Our requirement is to pre-load the cache during the application start-up most probably during Authentication/Authorization Service is invoked.
    We plan to load the data for other services from database into Coherence cache so that when user access that particular service he ends up hitting the Cache instead of database.
    Any pointers/suggestions on how to pre-load the cache during application start-up would be greatly appreciated. We are using Spring, Hibernate, Weblogic Web Services
    Regards,
    Bansi

    Hi Bansi,
    I were using following approach.
    First, we never use CacheFactory.getCache() in application code instead all instances of named cache were injected.
    On server side, I have an CacheInitializerBean which were starting cache preloading process (in separate thread). After preloading a special marker entry were put to the cache, indicating what data in the cache are consistent.
    When injecting named cache instance, we use a factory. This factory use CacheFactory.getCache() internally, but it check presence of marker object in cache an blocks until marker object will appear.
    Well in practice things are little more complicated but this is basic idea.
    Preload cache asynchronously and use marker to indicate completion of loading process.
    Hope this will help.
    Regards,
    Alexey

  • LoadMovie for automatically playing the next SWF file?

    If I published several separate SWF files from several FLA files (because they were too large to work in one FLA document) is there a way to play them automatically one after the other? I looked online and somebody suggested www.swfmerge.com but I couldn't find anything there to help me.
    I tried placing on the last frame of each FLA file the action
    loadMovie but I don't know how to define it so that once one SWF file is done, the next one starts.
    I just open the SWF with explorer on windows so that I can view them full screen (they are for a slide presentation, architecture and I am showing a little bit of animation)
    Can anybody help?
    Thank you in advance.

    The Best practice is to give a relative path, that way the path will also function if you upload it to a website, or on another computer, be it Mac or PC. Copy all your slides to the same folder as your presentation and then simply add the name of the slide (e.g. slide1.swf) in the contentPath property.

  • How can I pre-load the Flash on my page?

    I added Flash navigation to my HTML site. Whenever I click on
    a link, the Flash has to reload on every new page, so it takes a
    second longer to appear. Otherwise it works ok... this is just kind
    of annoying. Is there any way around this?

    load the HTML into an iframe.

  • Aperture very slow loading the next image...

    OK, I've trawled the forums but I can't find a specific answer.
    Firstly, I'm using a low spec iMac (2007 2.4GHz C2D with 4GB RAM, Radeon HD 2600 - 256MB VRAM on 10.8.2) but I'm not convinced this is the issue.
    When I navigate through photos (Sony Alpha and Canon EOS RAW) there's a major delay of up to 20 seconds when the image shows "Loading" with a spining gear wheel-thing (not a colour wheel).  The delay is worse on the 17Mpixel Canon files.
    I've check what the activity monitor is doing during this and the memory seems fine, I still have over 1GB free and no pages in/out or RAM activity of any kind.  The CPU goes ballistic - 180% on Aperture - it's really working.  Given the file size/delay difference, I'm assuming the image is being generated with adjustments composited etc.
    I thought the previews were supposed to address this by providing a cached image so my question is; is there any way of checking the previews are being accessed?  I've deleted the previews from a selection, re-generated using a couple of size setting in prefs, they've been generated but still no speed-up.
    I've also done a permissions repair both in disk utility and cmd-option launch of Aperture. No difference.
    Thanks for any help in advance, Dave

    I've also done a permissions repair
    If you have a corrupted library the permission repair alone may not suffice. Have you also repaired or rebuild the library?
    Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual
    if that does not help, check, if you have incompatible video codecs installed:
    Aperture 3: May be unresponsive or have slower performance with third-party video codec
    Regards
    Léonie

  • Unable to load next swf file in the browser.

    Hi,
    Im facing problem while loading the next swf file in the
    browser.
    I have divided my files and named it as 1.swf, 2.swf, and so
    on and i wrote the script 4 calling next swf.
    It is working when i called thru HTML in local system. When i
    upload into my server and called thru php, next file is not
    loading.
    Code in the button : :
    on (release)
    { loadMovie("2.swf", 0);
    Any ideas or suggestion?
    Help would be appreciated.
    thnq.

    I'd suggest looking that these notes
    1045941 - HTTP Client: Incorrect request URI II
    Note 1144511 - Blank screen when starting CRM WebClient or IC WebClient
    1244321 - Simplifying error analysis in CRM WebClient UI
    1242835 - IDES CRM 2007
    1168941 - Simplifying system setup  
    612670 - SSO for local BSP calls using SAP GUI HTML Control

  • Load second external swf after first is done?

    Hello,
    I have a main movie with a blank mc to hold my 2 external
    swf's. I load the first swf, things are fine. When it ends I'd like
    to load the 2nd swf into the same blank mc. Anybody have a solution
    or point me to a good tutorial?
    Thanks in advance.
    Pharaoh

    Here is the code:
    //this section is a preloader for the external swf
    var mcl:MovieClipLoader = new MovieClipLoader();
    var mclL:Object = new Object();
    mclL.onLoadProgress = function(target,loaded,total) {
    loader.percent.text = Math.round((loaded/total) * 100) +
    mclL.onLoadInit = function() {
    loader._visible = false;
    loader.percent.text = "";
    mcl.addListener(mclL);
    //the line below loads and plays the swf
    mcl.loadClip("wtts_spotlight.swf",holder);
    The way I have it working now is that I have actionscript at
    the end of the first swf telling the main movie to load the next
    swf in the blank mc:
    stop();
    _root.holder.loadMovie("NewZoo_Spotlight.swf", 1);
    I then repeat this code in the last frame of the
    "NewZoo_Spotlight.swf" but tell it to load the first swf again,
    thus creating the loop:
    stop();
    _root.holder.loadMovie("wtts_spotlight.swf", 1);
    This all works well but there has to be a way to do it so all
    actionscript is contained in frame one of the main movie, right?
    Thanks.

  • Adding a pre loader to an XML photo gallery between the photos.

    Hey,
    I have made a photogallery in actionscript 3 which uses an .XML file to import pictures. As the user clicks on the displayed image the code loads the next image in the cycle into the display. Now, I would like to add a preloader which displays the loading progress of each image as the user clicks (otherwise there is just a blank area as the image loads). I have made a pre-loader for the main .SWF but I can't figure out how to make it work for the images or how to make a seperate one for the images. The fact is that I am a bit of a muppet when it comes to AS3, and am finding myself getting lost an confused quite easily.
    I have attatched the .FLA if that helps any! If not then...
    here is the link to the .HTML page that contains the .swf:
    http://www.davidframpton.co.uk/portfolio.html
    Here is the code I am using for the main pre-loader held in frame 1:
    stop();
    addEventListener(Event.ENTER_FRAME, loaderF);
    function loaderF(e:Event):void {
        var toLoad:Number = loaderInfo.bytesTotal;
        var loaded:Number = loaderInfo.bytesLoaded;
        var total:Number = loaded/toLoad;
        if(loaded == toLoad) {
            removeEventListener(Event.ENTER_FRAME, loaderF);
            gotoAndStop(2);
        } else {
            preloader_mc.preloaderFill_mc.scaleX = total;
            preloader_mc.percent_txt.text = Math.floor(total * 100) + "%";
    And here is the code for the photogallery:
    stop();
    var xmlRequest:URLRequest = new URLRequest("http://www.davidframpton.co.uk/galleryData.xml");
    var xmlLoader:URLLoader = new URLLoader (xmlRequest);
    var imgData:XML;
    var imageLoader:Loader;
    var rawImage:String;
    var rawH:String;
    var rawW:String;
    var imgNum:Number = 0;
    var checkSec:Timer = new Timer(100);
    var numberOfChildren:Number;
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
    master_mc.addEventListener(MouseEvent.CLICK, nextImgF);
    master_mc.buttonMode = true;
    function xmlLoadedF(event:Event):void{
        checkSec.start();
        checkSec.addEventListener(TimerEvent.TIMER, checkerF);
        imgData = new XML(event.target.data);
    function packagedF():void{
        checkSec.removeEventListener(TimerEvent.TIMER, checkerF);
        rawImage = imgData.image[imgNum].imgURL;
        numberOfChildren = imgData.*.length();
        imageLoader = new Loader;
        imageLoader.load(new URLRequest(rawImage));
        master_mc.addChild(imageLoader);
    function checkerF(event:TimerEvent):void{
        if (imgNum == 0) {
            packagedF();
        }else if(imgNum < numberOfChildren){
            imageLoader.unload();
            packagedF();
        }else {
            imageLoader.unload();
            imgNum = 0;
            packagedF();
    function nextImgF(event:MouseEvent):void {
        checkSec.addEventListener(TimerEvent.TIMER, checkerF);
        imgNum++;
    I would really appreciate any help. Even if your could guide me to where I can learn how to do this myself in an simple fashion, I would be greatful.
    Thanks in advance
    Dave

    The Loader class has a contentLoaderInfo property that is a LoaderInfo class object.  You can assign an event listener to the contentLoader Info that listens for PROGRESS.  There is an example in the Loader class section that shows the contentLoaderInfo property being used for a variety of event detections, including PROGRESS.

  • How to call next .swf and close the previous?

    Hi guys,
    i'm having a big trouble using the loadMovie command.
    I want to do a book and at the end of each chapter the next button will appoint to the next .swf ,but the previous has to disappear.
    At moment, i created a empty movieclip named "load" in ALL .flv files ..he stands for all the time line. But when i advance to the next swf, it loads above the previous file, accumulating the files one above the other.
    Here is the AS what i'm using in the last frame of my flv:
    stop();
    next_btn.onRelease = function(){
              loadMovie("next_file.swf",load);
    prev_btn.onRelease = function(){
              gotoAndStop(previous_page_frame)
    So.. all i want to do is create a sequence: file 1 calls file 2 and close file 1
    ..and have the option to return to the previous file when i want: in the first frame of the file 2, the previous button will appoint to the file 1.
    Any ideas? Thanks so much

    yes.
    you would need to use preloader code (ie, start a loop like enterframe and check the _framesloaded property of the load-target movieclip) to ensure the needed frame is loaded and then use a goto applied to the load-target movieclip.
    however, there's no way to do that if you continue to use code like this.loadMovie().

  • How to load the xml from swf

    Hi,
    I have one intro.swf from that am loading one interface.swf by using loader.In interface i am loading some of the swf and xml am getting the swf but the xml files are not loading.When i run from interface file it is loading fine. only when i load the intro file the xml files are not loading. can any one tell me what is the problem how to access the xml content.
    This is the code am using in interface.swf to to get the xmlpath
    MovieClip(root).param1 = xmlPath;
    to access the xml content i have written the code
    var xmlPath:String=MovieClip(stage.getChildAt(0)).param1;
    I am using one moviclip in interface to load the other swf and xml. I am not using any moviclip in intro file to load the interface swf for that i am using only the loader.

    Where are the files located relative to each other?  If the intro and interface are in different folders then the problem could be that you need to adjust the path the interface uses for targeting the files it loads.

  • How can I turn off inherent features of Firefox? (Specifically, it automatically loads and displays the next page, but it will load OVER the current page)

    With this version of Firefox, it automatically loads the 'next' page. When I'm reading blogs, when I click to go back, it automatically loads the first page of the blog as the 'next' page I want to go to. However, it will load this page OVER the page I am on, so that I cannot see it. With some blogs, it is so extreme, I cannot use Firefox on them at all. This isn't an add-on or anything, and I cannot find it in the preferences panel. Can I turn it off somehow/is there a way to in Firefox 4?

    That is not standard behavior. You may have installed an extension that causes it.
    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • Loading an external swf and unloading the parent one

    Hi there i have made a navigation in flash and 3 buttons that load some external swf's. Problem is that when they load the parent swf keeps playing in the background. How can i make them play separately and make the navigation stage dissapear completely when they load?

    I have attempted to use the same Loader but it doesnt replace it i dont know why.
    var myLoader:Loader = new Loader();       
    var myLoaderMain:URLRequest = new URLRequest("main1.swf");
    var myLoaderQuiz:URLRequest = new URLRequest("quiz.swf");
    var myLoaderAnimation:URLRequest = new URLRequest("athens_animation.swf");
    var myLoaderVideo:URLRequest = new URLRequest("videogallery.swf");
    videogallerybtn.addEventListener(MouseEvent.CLICK, videoFunc);
    function videoFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderVideo);
              addChild(myLoader);
    Quizbtn.addEventListener(MouseEvent.CLICK, quizFunc);
    function quizFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderQuiz);
              addChild(myLoader);
    Animationbtn.addEventListener(MouseEvent.CLICK, AnimationFunc);
    function AnimationFunc(curEvt:MouseEvent) {
              myLoader.load(myLoaderAnimation);
              addChild(myLoader);

Maybe you are looking for

  • Buying used-What to look for? What to check?

    I'm planning to buy a used iPod tomorrow. I'm trying to decide between two models. Can someone give me advice on choosing? One is a 3rd generation and the other is a 4th generation. They are both 20G, and both the same price, $60. I have two question

  • Why are my RAW images imported in to Lightroom 5 being de-saturated?

    Lately, in LR 5.3 and 5.5, every time I import RAW images they show up de-saturated.  In the thumbnail they look right, but in both the library and develop mode main screens they show up very flat and de-saturated. This is the first time I have had t

  • Will it work with a monitor...

    will the new macbook air work with a monitor as I see it has a touch screen? This will be my primary computer as I like that it is small and light.

  • EBKN-PS_PSP_PNR proviede in BI as posid

    Hi, I created a view of eban and ekbn in the sourcesystem (I didn't find something in the content). But I have the problem, that I get WBS-element only as a numeric field in BI (comes from EBKN-PS_PSP_PNR)  for example 00010487 not like I need it for

  • Spinning beach ball while wiping hard drive.

    I've been wiping the 80 GB hard drive on my eMac before passing it on to a friend. I opted for the 8 pass of writing random data, and it's taken 3 days! It reached the 'creating partition map' stage yesterday and I've got the spinning beach ball and