--建四种不同类型的成员
on CreateMem me
if member("digitalVideo"
.type = #empty then pdigitalVideoMem = member(16,1)
--alert "digitalVideo 成员不存在"
else pdigitalVideoMem = member("digitalVideo"
if member("bitmap"
.type = #bitmap then pbitmapMem = member("bitmap"
else
pbitmapMem = new(#bitmap)
pbitmapMem.name = "bitmap"
end if
if member("flash"
.type = #flash then pflashmem = member("flash"
else
pflashmem = new(#flash)
pflashmem.name = "flash"
end if
if member("sound"
.type = #sound then psoundmem = member("sound"
else
psoundmem = new(#sound)
psoundmem.name = "sound"
end if
end
先建好几种所需类型的成员,然后你再根据文件名的扩展名判断其文件所属哪个成员
再用member("your type member"
.filename = filePath
可以参考一下这里:
www.aougu.net/bbs/index.php?prog=topic::flat&tid=25120