Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    getURL: how to get out of an infinite loop

    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.

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Put
    Code:
    stop();
    as your FIRST line of code to stop the movie from playing over and over and over and over.
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • Users who have thanked gnomeontherun for this post:

    whininguser (01-18-2009)

  • #3
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Problem solved. Thanks a lot.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •