admin管理员组文章数量:1401653
Good day.
Code:
<object id="ItemEditAnimationObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="580" height="370">
<param name="movie" value="./6.swf">
<!--[if !IE]>-->
<object id="ItemEditAnimationObject" type="application/x-shockwave-flash" data="./6.swf" width="580" height="370">
</object>
<!--<![endif]-->
</object>
<div id="PlayPause" class="Play"></div>
<div id="Stop"></div>
Js:
function OnePlay(){
swfobject.getObjectById('Object').Play();
}
function OnePause(){
swfobject.getObjectById('Object').Pause();
}
function OneStop(){
swfobject.getObjectById('Object').Stop();
}
Jquery:
$("#PlayPause").on("click",function(){
if($(this).hasClass("Play")){
$(this).removeClass("Play").addClass("Pause");
OnePlay();
}
else if($(this).hasClass("Pause")){
$(this).removeClass("Pause").addClass("Play");
OnePause();
}
});
$("#Stop").on("click",function(){
OneStop();
});
When i click on button with id "PlayPause" swf start.
But if i click again or click on button with id "stop", i get error in firebug:
swfobject.getObjectById(...).Pause is not a function
swfobject.getObjectById(...).Stop is not a function
Tell me please where error and how aright make pause and stop swf object ?
Good day.
Code:
<object id="ItemEditAnimationObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="580" height="370">
<param name="movie" value="./6.swf">
<!--[if !IE]>-->
<object id="ItemEditAnimationObject" type="application/x-shockwave-flash" data="./6.swf" width="580" height="370">
</object>
<!--<![endif]-->
</object>
<div id="PlayPause" class="Play"></div>
<div id="Stop"></div>
Js:
function OnePlay(){
swfobject.getObjectById('Object').Play();
}
function OnePause(){
swfobject.getObjectById('Object').Pause();
}
function OneStop(){
swfobject.getObjectById('Object').Stop();
}
Jquery:
$("#PlayPause").on("click",function(){
if($(this).hasClass("Play")){
$(this).removeClass("Play").addClass("Pause");
OnePlay();
}
else if($(this).hasClass("Pause")){
$(this).removeClass("Pause").addClass("Play");
OnePause();
}
});
$("#Stop").on("click",function(){
OneStop();
});
When i click on button with id "PlayPause" swf start.
But if i click again or click on button with id "stop", i get error in firebug:
swfobject.getObjectById(...).Pause is not a function
swfobject.getObjectById(...).Stop is not a function
Tell me please where error and how aright make pause and stop swf object ?
Share Improve this question edited Sep 21, 2013 at 1:54 asked Sep 19, 2013 at 21:31 user2770300user27703001 Answer
Reset to default 6Finish code:
function Play(){
swfobject.getObjectById('Object').Play();
}
function Pause(){
swfobject.getObjectById('Object').StopPlay();
}
function Stop(){
swfobject.getObjectById('Object').GotoFrame(1);
}
本文标签: javascriptswfobject playpausestopStack Overflow
版权声明:本文标题:javascript - swfobject playpausestop - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744252071a2597299.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论