Programming fags
why doesn't this work?
<input type="file" name="flash">
<object>
<embed src="flash" width="100%" height="100%"></embed>
</object>
i don't know a shit about programming
but i just wanted to try making a html page that has file select button and then shows the .swf selected
What do you mean by "shows"? Play it?
>>59538762
yeah exactly.
If you wanna use swf, you're gonna need a flash plugin. Flash is depracated and dangerous to use. Don't use it. Ever.
Read about HTML5, especially canvas, and then about JS.
>>59538833
i was pretending to do it only using html.
and if i just use
<embed src="file.swf" width="100%" height="100%"></embed>
if i specify the file beforehand it works, but i just wanted it to be selectable instead of having to write the filename in the code.
but regardless, thank you.
>>59538890
Then use javascript to update the file name in your html code based on selection from a list etc...thats the kind of shit its used for.
>>59538958
>Then use javascript to update the file name in your html code based on selection from a list etc.
Oh i didn't know js is client-sided.
thanks a lot i'll post it if i make it work.
I got this<!DOCTYPE html>
<html>
<body>
<input type="file" id="flash">
<button onclick="myFunction()">Play File</button>
<script>
function myFunction()
{
var filename = (function() {return document.getElementById("flash").files; })();
var parent = $('embed#replaceme').parent();
var newElement = "<embed src='filename' id='replaceme'>";
$('embed#replaceme').remove();
parent.append(newElement);
}
</script>
<object>
<embed src="replaceme" id="swf" width="100%" height="100%"></embed>
</object>
</body>
</html>
But i didn't work, i'm not sure what did i miss.
>>59539779
I'm not updated on the new file APIs in HTML5, but I'm pretty sure you'll have to get the user to upload his file (hit submit) and then show another <object> with the just uploaded file embedded.