View Full Version : "onlastframe" does not appear to work (dr)
girardjf
01-31-2003, 01:53 PM
i have attached a sample resource file and code that illustrates what i am talking about.
Plaese check it out, because if this method deos not work, ther is no means of detecting whether a flash movie has stopped playing. That is unless i write a gratuitous loop.
-j
antun
02-03-2003, 03:31 PM
Hey Justin
Could you repost the .zip file please? I couldn't extract it for some reason.
-Antun
antun
02-03-2003, 04:41 PM
Hey Justin
Managed to open your .zip file eventually. Your file didn't work, but I tried playing around with making my own swfs.
Here's what I discovered:-
You must tell the swf to play from it's view (using oninit()):-
<canvas debug="true">
<view name="myView" resource="last.swf" oninit="this.play();">
<method event="onlastframe">
debug.write( 'finished playing' );
</method>
</view>
</canvas>
You also can't use a stop() action in the first frame of the movie.
That aside, my SWF worked. How are you publishing your swf? What player version? Is there any actionscript going on in the movie? Are there any buttons in the movie? Do you have the fla?
Take care,
Antun
girardjf
02-03-2003, 05:07 PM
All that's in the .fla file i was using is an animation and a background. the only actionscript that was in the movie was the stop(), which i tried removing to see if it was overriding the onlastframe event, but that didn't work.
I also tried forcing the movie to play as you did, but at the time it was causing complications with something else, namely switching a resource, and it didn't work so i abandoned that as a fix.
I'll try using this.play again and see if i can get the problem resolved. Thanks again for the reply.
I didn't have a stop() in the first frame did i? the only stop() should have been at the last frame.
-j
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.