ich möchte im Template anstelle eines Bildes eine Flashannimation einbinden.
1. Wie binde ich das swf mit Typo ein?
2. ich möchte eine Flashabfrage machen, dass heisst, falls kein flash vorhanden ist, soll ein jpg geladen werden.
Wer kann mir weiterhelfen? Wäre sehr dankbar!
Also schon vielen Dank für Eure Mithilfe.
mach adas ganze doch in dein template file.
wie du da flash einbindest findest du z.B. bei Selfhtml.teamone.de
die abfrage könntest du z.B. mit Javascript realisieren.
Im HTML-Code an der Stell, wo das Bild/flash hin soll.
<script type="text/javascript" src="index/flash_detect.js">
function getFlashVersion() { return null; };
</script>
<script type="text/javascript">
var requiredVersion = 6;
var flashVersion = getFlashVersion();
if (flashVersion >= requiredVersion) {
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="80" HEIGHT="40" id="index"><PARAM NAME=movie VALUE="index/enter.swf"><PARAM NAME=loop VALUE=false><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=best><PARAM NAME=scale VALUE=false><PARAM NAME=devicefont VALUE=true><EMBED src="index/enter.swf" loop=false menu=false quality=best scale=noscale devicefont=true bgcolor=#EFEFEF WIDTH="80" HEIGH="40" ALIGN="middle" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>');
}
else if (flashVersion > 0) {
document.write('<a href="JavaScript:Launch();"><img src="index/enter.gif" width="61" height="40" border="0"></a>');
}
else if (flashVersion == 0) {
document.write('<a href="JavaScript:Launch();"><img src="index/enter.gif" width="61" height="40" border="0"></a>');
}
else if (flashVersion == flashVersion_DONTKNOW || flashVersion == null) {
document.write('<a href="JavaScript:Launch();"><img src="index/enter.gif" width="61" height="40" border="0"></a>');
}
</script>
Das benötigte JS:
// Flash Version Detector v1.2.1
// documentation: http://www.dithered.com/javascript/flash_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)
// with VBScript code from Alastair Hamilton (now somewhat modified)
function isDefined(property) {
return (typeof property != 'undefined');
}
var flashVersion = 0;
function getFlashVersion() {
var latestFlashVersion = 8;
var agent = navigator.userAgent.toLowerCase();
// NS3 needs flashVersion to be a local variable
if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
flashVersion = 0;
}
// NS3+, Opera3+, IE5+ Mac (support plugin array): check for Flash plugin in plugin array
if (navigator.plugins != null && navigator.plugins.length > 0) {
var flashPlugin = navigator.plugins['Shockwave Flash'];
if (typeof flashPlugin == 'object') {
for (var i = latestFlashVersion; i >= 3; i--) {
if (flashPlugin.description.indexOf(i + '.') != -1) {
flashVersion = i;
break;
}
}
}
}
// IE4+ Win32: attempt to create an ActiveX object using VBScript
else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
var doc = '<scr' + 'ipt language="VBScript">
';
doc += 'On Error Resume Next
';
doc += 'Dim obFlash
';
doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1
';
doc += ' Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i)
';
doc += ' If IsObject(obFlash) Then
';
doc += ' flashVersion = i
';
doc += ' Exit For
';
doc += ' End If
';
doc += 'Next
';
doc += '</scr' + 'ipt>
';
document.write(doc);
}
// WebTV 2.5 supports flash 3
else if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;
// older WebTV supports flash 2
else if (agent.indexOf("webtv") != -1) flashVersion = 2;
// Can't detect in all other cases
else {
flashVersion = flashVersion_DONTKNOW;
}
return flashVersion;
}
flashVersion_DONTKNOW = -1;
Also ich steh voll auf dies Variante. Geht sicher auch kürzer, aber das ist halt mit der Creme de la Creme versehen ;-)
hat schon jemand ein Workaround auf das neue "Feature" von Microsoft,
dass man beim IE neuerdings alle ActiveX Controls — sofern diese über "APPLET", "EMBED" oder "OBJECT" geladen werden — erst anklicken muss, bevor man damit interagieren kann? Ausserdem dieser widerliche Rand um das Flash :-/