Ad esempio, se nella libreria hai un movieclip con "sparo" come linkage, puoi provare qualcosa di simile:
codice:
onClipEvent(load){
maxSparo = 10;
curSparo = 0;
}
onClipEvent(enterFrame) {
if (Key.isDown(Key.LEFT)) {
this._x -= 10;
}
if (Key.isDown(Key.RIGHT)) {
this._x += 10;
}
if (Key.isDown(Key.UP)) {
this._y -= 10;
}
if (Key.isDown(Key.DOWN)) {
this._y += 10;
}
if (Key.isDown(Key.SPACE)) {
if(++curSparo < maxSparo){
var mc = _root.attachMovie("sparo", "sparo" + curSparo, _root.getNextHighestDepth());
mc._x = this._x;
mc._y = this._y;
mc.onEnterFrame = function()
{
if(--this._y < - 100)this.removeMovieClip();
}
}
} else {
curSparo = 0;
}
}