Understanding AS3 and XML
2009-10-26 00:00:00 来源:WEB开发网And finally the XML has been fully parsed, attributes included
NAME: Title
VALUE: Fly
-----------------
NAME: Description
VALUE: Simple Microban-style levels.
-----------------
NAME: Email
VALUE: bsimpson_910@hotmail.com
-----------------
NAME: LevelCollection
Attribute: Copyright = Tim LeFevre
Attribute: MaxWidth = 15
Attribute: MaxHeight = 11
This node has children:
NAME: Level
Attribute: Id = The Fly_1
Attribute: Width = 11
Attribute: Height = 11
This node has children:
NAME: L
VALUE: ####
-----------------
NAME: L
VALUE: # #
-----------------
NAME: L
VALUE: ## ####
-----------------
NAME: L
VALUE: ###.$.$. #
-----------------
NAME: L
VALUE: # $.$.$ ##
-----------------
NAME: L
VALUE: # .$@$. #
-----------------
NAME: L
VALUE: ## $.$.{$selection}nbsp; #
-----------------
NAME: L
VALUE: # .$.$.###
-----------------
NAME: L
VALUE: #### ##
-----------------
NAME: L
VALUE: # #
-----------------
NAME: L
VALUE: ####
-----------------
NAME: Level
Attribute: Id = The Fly_2
Attribute: Width = 13
Attribute: Height = 11
This node has children:
NAME: L
VALUE: ####
-----------------
NAME: L
VALUE: # #
-----------------
NAME: L
VALUE: ### ####
-----------------
NAME: L
VALUE: ### .$.$. #
-----------------
NAME: L
VALUE: # $.$.$ ###
-----------------
NAME: L
VALUE: # .$#$. #
-----------------
NAME: L
VALUE: ### $.$.{$selection}nbsp; #
-----------------
NAME: L
VALUE: # .$.$. ###
-----------------
NAME: L
VALUE: #### ###
-----------------
NAME: L
VALUE: # @#
-----------------
NAME: L
VALUE: ####
-----------------
NAME: Level
Attribute: Id = The Fly_3
Attribute: Width = 15
Attribute: Height = 11
Attribute: Copyright = 1106 1087 Jordi Doménech
This node has children:
NAME: L
VALUE: ####
-----------------
NAME: L
VALUE: ## ##
-----------------
NAME: L
VALUE: # ###
-----------------
NAME: L
VALUE: #####$.$.$ ###
-----------------
NAME: L
VALUE: # $.#.#.{$selection}nbsp; ##
-----------------
NAME: L
VALUE: # $.@.{$selection}nbsp; #
-----------------
NAME: L
VALUE: ## $.#.#.{$selection}nbsp; #
-----------------
NAME: L
VALUE: ### $.$.$#####
-----------------
NAME: L
VALUE: ### #
-----------------
NAME: L
VALUE: ## ##
-----------------
NAME: L
VALUE: ####
-----------------
This was the hardest situation, when you don’t exactly know the structure of your XML tree.
But a good PROgrammer always knows the structure of the data he’s playing with, so next time we’ll see how to parse this sokoban level in order to draw it on the screen.
Tags:Understanding AS and
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接