My flash is working fine in all browser except ie6. During loading of page I see flash fine in ie6 but once page is loaded flash disappears. Looked everywhere but can not find solution.
in ie6 downloaded latest player WIN 10,3,181,34. version detected at http://kb2.adobe.com/cps/155/tn_15507.html
javascript file has
$(document).ready(function () {
swfobject.registerObject("mymovie", "9.0.0", "expressInstall.swf");
});
Below is code in helper in app_code folder
#helper SwfObject(string swfName, UrlHelper url) {
<object id="mymovie" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="960" height="315" style="background-color: #e6e6e6;" wmode="transparent">
<param name="movie" value="#url.Content("../../Content/flash/" + swfName)" />
<param name="wmode" value="opaque" />
<object type="application/x-shockwave-flash" data="#url.Content("../../Content/flash/" + swfName)" width="960" height="315" style="background-color: #e6e6e6;" wmode="transparent">
<div>
<img src="#url.Content("../../Content/gallery/album1/large/1.png")" alt="Image"/>
<p><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></p>
</div>
</object>
</object>
}
swfobject.registerObject shouldn't be wrapped in a $(document).ready function or any similar onload functions, such as window.onload.
Demo
Tutorial
The official example in the SWFObject documentation
Related
Hi all website development experts,
I am a newbie to website design.
I am 13 years old but my passion is to record my own music from the different instruments I play and I love singing as well.
I am trying to make my own online Music Library so that people can listen to some of my songs in full for free or listen to a preview of my songs and buy them online.
I have created an Album Web Page which displays all the songs I have uploaded to my ISP's Web Server.
I have either a Free Play or Preview Button listed for each song in the Album.
If the users click on this Image Button, I want it to change onclick to a Pause Button.
If the users then click on the Pause Image Button I want it to change back to the Free Play or Preview Button.
I also want the Song to continue to play from where the user clicked on the Pause Button until either the end of the song or the end of the preview length of 15 seconds for the song, if it is available as a Preview Song.
What is the easiest way to achieve this.
I have the following code so far:
Javascript:
<script>
function play(id){
var audio = document.getElementById('audio'+id);
audio.play();
}
function pause(id){
var audio = document.getElementById('audio'+id);
audio.pause();
}
function changSRC() {
document.getElementById("imageid").src="/images/Song_Pause.png";
}
</script>
HTML:
<html>
<body>
<audio id="audio1">
<source src="/songs/Hall-of-the-Mountain-King.mp3" type="audio/mpeg">
<source src="/songs/Hall-of-the-Mountain-King.ogg" type="audio/ogg">
</audio>
<img src="/images/Free_Play.png" align="center" width="100%" alt="Free Play" onclick="changSRC()" />
<audio id="audio2">
<source src="/songs/Rimsky-Korsakov-The-Flight-of-the-Bumble-Bee.mp3#t=0,15" type="audio/mpeg">
<source src="/songs/Rimsky-Korsakov-The-Flight-of-the-Bumble-Bee.ogg#t=0,15" type="audio/ogg">
</audio>
<img src="/images/Preview.png" align="center" width="100%" alt="Song Preview" onclick="changSRC()" />
</body>
</html>
Now I am stuck.
How do I continue on from here to get the Songs to play again from when the user clicked on the Pause Button from the point they clicked on the Pause Button until the end of the 15 second preview or until the end of the song for the Free Play songs.
I will really appreciate any help. Thank you so much in advance!
Kind Regards,
Nancy
you can put the free_play_or_preview and id parameters in "changSRC" and give parameters according to the song. In my solution if free_play_or_preview parameter is "f" image is free play image else image is preview image and you can find which element has which image with id parameter
Here is my solution :
<!DOCTYPE html>
<html>
<body>
<audio id="audio1">
<source src="/songs/Hall-of-the-Mountain-King.mp3" type="audio/mpeg">
<source src="/songs/Hall-of-the-Mountain-King.ogg" type="audio/ogg">
</audio>
<img id="img1" src="/images/Free_Play.png" align="center" width="100%" alt="Free Play" onclick="changSRC('f',1)" />
<audio id="audio2">
<source src="/songs/Rimsky-Korsakov-The-Flight-of-the-Bumble-Bee.mp3#t=0,15" type="audio/mpeg">
<source src="/songs/Rimsky-Korsakov-The-Flight-of-the-Bumble-Bee.ogg#t=0,15" type="audio/ogg">
</audio>
<img id="img2" src="/images/Preview.png" align="center" width="100%" alt="Song Preview" onclick="changSRC('p',2)" />
<script>
function play(id){
var audio = document.getElementById('audio'+id);
audio.play();
}
function pause(id){
var audio = document.getElementById('audio'+id);
audio.pause();
}
function changSRC(free_play_or_preview,id) {
if(document.getElementById(`img${id}`).src == "/images/Song_Pause.png"){
if(free_play_or_preview == "f"){
document.getElementById(`img${id}`).src == "/images/Free_Play.png"
} else {
document.getElementById(`img${id}`).src == "/images/Preview.png"
}
} else {
document.getElementById(`img${id}`).src="/images/Song_Pause.png";
}
}
</script>
</body>
</html>
My application is web based and developed by MVC3 razor. I wanna show SSRS report in my page. For that I have used iframe tag to show SSRS report and its working fine. After the iframe tag I have put a div and included content in that.
<div>
<iframe height="100" scrolling="auto" frameborder="0" width="100%" src="http://" />
</div>
<div>© 2012</div>
Problem: I facing problem in div i.e. I'm unable to view values inside the div.
I'm using IE8
An iframe is not a self-closing tag. You should change from <iframe /> to <iframe></iframe>:
<div>
<iframe height="100" scrolling="auto" frameborder="0" width="100%" src="http://"></iframe>
</div>
<div>© 2012</div>
iframe's can be self-closed with HTML5, but IE8 doesn't support this.
Your iframe code is missing the closing, you should change your code to
<div>
<iframe height="100" scrolling="auto" frameborder="0" width="100%" src="http://" ></iframe>
</div>
<div>© 2012</div><div>
<iframe height="100" scrolling="auto" frameborder="0" width="100%" src="http://" ></iframe>
</div>
<div>© 2012</div>
I've got few files I want to play on website, and to change it I used ajax, code below:
<div id="play"></div>
<div id="list">
<span id="1">audio 1</span><br />
<span id="2">audio 2</span><br />
<span id="3">audio 3</span><br />
<span id="4">audio 4</span><br />
<span id="5">audio 5</span><br />
<span id="6">audio 6</span><br />
<span id="7">audio 7</span><br />
</div>
<script type="text/javascript">
$(document).ready(function() {
$('#list span').click(function() {
$.ajax({
type: "GET",
url: "play.php",
data: { file: $(this).attr('id') }
}).done(function(msg) {
$('#play').html(msg);
});
});
});
</script>
and here is play.php:
<audio controls="controls" preload="auto" autobuffer="autobuffer">
<source src="get-file.php?v=<?php echo 'ogg#'.intval($_GET['file']).''); ?>" type="audio/ogg">
<source src="get-file.php?v=<?php echo 'mp3#'.intval($_GET['file']).''); ?>" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
and in get-file.php i check which file i want to play and type of file and using headers I return file. The problem is in IE9, if I use ajax I get Your browser does not support the audio element., if I run audio... straight in browser, it works fine. How to fix this ajax thing in IE?
I use .swf file in may site:
<div>
<object width="100%" height="100%">
<embed src="#Url.Content( "~/Content/TopRight.swf" )" type="application/x-shockwave-flash" width="310" height="95"></embed>
</object>
</div>
And I want when click this banner, opens any link (any page). I placed <object> into <a> tag, but nothings changed. How can I do this?
put this at the end of your code:
import flash.display.MovieClip;
var hit = new MovieClip();
hit.graphics.beginFill(0xFFFFFF);
hit.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
var clicky = new SimpleButton(null,null,null,hit);
this.addChild(clicky);
clicky.addEventListener(MouseEvent.CLICK, function(){
navigateToURL(new URLRequest("http://google.com"));
});
should work :)
i Have an use case
<html>
<head>
<s:head />
<sj:head jqueryui="true" />
<script type="text/javascript">
$.subscribe('hideTarget', function(event, data) {
$('#'+event.originalEvent.targets).hide("blind");
});
</script>
</head>
<body>
<div align="left" >
<div class="demo" align="center">Run Effect</div>
<div id="effect" style="display:none;">
Upload Photos Here
<s:form action="AjaxTest" method="post" theme="xhtml" enctype="multipart/form-data" >
<s:file name="userImage" label="User Image" />
<sj:submit targets="result" effect="blind" effectMode="show" onEffectCompleteTopics="hideTarget" value="Upload" button="true" />
</s:form>
<br/>
<img id="indicator" src="progressbar.gif" style="display:none" alt="loading"/>
</div>
<sj:div effect="pulsate" effectDuration="1500" onEffectCompleteTopics="hideTarget" cssClass="welcome" id="result"></sj:div>
</div>
<!-- End demo -->
</body>
as u can see i am uploading an single file using ajax call. when u click Run Effect link a div will toggle down in that file tag willbe their, select the file, upload it and it will display successfully uploaded message with effect and after it hide that success message.
up to that it work fine but my problem is when u want to upload another file it will display file tag u can select also but when u submit the form it is not displaying an successful message but file is uploaded in server and also in file tag previous uploaded file name is their
NOTE: my requirement is it should show successfully uploaded message for each and every time user submits form using ajax call
my success.jsp is
<body>
<s:if test="hasActionMessages()">
<s:actionmessage/>
</s:if>
<s:if test="hasActionErrors()">
<s:actionerror/>
</s:if>
</body>
Struts.xml
<action name="AjaxTest" class="AjaxCallAction">
<result name="success">/success.jsp</result>
</action>
just like the link below this
http://www.weinfreund.de/struts2-jquery-showcase/index.action
Dont use id="result" in , use name="result" and use formIds in