Hey guys, I have a problem here that involves accessing the flash movie thru some javascript code.
I have this code that works just fine using the normal OBJECT and EMBED tags, but is not working with the SWFObject solution. It just needs to find the ID of the flash movie so it can pass a variable to it, but for some reason it can't find the ID even though I am passing the ID thru the so.addParam("id", "FlashFilesUpload");
I guess my question is, how do I access the movie thru Javascript?
<script language="JavaScript"> function mysubmit() { var Flash;
Flash = document.getElementById("FlashFilesUpload"); var FormObj = document.getElementById("myform");
var FormValues = ''; for (var i = 0; i FormValues += FormObj.elements[i].name + '=' + FormObj.elements[i].value + ((i!=(FormObj.elements.length-1))?'&':''); Flash.SetVariable("SubmitFlash", FormValues); return false; } </script> The form is supposed to upload the images and all that, then move on to the next page, but since it can't find the flash movie it just gives a JS error and doesn't work at all.
In my example I followed Adobe's instructions exactly, except I used SWFObject to embed the SWF instead of Adobe's stock scripts.
(I was experimenting with ExternalInterface because I wanted to make JavaScript calls from Adobe Captivate SWFs, but the example I just provided you is pure Flash, no Captivate.)
But the code works perfectly using the typical OBJECT and EMBED tags for the flash movie...it only doesn't work when I use SWFobject to embed the movie.... And I can't rewrite the Flash movie because I didn't make it and I don't have the source code.
So am i forced to abadon SWFObject because it has no ID for me to grab thru javascript?