Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-06-2009, 10:27 PM   #1
Registered User
 
Join Date: Mar 2009
Posts: 5
Default Loading text and image with XML

I am trying to load a single image and some text into a Flash doc with XML.
I can get the image to load fine but everything I have tried to get the text to load doesn't work. Could anyone tell me what needs to be added to this in order for text to be added?

I have a movie clip "imageLoader" which th image does load into. I also have a movie clip "textLoader" which I would like the copy to load into.

Here is what I have:

Actionscript
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success){
if(success){
// the line below load the pictures in an empty movie clip manually created and called imageLoader
loadMovie(myXML.childNodes[0].firstChild.firstChild.nodeValue, imageLoader);
loadMovie(myXML.childNodes[1].firstChild.firstChild.nodeValue, textLoader);
} else {
}
}
myXML.load("contact.xml");

XML:
<content>
<imagePath>01.jpg</imagePath>
<imagePath>Blah blah blah, sample text</imagePath>
</content>

Thanks


Sorry if this looks familiar. I posted a similar thread few days ago but didn't have a chance to get back to those who helped and had more questions.
pete@mymettle.com is offline   Reply With Quote
Old 03-07-2009, 05:36 AM   #2
paveloosha
Paveloosha
 
paveloosha's Avatar
 
Join Date: Feb 2009
Location: India
Posts: 50
Send a message via Yahoo to paveloosha
Default

Hi, You can try it into this way... put a dynamic text box into the movieclip "textLoder". name it "myTxt". then use
Code:
textLoader.myTxt.text=myXML.childNodes[1].firstChild.firstChild.nodeValue;
insted of
Code:
loadMovie(myXML.childNodes[1].firstChild.firstChild.nodeValue, textLoader);
paveloosha is offline   Reply With Quote
Old 03-07-2009, 05:08 PM   #3
Registered User
 
Join Date: Mar 2009
Posts: 5
Default Still no text

This is what I have now and I still don't see the text:

Actionscript:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success){
if(success){
// the line below load the pictures in an empty movie clip manually created and called imageLoader
loadMovie(myXML.childNodes[0].firstChild.firstChild.nodeValue, imageLoader);
textLoader.myTxt.text=myXML.childNodes[1].firstChild.firstChild.nodeValue;
} else {
}
}
myXML.load("myImage.xml");


XML:
<content>
<imagePath>01.jpg</imagePath>
<textPath>Blah blah blah, sample text</textPath>
</content>

Does anyone have any thoughts?
pete@mymettle.com is offline   Reply With Quote
Old 03-08-2009, 04:36 PM   #4
paveloosha
Paveloosha
 
paveloosha's Avatar
 
Join Date: Feb 2009
Location: India
Posts: 50
Send a message via Yahoo to paveloosha
Default

Did you placed a dynamic textbox at your movieclip textLoader? Can you attach the fla file so I can check out your structure and coding?
paveloosha is offline   Reply With Quote
Old 03-09-2009, 05:21 AM   #6
paveloosha
Paveloosha
 
paveloosha's Avatar
 
Join Date: Feb 2009
Location: India
Posts: 50
Send a message via Yahoo to paveloosha
Default

Use this code at first frame...
Code:
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(success){
if(success){
// the line below load the pictures in an empty movie clip manually created and called imageLoader
loadMovie(myXML.childNodes[0].childNodes[0].firstChild.nodeValue, imageLoader);
textLoader.myTxt.text=myXML.childNodes[0].childNodes[1].firstChild.nodeValue;

} else {
}
}
myXML.load("myImage.xml");
paveloosha is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XML with AS3 simple application - need help kaytookreations ActionScript 3.0 0 12-04-2008 06:06 AM
Loading an image through xml (not image gallery, just a single image) Lill ActionScript 2.0 2 09-20-2007 11:50 AM
ScrollPane V2 image scroller - dynamic loading from XML jmpreston Components 2 06-18-2007 02:29 PM
loading text and image in XML jusko ActionScript 1.0 (and below) 6 06-25-2005 08:28 PM
If anyone's bored, a custom class . . . retrotron ActionScript 1.0 (and below) 22 05-24-2003 10:01 PM


All times are GMT. The time now is 09:01 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.