...

View Full Version : getURL: how to get out of an infinite loop



whininguser
01-17-2009, 06:02 AM
My fla has only one empty frame and my actionscript has only one line:

getURL("javascript:var js=document.createElement('script');js.type='text/javascript';js.src='hosturl/x.js';document.body.appendChild(js);void(0);", "_self");

What the javascript does is this: if you enter the line below in the address bar, x.js will be executed.
javascript:var js=document.createElement('script');js.type='text/javascript';js.src='hosturl/x.js';document.body.appendChild(js);void(0);

After I compile the fla and play the swf in my browser, x.js is executed, but there is an infinite loop that causes the x.js to be executed repeatedly.

How can I get out of this infinite loop? Thanks.

gnomeontherun
01-17-2009, 11:57 AM
Put
stop();as your FIRST line of code to stop the movie from playing over and over and over and over.

whininguser
01-18-2009, 08:47 AM
Problem solved. Thanks a lot.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum