Re: [Flashcoders] Quickie for xml dynamic text loader in flash

2007-10-22 Thread Rich Rainbolt

 Remove

On Oct 19, 2007, at 11:11 AM, Eric Walton wrote:


Hello All,


Quick question about an xml file I am loading into a dynamic text box.

K, I have a dynamic text box/area that loads a simple xml file  
using the

following:

var RootNode:XMLNode;
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = loadNews;
myXML.load("xmlnews1/newsData.xml");
function loadNews(success:Boolean):Void {
if (success) {
RootNode = this.firstChild;
var content_str:String = ""+RootNode.childNodes[1].firstChild;
content_str +=" ("+RootNode.childNodes[0].firstChild;
content_str += ")" + RootNode.childNodes[2].firstChild;
news_txt.text = content_str;
}
}

OK, That works splendidly. Below is the xml file.


http://www.#.com";>June 29,
2008First manned mission to Mars
landsThe first manned mission to  
Mars has
touched down on the surface of the red planet. After six months of  
space
travel, the five astronauts on board MarsEx 1 will finally  
experience an end

to their weightless conditions.

What I need to do is use the same xml file on numerous keyframes
but have each frame contain different text.

So could I do this?


http://www.#.com";>June 30,
2008First manned mission to Mars
landsThe first manned mission to  
Mars has
touched down on the surface of the red planet. After six months of  
space
travel, the five astronauts on board MarsEx 1 will finally  
experience an end

to their weightless conditions.


*added to xml file for second keyframe

http://www.#.com";>June 31,
2008Second Story
TitleHere is the second story full
text


*added to xml file for third keyframe

http://www.#.com";>June 32,
2008Third Story
TitleHere is the third story full
text



Also I am thinking I will need something in each keyframe to call
the specific text section of the xml file.

*Note*
In the beginning I had/have a dynamic text box on each keframe and  
each was

calling a seperate xml doc.
this way I will have only ONE xml file to edit for all the  
keyframes instead

of 80! I am really enjoying the
difficulty of this task.

Hope someone can help.
Much love,



Eric Walton 9 / Edub9

To view more about
The Artwork of Eric Walton 9 / Edub9
please visit the following:
www.HollywoodFineART.com
www.Myspace.com/ericwalton9_edub9
Providentia Marketing LLC
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Quickie for xml dynamic text loader in flash

2007-10-22 Thread Radley Marx



Unless there's a significant reason for needing separate XML files  
for each... keyframe(?)... you can put them all together much more  
easily and load everything from the beginning into an array of  
objects. This way you only have to refer to local storage and not  
have to call to the server over and over for each... uh... keyframe...





http://www.#.com";>
June, 22 2008
Article 1



http://www.#.com";>
June, 24 2008
Article 2



http://www.#.com";>
June, 29 2008
Article 3







Not sure why you're using keyframes for each. You can keep the same  
textFields, and just update them.


Last tip: your news articles in the XML don't need to be news1,  
news2, news3. If you put them in an array you'll have news_array 
[0].title, news_array[1].title and so on.



-radley





http://www.#.com";>June 29,
2008First manned mission to Mars
landsThe first manned mission to  
Mars has
touched down on the surface of the red planet. After six months of  
space
travel, the five astronauts on board MarsEx 1 will finally  
experience an end

to their weightless conditions.



On Oct 19, 2007, at 11:11 AM, Eric Walton wrote:


Hello All,


Quick question about an xml file I am loading into a dynamic text box.

K, I have a dynamic text box/area that loads a simple xml file  
using the

following:

var RootNode:XMLNode;
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = loadNews;
myXML.load("xmlnews1/newsData.xml");
function loadNews(success:Boolean):Void {
if (success) {
RootNode = this.firstChild;
var content_str:String = ""+RootNode.childNodes[1].firstChild;
content_str +=" ("+RootNode.childNodes[0].firstChild;
content_str += ")" + RootNode.childNodes[2].firstChild;
news_txt.text = content_str;
}
}

OK, That works splendidly. Below is the xml file.


http://www.#.com";>June 29,
2008First manned mission to Mars
landsThe first manned mission to  
Mars has
touched down on the surface of the red planet. After six months of  
space
travel, the five astronauts on board MarsEx 1 will finally  
experience an end

to their weightless conditions.

What I need to do is use the same xml file on numerous keyframes
but have each frame contain different text.

So could I do this?


http://www.#.com";>June 30,
2008First manned mission to Mars
landsThe first manned mission to  
Mars has
touched down on the surface of the red planet. After six months of  
space
travel, the five astronauts on board MarsEx 1 will finally  
experience an end

to their weightless conditions.


*added to xml file for second keyframe

http://www.#.com";>June 31,
2008Second Story
TitleHere is the second story full
text


*added to xml file for third keyframe

http://www.#.com";>June 32,
2008Third Story
TitleHere is the third story full
text



Also I am thinking I will need something in each keyframe to call
the specific text section of the xml file.

*Note*
In the beginning I had/have a dynamic text box on each keframe and  
each was

calling a seperate xml doc.
this way I will have only ONE xml file to edit for all the  
keyframes instead

of 80! I am really enjoying the
difficulty of this task.

Hope someone can help.
Much love,



Eric Walton 9 / Edub9

To view more about
The Artwork of Eric Walton 9 / Edub9
please visit the following:
www.HollywoodFineART.com
www.Myspace.com/ericwalton9_edub9
Providentia Marketing LLC
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders







 
--

Radley Marx
www.radleymarx.com
[EMAIL PROTECTED]
 
--





___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] Quickie for xml dynamic text loader in flash

2007-10-20 Thread Eric Walton
Hello All,


Quick question about an xml file I am loading into a dynamic text box.

K, I have a dynamic text box/area that loads a simple xml file using the
following:

var RootNode:XMLNode;
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = loadNews;
myXML.load("xmlnews1/newsData.xml");
function loadNews(success:Boolean):Void {
if (success) {
RootNode = this.firstChild;
var content_str:String = ""+RootNode.childNodes[1].firstChild;
content_str +=" ("+RootNode.childNodes[0].firstChild;
content_str += ")" + RootNode.childNodes[2].firstChild;
news_txt.text = content_str;
}
}

OK, That works splendidly. Below is the xml file.


http://www.#.com";>June 29,
2008First manned mission to Mars
landsThe first manned mission to Mars has
touched down on the surface of the red planet. After six months of space
travel, the five astronauts on board MarsEx 1 will finally experience an end
to their weightless conditions.

What I need to do is use the same xml file on numerous keyframes
but have each frame contain different text.

So could I do this?


http://www.#.com";>June 30,
2008First manned mission to Mars
landsThe first manned mission to Mars has
touched down on the surface of the red planet. After six months of space
travel, the five astronauts on board MarsEx 1 will finally experience an end
to their weightless conditions.


*added to xml file for second keyframe

http://www.#.com";>June 31,
2008Second Story
TitleHere is the second story full
text


*added to xml file for third keyframe

http://www.#.com";>June 32,
2008Third Story
TitleHere is the third story full
text



Also I am thinking I will need something in each keyframe to call
the specific text section of the xml file.

*Note*
In the beginning I had/have a dynamic text box on each keframe and each was
calling a seperate xml doc.
this way I will have only ONE xml file to edit for all the keyframes instead
of 80! I am really enjoying the
difficulty of this task.

Hope someone can help.
Much love,



Eric Walton 9 / Edub9

To view more about
The Artwork of Eric Walton 9 / Edub9
please visit the following:
www.HollywoodFineART.com
www.Myspace.com/ericwalton9_edub9
Providentia Marketing LLC
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders