Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 627305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:30:49+00:00 2026-05-13T19:30:49+00:00

I am working on my first big Actionscript 3 website and trying to decide

  • 0

I am working on my first big Actionscript 3 website and trying to decide on the best loading sequence. I am currently using BulkLoader, since filesize wasn’t much of an issue for a larger website, but I am definitely open to other approaches.

I am trying to figure out which external assets to measure progress {1 swf, 1 css file, multiple images}, but can’t quite figure out how to group/order them because of their dependency on a loaded XML file.

What are the best practices for program initialization and chain loading of assets in AS3, particularly when the site structure is created from an XML file?

First and foremost, I am loading a single SWF and an XML file containing the site structure, page-ids, copy, and image filenames (background images and also page slideshows). I am currently bulk-loading the XML and a CSS file up front, and then generating the whole program. I have to retrieve image filenames out of the XML and then load them, however that is really a two-part process. Is there a way to somehow create a single preloader for all of this bulk-loading?

A few notes about my initialization process: there is 1 frame in the timeline, and only the preloader exists on the stage. The pages + other details (navigation, background images, slideshows, etc.) are all added/created as new objects after parsing of XML, and then I remove the preloader clip. This can be somewhat processor intensive when loading all up front, but prevents having to preload again and again as users click through the website. I will also be implementing SWFAddress, so the preloading sequence is critical to master.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:30:50+00:00Added an answer on May 13, 2026 at 7:30 pm

    I ended up using AS3 QueueLoader — it enabled me to add assets to the queue after the XML was loaded, and still kept my preloading as one process. Sweet!

    I hope this helps somebody. Let me know if you have any questions about it!

    Here is some code that adds images to the queue after the XML has loaded (a lot of details omitted):

    private function init():void {
        _oLoader = new QueueLoader();
        _oLoader.addItem(PATH+cssURL, css, {title:'cssContent'});
        _oLoader.addItem(PATH+"xml/copy.xml", pageXML, {title:'pageXML'});
    
        _oLoader.addEventListener(QueueLoaderEvent.ITEM_PROGRESS, onItemProgress, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.ITEM_COMPLETE, onItemComplete, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.QUEUE_PROGRESS, onQueueProgress, false, 0, true);
        _oLoader.addEventListener(QueueLoaderEvent.QUEUE_COMPLETE, onQueueComplete, false, 0, true);
    
        _oLoader.execute();
    }
    private function onItemComplete(evt:QueueLoaderEvent):void {
     if (evt.title == 'cssContent') {
        css = StyleSheet(evt.content);
    }
    if(evt.title == 'pageXML'){
        pageXML = XML(evt.content);
    
        processXML(); // creates page objects based on XML
    
        for(var i:int=0; i<pageXML.PARENT.length(); i++){
             //loops through XML for background images and adds them to various
             //sprite layers for simple turning on and off
            numSubPages = pageXML.PARENT[i].PAGE.length();
    
            var pageImgHolder = new Sprite();
            pageImgHolder.name = 'page'+i;
            pageImgHolder.x = 0; pageImgHolder.y = 0;
            bgImgHolder_mc.addChild(pageImgHolder);
    
            for(var j:int=0; j<numSubPages; j++){
                if(String(pageXML.PARENT[i].PAGE[j].@IMAGE) !== ''){
                bgImg = new Sprite();
                bgImg.name = 'page'+i+'img'+j;
                bgImg.alpha = 0;
    
                pageImgHolder.addChild(bgImg);
    
                _oLoader.addItem(PATH+'images/'+pageXML.PARENT[i].PAGE[j].@IMAGE, bgImg, {title:'page'+i+'img'+j})
                trace(pageImgHolder.parent.name+'/'+bgImg.parent.name+'/'+bgImg.name+' = '+pageXML.PARENT[i].PAGE[j].@IMAGE);
                }
            }
            }
        xmlLoaded = true;
        } 
    }
    private function onQueueComplete(evt:QueueLoaderEvent):void {
        trace("** "+evt.type);
        imgHolderLoaded = true;
    
        Preloader.instance.spinnerDone();
        startMovie();
    
        bgImgHolder_mc.turnOnImg(0, 0);
        //turns on image for page 0, subpage 0 (i have a very complicated architecture)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.