# Dynamicly change SWF on Loaded page

**URL:** <https://forum.kirupa.com/t/dynamicly-change-swf-on-loaded-page/204189>\
**Category:** web dev\
**Created:** [October 17, 2006, 8:16pm UTC](https://forum.kirupa.com/t/dynamicly-change-swf-on-loaded-page/204189 "2006-10-17T20:16:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgallen](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mgallen/32/616_2.png) [@mgallen](https://forum.kirupa.com/u/mgallen)\
**Post date:** [October 17, 2006, 8:16pm UTC](https://forum.kirupa.com/t/dynamicly-change-swf-on-loaded-page/204189/1 "2006-10-17T20:16:23Z")

</div>

Hello I’m traying to update a SWF on a page tha has been fully loaded via javascript. The catch is that the SWF is in the hard drive of a local machine. and I’m calling a javascript function on the onchange event of a file field.

Here is my code:

forms.uploadFlash.uploadFlashfield.onchange =function(){  
var objCont = document.getElementbyId(‘container’);  
var docObj = document.createElement(‘embed’);  
docObj.src= this.value;  
objCont.appendChild(docObj);  
}

the code works fine with a server side SWF but it doesn’t work with a local file.  
Thanks  
Mgallen
