Tried for several times to get below Javscript to execute on page load. Currently it works only on click of “Start” button.
How could this be made excited on load of the page?
<script type="text/javascript">
function getFlashMovie(movieName) {
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[movieName] : document[movieName];
}
function start() {
var active = document.getElementById("buttonstart").value == "stop";
getFlashMovie("test").setProperty("src", !active ? document.getElementById('url2').value: null);
document.getElementById("start").value = active ? "buttonstart" : "buttonstop";
}
</script>
the html
<input id="url2" type="text" value="rtmp://localhost/?streammovie=test"/>
The getFlashMovie(“test”).setProperty is a function to pass variable to the SWF file.
On page load I want it to get executed rather than on button click.
what you could do is:
if you consider using jQuery at all then you could wrap your code within:
the code would execute when the page has been fully loaded, but i do not advise adding the jquery library just so you can use this feature.