Welcome to ASP.NET Guild

Be sure to come back often and tell others. If you have any tips, tricks, examples, please email them to me at chris.williams@techguilds.com and I will post them. Check out our ASP.NET QuickStart and C# QuckStart Libraries. Below is my latest articles.

Monday, July 17, 2006

Flash in a form Fix - Using JavaScript

The fix can be found by following this link but you have to scroll down or do a find for
"briandunnington said on May 9, 2006 at 4:56 PM : "

http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002200.html

Place the following script before the flash object reference and be sure to change ShockwaveFlash1 to your flash file name:

<script type="text/javascript">
function ExternalInterfaceManager()
{
this.registerMovie = function(movieName)
{
if(!window.fakeMovies) window.fakeMovies = new Array();
window.fakeMovies[window.fakeMovies.length] = movieName;
}

this.initialize = function()
{
if(document.all)
{
if(window.fakeMovies)
{
for(i=0;i {
window[window.fakeMovies[i]] = new Object();
}
window.onload = initializeExternalInterface;
}
}
}
}

function initializeExternalInterface()
{
for(i=0;i {
var movieName = window.fakeMovies[i];
var fakeMovie = window[movieName];
var realMovie = document.getElementById(movieName);

for(var method in fakeMovie)
{
realMovie[method] = function() {flashFunction = "<invoke name=\"" + method.toString() + "\" returntype=\"javascript\">" + __flash__argumentsToXML(arguments, 0) + "</invoke>";this.CallFunction(flashFunction);}
}

window[movieName] = realMovie;
}
}

</script>


<script type="">
var eim = new ExternalInterfaceManager();
eim.registerMovie("ShockwaveFlash1");
eim.registerMovie("ShockwaveFlash2");
eim.initialize();
</script>


If you have any tips you would like to share please email them to me at chrisw_88@hotmail.com

Are you a .NET Developer or Contractor interested in working with Sitecore or Dynamics CRM?

Apply for our Mentorship Program. If accepted, we will mentor you on Sitecore and provide you with project to help you build your skills and make some money at the same time. If you are interested send your resume with details on why you want to work with Sitecore or Dynamics CRM to: Chris Williams - chris.williams@techguilds.com or Dennis Augustine - dennis.augustine@techguilds.com We look forward to working with you to achieve your goals.