具体使用方法,是创建一个xflash对象,然后可以调用该对象的方法,来实现各种各样的功能。本实例在_root下创建了一个按钮,并且给该按钮添加了事件,语法与html非常接近,只是位置使用了pos属性,里面的参数依次是x座标、y座标、对象宽和对象高。
pos是xflash中比较重要的属性,每一个元素都会有,除了可以采用常量之外,还可以使用关键字,比如本例中的c和m,分别表示横向居中和纵向居中。
<script src=/xflash/xflash.js></script>
<xmp type="xfml">
<button onclick="alert(hello,welcome to xflash develop world~~)" pos=c,m,150,21>我是xflash按钮,点击我</button>
</xmp>
具体地说,是由xflash.js和xflash.swf相结合来实现解析的
<script src=http://imgbuyun.weixiu-service.com/up79/202309/hoqwg14hfsj
<script>
var xf=new xflash()
xf.createElement("_root","<button onclick="alert(Ricky悄悄地测试了一下~)" pos=c,m,150,21>Start</button>")
xf.createElement("_root2","<button onclick="alert(Ricky悄悄地测试了一下~)" pos=200,m+10,150,21>Start2</button>")
</script>