开发者

Flash, actionscript...load and parseXML with scrolling

开发者 https://www.devze.com 2023-01-09 06:49 出处:网络
I would like to add a component in my flash website which will, 1.load xml data. 2.parse it using stylesheet

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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号