通过实例学习Flash AS3.0——案例六

2019-10-08 19:15:59王旭

container.addChild(imageLoader);
}
}
function changeThumb(event:MouseEvent):void
{
segments = container.width / container.numChildren;
currentSegment = Math.floor(container.mouseX / segments);
if (currentSegment <= container.numChildren - 1)
{
for (var j:int = 0; j < container.numChildren; j )
{
container.getChildAt(j).visible = false;
}
container.getChildAt(currentSegment).visible = true;
}
}
function showPicture(event:MouseEvent):void
{
fullLoader.unload();
fullLoader.load(new URLRequest(xmlList[currentSegment].attribute(fullAtt)));
}
}
}
类说完了,接下来就来看看fla里面都是怎么写的。
这个就简单多了
import interactive.gallery.ImageGallery;
var gallery:ImageGallery = new ImageGallery("data/images.xml","thumb","full");
addChild(gallery);
我不说了,聪明的你一看就明白了。
案例分析到此结束。
源文件下载