dcsimg
A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Error #1502: A script has executed for longer than

  1. #1
    Member
    Join Date
    Aug 2014
    Posts
    51

    Error #1502: A script has executed for longer than

    Hi all !
    I have a website that serves a flash movie ( swf ). There is a loader movie, that loads the main movie and communicates with php. However while loading the main movie, I get the error in the heading above. The main movie has almost 110 sound files besides other clips buttons etc. After struggling a lot and ruling out error due to any other reason, I deleted the 110 sound movies and lo ! the movie worked !! Then i started adding the sound files again and was able to add about a 47 of them without any error. The movie loaded within 5 seconds max. However beyond that point, if I add just one more sound file, the movie fails to load and I get this error.

    Now all search on Error 1502 says it occurs due to infinite loops etc or bad code. However nothing on file size etc. or the limit on adding the size of the library. Please can someone make a suggestion how to solve this issue?

    I would also like to mention that the file size of the main flash file is only 1952kb and that of the corresponding swf is 712 kb , ceratainly not great by any means. Further, the loader movie is AS3 while the main movie is an AS2.

    Thanks all !
    Ajoo

  2. #2
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    946
    Maybe you have a really big "for loop" that should take some ms breaks between every few cycles, lets see some of the program to find out whats wrong.

  3. #3
    Member
    Join Date
    Aug 2014
    Posts
    51
    Hi Alloy Bacon !

    Thanks for the response and sorry for the delay.

    Ya, so no there is no loop at all in the code. The issue was that i was doing too much in the first frame and that cased the error. What i then did was deleted the sound files in my library and instead distributed 50 each in the 2nd and 3rd frame. and that solved the issue and the error vanished. I'll post the code for you tomorrow.

    Thanks again for the response,

  4. #4
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    There's an option in the Publish Settings (Ctrl+Shift+F12) that allows you to change the number of seconds before Flash shows that dialog.

    publish.png
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  5. #5
    Member
    Join Date
    Aug 2014
    Posts
    51
    Hi Northcode and Alloy Bacon,

    Sorry for the delayed response.
    @ Northcode : Thank you for your suggestion which i tried out. I set it up double but still the movie did not load.

    Like I mentioned in my previous reply, the movie loads and works fine when the library content is distributed across frames. However the sounds in the movie do not play which is very surprising.

    Like I had promised I am attaching a smaller & simpler version of the project as a compressed file so that you may try yourself. I am including all files, even the flas.

    To test the program, invoke AS3_swf_php_comm_1.html via localhost or any server. This then loads another movie which is displayed as two boxes and a button. Any number added into the left smaller box appears in the right box multiplied by 3 , a value, received back from php. Clicking the button once again takes the movie to frame 2 where an orange rectangle is displayed and a sound is supposed to be emitted. However the sound is never emitted. I have no idea why this happens when all else works great !!

    I would be great if you can find out why the sounds are not working as expected.

    Sorry again for the delayed response and

    Thanks you !!

    P.S. If you wish to crash the loading of the movie, then add a number of sound files to the library so that it's swf exceeds 800KB.( In my project, add the sound files to dogyears_1.fla) Then the movie will simply not load and crash giving the 1502 error.
    Thanks
    Attached Files Attached Files
    Last edited by ajoo; 10-02-2018 at 11:07 PM. Reason: missed a point

  6. #6
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    946
    when you have a lot of sound files are you also attaching them all at the same time?

  7. #7
    Member
    Join Date
    Aug 2014
    Posts
    51
    Hi Alloy !

    I am not exactly sure what you mean by "attaching" because that's also an AS3 sound manipulation command.
    However i'll cover both cases.

    1. The sounds are imported into the library all in the first frame and so when the swf is created these are all embedded into the swf.

    2. When the program runs, the sounds are of-course attached individually and played at the appropriate times.

    I hope that is clear now.

    Thank you.

  8. #8
    Senior Member Alloy Bacon's Avatar
    Join Date
    Apr 2011
    Posts
    946
    you need to play them from a folder:

    keep mp3.mp3 in same folder as swf and it plays
    PHP Code:
    var folderSound:Sound=new Sound();
    folderSound.loadSound("mp3.mp3",true); 
    Last edited by Alloy Bacon; 10-04-2018 at 03:42 PM.

  9. #9
    Member
    Join Date
    Aug 2014
    Posts
    51
    Hi Alloy,

    Yes I did that as soon as i posted the question here. The problem is this that in my application I will have to make loads of changes because I had used the library to develop the program. I was wanting to avoid that. loaded directly the program works great. No issues at all. But loaded via a dummy swf, this issue has cropped up.

    In any case it is indeed amazing that the library sounds do not work even though the entire movie with embedded sound files is otherwise running fine. I wish someone can either find a reason for it or a solution.

    Meanwhile, I am getting on to changing my program.

    Thanks !

Tags for this Thread

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center