AS3/ XML:  Need to load in an image from xml

Posted on 2009-02-20
Last Modified: 2013-11-11
Listed is my code.  All of my text is loading in fine but I am a little confused on how my images get loaded in.  Do I need to place a movieClip on the stage and load the image into that?  I have tried this but with no success.  The only thing I see is the movieClip.  Or..  do I need to create another loader to hold the images.

To catch you up:
I have an mc with 2 text fields inside both being populated successfully from xml.  Now within this same mc I need to load in an image from the same xml...  Please review my code and help if you can...

calloutCopy8_mc.picBox_mc.html = contentInput.callout.picture;  code in question

calloutCopy8_mc is the mc...  picBox_mc is the mc within that I am trying to load the xml image into...

Thanks again...
var xmlLoader:URLLoader = new URLLoader();

var xmlData:XML = new XML();

xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

xmlLoader.load(new URLRequest("CalloutContent.xml"));

function LoadXML(e:Event):void {


	xmlData = new XML(;



function ParseContent(contentInput:XML):void {


	calloutCopy8_mc.picBox_mc.html = contentInput.callout.picture;


        txtBox_mc.buttonText.htmlText = contentInput.callout.button;

	txtBox2_mc.buttonText.htmlText = contentInput.callout.button2;

	txtBox3_mc.buttonText.htmlText = contentInput.callout.button3;

	txtBox_mc_btm.buttonText.htmlText = contentInput.callout.button4;

	txtBox5_mc.buttonText.htmlText = contentInput.callout.button5;

	txtBox6_mc.buttonText.htmlText = contentInput.callout.button6;

	txtBox7_mc.buttonText.htmlText = contentInput.callout.button7;

	txtBox8_mc.buttonText.htmlText = contentInput.callout.button8;

	calloutCopy_mc.Header.htmlText = contentInput.callout.heading;

	calloutCopy_mc.Copy.htmlText = contentInput.callout.texting;

	calloutCopy2_mc.Header.htmlText = contentInput.callout.heading2;

	calloutCopy2_mc.Copy.htmlText = contentInput.callout.texting2;

	calloutCopy3_mc.Header.htmlText = contentInput.callout.heading3;

	calloutCopy3_mc.Copy.htmlText = contentInput.callout.texting3;

	calloutCopy4_mc.Header.htmlText = contentInput.callout.heading4;

	calloutCopy4_mc.Copy.htmlText = contentInput.callout.texting4;

	calloutCopy5_mc.Header.htmlText = contentInput.callout.heading5;

	calloutCopy5_mc.Copy.htmlText = contentInput.callout.texting5;

	calloutCopy6_mc.Header.htmlText = contentInput.callout.heading6;

	calloutCopy6_mc.Copy.htmlText = contentInput.callout.texting6;

	calloutCopy7_mc.Header.htmlText = contentInput.callout.heading7;

	calloutCopy7_mc.Copy.htmlText = contentInput.callout.texting7;

	calloutCopy8_mc.Header.htmlText = contentInput.callout.heading8;

	calloutCopy8_mc.Copy.htmlText = contentInput.callout.texting8;



	trace("XML Output");




Open in new window

Question by:cubical38
    LVL 11

    Accepted Solution

    You will also need to load the images in with a loader..
    here is a link to a gallery i made.
    have a look at the script and let me know if you understand.


    Author Comment

    This does make sense, but it is not working with the dynamic text boxes I have in place.  Is there a way to implement this without changing what I have in place?

    Thanks for the reply...

    Author Comment


    Author Comment

    Everything works...

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
    The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now