[ActionScript 3.0] AS3.0 生成xml方法之一

var type:Array = ["type0", "type1", "type2"];
var property:Array = [["20","0","1.jpg"], ["60","0","2.jpg"], ["120","0","3.jpg"]];var data:XML = new XML("<data type=‘any‘></data>");
for (var i:int = 0; i < property.length; i++)
{
    var node:XML = new XML();
    node =
        <item type={type[i]}>
            <property x={property[i][0]} y={property[i][1]}></property>
            <path url={property[i][2]}></path>
        </item>;

    data = data.appendChild(node)
}

trace(data);
时间: 2024-10-09 14:02:08

[ActionScript 3.0] AS3.0 生成xml方法之一的相关文章

[ActionScript 3.0] AS3.0 模拟套索工具抠图的两种方法

方法之一:遮罩法 package com.fylibs.tools { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.DisplayObject; import flash.display.Shape; import flash.display.Sprite; import flash.events.MouseEvent; import flash.geom.Matrix; i

[ActionScript 3.0] AS3.0和AS2.0的相互通信

AS3和AS2之间的通信,最好的方式可能就是LocalConnection了. AS2向AS3发送数据,即AS2调用AS3的函数: as2.0代码(按钮上写的发送信息代码): on (release) { var param = "this message is from as2"; var caller:LocalConnection = new LocalConnection(); caller.send("AS2 send to AS3","funI

[ActionScript 3.0] AS3.0 对象在一定范围随机显示不重叠

import flash.geom.Rectangle; import flash.display.MovieClip; import flash.display.Sprite; var arr:Array = []; var dis:Number = 20;//间距 var len:int=15;//对象数量 var bound:Rectangle = new Rectangle(0,0,1000,800);//显示范围 for(var i:int = 0;i<len;i++){ var ob

[ActionScript 3.0] AS3.0 水面波纹效果

import flash.geom.Point; import flash.display.BitmapData; import flash.filters.DisplacementMapFilter; import flash.display.MovieClip; import flash.events.Event; /** * 创建湖面微波效果 */ function createWater(target:MovieClip):void { var count:int = 1; var po

[ActionScript 3.0] AS3.0 马赛克效果

var bmpd:BitmapData; var matrix:Matrix; var bmp:Bitmap; var size:Number = 5; /** * @author:Frost.Yen * @E-mail:[email protected] */ function mosaic(source:MovieClip,size:Number):void { if (bmpd) { bmpd.dispose(); } if (matrix) { matrix = null; } bmpd

[ActionScript 3.0] AS3.0 Socket通信实例

以下类是充当Socket服务器的例子 package { import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import flash.events.ProgressEvent; import flash.events.ServerSocketConnectEvent; import flash.net.ServerSocket; import flash.net.Sock

省厅报件7.0 读取mdb 生成xml 文件

using System;using System.Collections.Generic;using System.Data;using System.Data.OleDb;using System.IO;using System.Linq;using System.Text;using System.Threading.Tasks; namespace ConsoleApplication1{ class Program { static void Main(string[] args) {

[ActionScript 3.0] as3.0加载as2.0的swf时获取as2.0的实际舞台尺寸

var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorH

[ActionScript 3.0] AS3.0根据当天日期获取明天,后天...日期

const dayTime:Number=24*3600*1000//一天毫秒数 var date:Date = new Date(); trace("今天:"+ date.toDateString()); for(var i:int = 2;i<15;i++){ date.setTime(date.valueOf()+dayTime); trace("第"+i+"天:"+ date.toDateString()); }