Topic: pausing main timeline while an image loads within another movie clip

I have a movieclip on the main timeline that is parsing XML from radiantcms and using a link from the XML to load an image into the clip.

What I want is to actually pause the main timeline of the movie until the movie clip finishes parsing the XML and (most importantly) loading the image.

I've got everything parsing and loading correctly, but I can't seem to get a script that actually pauses the timeline based on whether or not the image has completed loading. I'm not that experienced with actionscript, but I'm hoping I'm close and just missing a minor detail or two in how this whole thing should work.

Below is the working AS for the movieclip that does the parsing and contains the image and the AS for the main timeline that doesn't seem to be doing its job.

Any help would be greatly appreciated!

-------- MovieClip 'one' on the timeline ---------

function loadXML(loaded) {
    if (loaded) {
        var sTitle:String
        var sDescription:String
        var sLink:String
        var sImage:String
        description_mc.description_txt.text=sDescription+" Read more

Re: pausing main timeline while an image loads within another movie clip


Scratch that. Here is another version using the variables you will ultimately be using:

[code=]// # Frame 1 on _root
var _this:MovieClip = this;
// # Define Variables outside of the parseXML method
var sTitle:String='';
var sDescription:String='';
var sLink:String='';
var sImage:String='';
// # Step 1: Load the XML
var promo_xml:XML = new XML();
var loadXML:Function = function():Void{
    trace(">> 1. loadXML()");
    promo_xml.ignoreWhite = true;
    promo_xml.onLoad = parseXML;
// # Step 2: Parse the XML
var parseXML:Function = function(success:Boolean):Void{
    if (success){
        trace(">> 2. parseXML()");
        // # Parse XML here...
        sTitle = promo_xml.firstChild.firstChild.childNodes[0].firstChild.nodeValue;
        sDescription = promo_xml.firstChild.firstChild.childNodes[1].firstChild.nodeValue;
        sLink = promo_xml.firstChild.firstChild.childNodes[2].firstChild.nodeValue;
        sImage = promo_xml.firstChild.firstChild.childNodes[3].firstChild.nodeValue;
        description_mc.description_txt.text=sDescription+" Read more

Last edited by Ignition (2007-07-08 18:10:17)