Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 在FLEX中与XML相乘_Apache Flex - Fatal编程技术网

Apache flex 在FLEX中与XML相乘

Apache flex 在FLEX中与XML相乘,apache-flex,Apache Flex,我编写了一个代码,返回以下包含在字符串类型变量中的XML <imageedit> <matrix a="0.5213903738845257" b="0" c="0" d="0.5213903738845257" tx="559.6" ty="1.0784769629138395"/> <cutout x="0" y="0" width="400" height="568"/> </imageedit> 现在我想将所有节点乘以3,然后再次

我编写了一个代码,返回以下包含在字符串类型变量中的XML

<imageedit>
  <matrix a="0.5213903738845257" b="0" c="0" d="0.5213903738845257" tx="559.6" ty="1.0784769629138395"/>
  <cutout x="0" y="0" width="400" height="568"/>
</imageedit>

现在我想将所有节点乘以3,然后再次存储在该字符串类型变量中。如何执行此操作?

您可以使用E4X访问如下属性:

var xml : XML = <imageedit>
  <matrix a="0.5213903738845257" b="0" c="0" d="0.5213903738845257" tx="559.6" ty="1.0784769629138395"/>
  <cutout x="0" y="0" width="400" height="568"/>
</imageedit>

xml.matrix.@a = Number(xml.matrix.@a)*3

其他属性也是如此。您也可以使用“for each”对它们进行迭代。

您的意思是将标记复制三次,还是将a、b、c、tx、ty、x、y、width和height的值乘以3?是的,我的意思就是这样。