Nospam a écrit :
I am wondering how it could be done with more than one animation
link:
:
<a onclick="window open('','exampl e');return false;"
href=http://www.example.com/animation.swf target="example "example link
1</a>
<a onclick="window open('','exampl e');return false;"
href=http://www.example.com/animation2.swf target="_blank" example link
2</a>
such that clicking on the example link 1 or link 2 will open it in a
new window in an already saved template/site/ called example.html,
With what you give up there :
1) will open 'animation.swf' in :
- if JS a new normal window containing html target 'example'
- if no JS in a new normal window
using same window for each call targeted 'example'
witch is html name of new/old window
2) will open 'animation2.swf '
same as above (1)
but, in html without JS, each call will fire in a new blank window
how could I amend your code so that
<a onclick="loadFl ash(this);" target="example "
href=http://www.example.com/animation.swfex ample link 1</a>
<a onclick="loadFl ash(this);" target="example "
href=http://www.example.com/animation3.swfe xample link 3</a>
<a onclick="loadFl ash(this);" target="example "
href=http://www.example.com/animation4.swfe xample link 4</a>
<a onclick="loadFl ash(this);" target="_blank"
href=http://www.example.com/animation2.swfe xample link 2</a>
<a onclick="loadFl ash(this);" target="_blank"
href=http://www.example.com/animation5.swfe xample link 5</a>
Or use the variant witch specify width and height of flash
<a onclick="loadFl ash(this,360,24 0);" target="example "
href=http://www.example.com/animation.swfex ample link 1</a>
How it is supposed to work (remember: not tested) :
On calling loadFlash() :
- if popup already open :
- close popup
- if no popup (or closed popup)
- open new popup with file 'template.html'
- when file 'template.html' is loaded
-insert in div 'content' of this file
your flash called in href of the link
- put popup in front
- abort html call
Example for canvas file 'template.html'
<html>
<head>
<title>My beautiful flash</title>
<link href="styles.cs s" type="text/css">
</head>
<body>
<h1 id="header">wel come</h1>
<div id="content">
<p>Place for swf file</p>
</div>
<p id="footer">bye </p>
</body>
</html>
You can also open an empty popup
then fill it with html code :
function loadFlash(myFla sh, w, h) {
myFlash = myFlash.href;
if(truc && !truc.closed) truc.close();
truc = window.open('', '','width=600,h eight=550,'+
'resizing=1,scr ollbars=1');
var htm = '<html><link href="styles.cs s" type="text/css">';
htm += '<h1 id="header"><im g src="logo.jpg"h ello<\/h1>';
htm += '<object "applicatio n/x-shockwave-flash" data="'+myFlash +'" ';
htm += 'width='+w+' height='+h+'><p aram name=movie ';
htm += 'value="'+myFla sh+'"><\/object>';
htm += '<p id="footer">bi e bie<\/p><\/html>';
truc.document.o pen();
truc.document.w rite(htm);
truc.document.c lose();
return false;
}
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date