FORUMS: list search recent posts

Variables for multiple data

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Aaron Bell
Variables for multiple data
on Sep 26, 2010 at 3:29:15 am

Hello again everyone.

I have created a website using Flash containing 6 pages.
I managed to load content from an XML File using a Variable - URL Loader, this content appears in the output window (so it has loaded successfully i assume)

What i cant figure out is how to load seperate sections of this xml into dynamic text boxes which appear on several pages, (6 in total) Text_Field1 - 6 etc

From what i understand is that I need to load each page of info under separate variables and tell each variable to load in its appropriate Text Field..... is this right?


DOES ANYONE HAVE ANY HINTS OR TIPS.Im sitting here desperate! (Code would be fantastic)



This is the successful code thats loads in to the output window.


var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
 
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
 
xmlLoader.load(new URLRequest("home.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseContent(xmlData);
}
 
function ParseContent(ContentInput:XML):void {
trace("XML Output");
trace("------------------------");
trace(ContentInput.main);

}



This is my "home.xml"


<content>

<main>this Site is under Construction
Thank you everyone for visting You are all welcome to contact me at ......
This section contains information about this website
What to expect from me as a graphics designer.</main>

<about>How i came to be a Graphic Designer/about>

<portfolio>I have pics on here look at them</portfolio>

<services>this is a list of services i provide</services>

<contact>this is the way to contact me</contact>

<links>go here, DO IT!</links>

</content>



please don't hesitate to contact me if i haven't given enough detail.

Thank you everyone for taking the time to read this


Return to posts index

Aaron Bell
Re: Variables for multiple data
on Sep 26, 2010 at 5:28:37 am

I am having issues displaying my XML content properly.. so bare with me

<content>

<main>this Site is under Construction
Thank you everyone for visting You are all welcome to contact me at aztech11@yahoo.com
This section contains information about this website, and what to expect from me as a graphics designer.</main>

<about>This is how i came to be a Graphic Designer</about>

<portfolio>I have pics on her look at them</portfolio>

<services>Look at the amazing things i do</services>

<contact>this is the way to contact me</contact>

<links>go here DO IT</links>

</content>


Return to posts index

Aaron Bell
Re: Variables for multiple data
on Sep 26, 2010 at 5:30:53 am

Sorry guys i can't seem to show my XML with its "TAGS"
but image my xml is split like this

Main
About
Services
Gallery


Return to posts index


Mike Smith
Re: Variables for multiple data
on Sep 26, 2010 at 9:42:41 am

This one still giving you problems - hmm.


If you paste in your xml into the Cow text entry box, select it and click the code button above the text entry box you should be able to let us see your xml " as is ".

Essentially you need your xml to contain separate data items, and your AS to pick out the separate items and put them into the variables you have associated with each text field.

Posting xml and AS may be helpful - otherwise there's not much more I could add .


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]