I am having a challenge getting the current frame playing. I am using swfobject ver 2.2.
Here is my script:
<script type="text/javascript">
function flashplayer(flashname) {
var flashvars = {};
var params = {};
params.play = "true";
params.menu = "true";
params.scale = "noscale";
params.allowfullscreen = "true";
var attributes = {
id: "flashDiv",
name: "flashDiv"
};
swfobject.embedSWF(flashname, "myAlternativeContent", "800", "600", "9.0.0", flashvars, params, attributes);
var obj = swfobject.getObjectById("myAlternativeContent");
totalFrames = obj.totalFrames;
$('#duration').html(totalFrames);
currentFrame1 = obj.currentFrame;
$('#current').html(currentFrame1);
obj.addEventListener("onStateChange", "onytplayerStateChange");
}
function onStateChange() {
var obj = swfobject.getObjectById("myAlternativeContent");
currentFrame1 = obj.TcurrentFrame;
$('#current').html(currentFrame1);
}
function stopflash() {
var obj = swfobject.getObjectById("myAlternativeContent");
obj.Stop();
}
function PlayFlash() {
var obj = swfobject.getObjectById("myAlternativeContent");
obj.Play();
}
function FlashRewind() {
var obj = swfobject.getObjectById("myAlternativeContent");
obj.Rewind();
}
</script>
<div id="duration">
1
</div>
<div id="current">
1
</div>
<input onclick="flashplayer('../../Video/test.swf');" type="button" style="width: 300px"
value="play flash" /><br />
Thanks in advance.