views:

34

answers:

2

Hi, I would like to add a component in my flash website which will, 1.load xml data. 2.parse it using stylesheet 3. Have a scrollbar incase xml data is a lot.

any suggestions will be helpful

+1  A: 

Try the following:

  1. Load your XML file with URLLoader.
  2. Use the listener Event.COMPLETE and cast the data to XML.
  3. Parse through the children of the XML through a loop or recursively and build data objects.
  4. Render the data objects into a TextField with span tags and apply a stylesheet according to the formatting you require.

Of course there are other ways but I'm making guesses at what you're looking to use this application for.

Henry
A: 

following on Henry's answer...

create a sprite container to hold your textfields. set a maximum display height , when the container's height exceeds the max display height , add a scrollbar.

PatrickS