外部XMLファイルのノードを取得

Flash

2009.07.23

前回の読み込んだ外部xmlからノードを取得する方法を説明します。

xmlファイル

前回のxmlのimgタグにx=”10″とy=”10″を追加します。

<info>
	<img x="10" y="10">photo01.jpg</img>
</info>

Actionscript

次にActionscriptへ var thumbX = thumbXml.img.@x;とvar thumbY = thumbXml.img.@y;を追記します。
ノードの前に@マークを付けるだけでOK!

var thumbX = thumbXml.img.@x;
var thumbY = thumbXml.img.@y;
	
thumbLoader.x = thumbX;
thumbLoader.y = thumbY;

上記の記述を追加すると、x軸とy軸に10px足されて表示されます。
xmlで位置を指定できるので、更新性に優れています。

  1. Web-Parkのホーム > 
  2. Flash > 
  3. 外部XMLファイルのノードを取得
オススメ本(既読)
読んでみたい本(未読)

Warning: count(): Parameter must be an array or an object that implements Countable in /home/markcrest/web-park.org/public_html/wordpress/wp-includes/class-wp-comment-query.php on line 405

COMMENT PLEASE!!

トラックバック

「外部XMLファイルのノードを取得」のトラックバックURL

Warning: Use of undefined constant display - assumed 'display' (this will throw an Error in a future version of PHP) in /home/markcrest/web-park.org/public_html/wordpress/wp-content/themes/default/single.php on line 105
http://web-park.org/flash/xml_node.html/trackback
about me

Manabu Kushimoto

Welcome to WEB-PARK.ORG!!
This domain was made since 2008 February.

Gender
Male
Birth year
1982
From
Osaka,Japan
  • はてな?ブックマーク
  • delicious
  • facebook