Search code examples
xmlflashactionscriptstylesheetscroller

Flash, actionscript...load and parseXML with scrolling


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


Solution

  • 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.