Phillip George Apley wrote:
I'm working on noughts and crosses, and I find that the multiframe
resources animate forever in DHTML. They should just play once.
I find this function in LzScript.js:
LzSprite.prototype.play = function(f) {
if (isNaN(f * 1) == false) {
//Debug.info('play ' + f + ', ' + this.frame);
this.__setFrame(f);
}
if (this.playing == true) return;
if (this.frames && this.frames.length > 1) {
this.playing = true;
LzIdleKernel.addCallback(this, '__incrementFrame');
}
}
I'm thinking this same play function is being used for swf or png, dhtml
or swf8. Is that right? Do I have to make another version of this for
DHTML which uses a different callback so it will stop animating? Since
some png resources will want to play forever and others to play once, do
we add something to the resource descriptor (copied out of the swf?), or
do we have a different API call.
There should be an 'onlastframe' event you can listen for and call stop()...
--
Regards,
Max Carlson
OpenLaszlo.org