Lastframe event not being detected in Chrome?
I’m a OpenLaszlo & JS newbie. I need to have a way to play audio clips in sequence and came up with a player that creates a frame for a clip, and at the end of the clip (based on the onlastframe event), destroys that frame and creates one for the next clip. In general, it works (code is below). However, when I use Chrome (12.0.742.112) to display the .swf file, only the first clip in the sequence plays. It appears that either the onlastframe event is not generated or it’s ignored. The correct sound plays but nothing else happens. This does not happen when I use Chrome browser with the local server (xampp). Firefox and Opera work, while IE8 doesn’t display the pictures (but that’s another issue).
The example is at http://bit.ly/pP0wlW and includes the debugger. When working (as it should in Firefox), clicking on the correct picture yields a green checkmark, a “ding” or a sentence in Hausa, and advance to a new set of pictures. Clicking on an incorrect answer should yield a red error mark, the spoken words ‘ah-ah’, and a repeat of the original prompt. When not working (Chrome), the marks work as do the first ding or words, but the other actions do not occur.
Any ideas? Thanks!
--Mike Blyth
Source for the sequential clip player:
<class name='SequencePlayer' >
<attribute name='resourceBase' value='' type='string' />
<attribute name='clips' type='expression' />
<attribute name='clip_play' type='expression' />
<method name='load' args='newClips'>
this.clips=newClips
Debug.debug('SP loaded '+this.clips)
</method>
<method name='loadError' args='ignore=null'>
Debug.debug('Error loading!')
this.play()
</method>
<method name='myplay' args='ignore=null' >
Debug.debug('...play...')
if (this.clip_play != undefined) {this.clip_play.destroy()}
var i, next_clip=this.clips.shift()
Debug.debug('next_clip='+next_clip)
if (next_clip==undefined) {
this.onlastframe.sendEvent()
return
}
for (i=0;i<300;i++){} // some timing problem needs slight delay
this.clip_play = new lz.view(canvas, {
resource:'http:' + resourceBase + next_clip + '.mp3' });
new lz.Delegate(this, 'myplay', this.clip_play, 'onlastframe')
new lz.Delegate(this, 'loadError', this.clip_play, 'onerror')
Debug.debug('playing '+next_clip)
</method>
</class>
RSS Feed