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

**URL:** <https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745>\
**Category:** programming\
**Created:** [September 30, 2018, 6:34pm UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745 "2018-09-30T18:34:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajoo](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajoo](https://forum.kirupa.com/u/ajoo)\
**Post date:** [September 30, 2018, 6:34pm UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/1 "2018-09-30T18:34:22Z")

</div>

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.

Thanks all !  
Ajoo

---

<div class="post-metadata">

**Author:** ![Lam\_Kevin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/lam_kevin/32/9301_2.png) [@Lam\_Kevin](https://forum.kirupa.com/u/Lam_Kevin)\
**Post date:** [October 1, 2018, 8:51am UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/2 "2018-10-01T08:51:51Z")

</div>

help me please, I also have the same problem

---

<div class="post-metadata">

**Author:** ![ajoo](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajoo](https://forum.kirupa.com/u/ajoo)\
**Post date:** [October 1, 2018, 9:15am UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/3 "2018-10-01T09:15:55Z")

</div>

Hi Lam\_Kevin,  
I hope that someone makes a reply to this so that both of us can solve this issue.  
Meanwhile I am also looking into it and if i find a solution i will definitely offer it here for all.  
Thanks.

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [October 1, 2018, 5:09pm UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/4 "2018-10-01T17:09:36Z")

</div>

Can you post the code you are using for loading the external content?

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [October 1, 2018, 5:35pm UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/5 "2018-10-01T17:35:44Z")

</div>

I’ve not heard or seen this before. I wonder if a workaround would be to refer to the sound files externally instead?

---

<div class="post-metadata">

**Author:** ![ajoo](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajoo](https://forum.kirupa.com/u/ajoo)\
**Post date:** [October 1, 2018, 5:47pm UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/6 "2018-10-01T17:47:51Z")

</div>

Hi Kirupa, Senocular !!

Thank you guys for the response.

I had also posted my question on another forum, link below

> **[Error #1502: A script has executed for longer than …](https://discuss.as3lang.org/t/error-1502-a-script-has-executed-for-longer-than/1540)**
>
> 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...

  
and got a very detailed reply by another Flash Guru, Zwetan, like you guys. I have not posted my code on that forum either but i plan to post it.  
So he nailed the issue which was that **i was doing too much on the first frame** & suggested 3 solutions, one of which is the same as suggested by SENOCULAR!  
I however decided to spread my content across 3 frames and that seems to have solved the issue.  
@KIRUPA: I will revert with my code for the benefit for all soon.  
@ LIAM KEVIN: My issue was due to overloading the 1st frame. But this issue can also occur due to an infinite kind of loop running therein as well.

Thanks you all very much.

---

<div class="post-metadata">

**Author:** ![ajoo](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajoo](https://forum.kirupa.com/u/ajoo)\
**Post date:** [October 2, 2018, 7:56pm UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/7 "2018-10-02T19:56:38Z")

</div>

Hi All,  
Please find the code files (modified and simplified ) attached.  
This is a working version and to see it crash, a number of sound files will have to be attached to the library of the flash file dogyears.fla.

So while the crashing is rectified by dividing the imported sound files across frames, the sounds still do not play.

To run the movie, invoke AS3\_swf\_php\_comm\_1.html from localhost which will then load another movie dogyears\_1.swf which communicates with php. Add a number in the left box and press the button to see it multiplied by 3 in the right box. Press the button again and it moves to the 2nd frame, displays a small orange bar and is supposed to emit some sounds but it does not.

I would be glad if someone can find out why the sounds are not playing.  
Thanks all !  
[AS3\_swf\_php\_comm\_1.zip](https://forum.kirupa.com/uploads/short-url/4QOZIJImUv9sKBaEELA1BxL97T9.zip) (82.1 KB)

---

<div class="post-metadata">

**Author:** ![ajoo](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@ajoo](https://forum.kirupa.com/u/ajoo)\
**Post date:** [October 4, 2018, 10:03am UTC](https://forum.kirupa.com/t/error-1502-a-script-has-executed-for-longer-than/638745/8 "2018-10-04T10:03:22Z")

</div>

Hi Gurus Senocular & Kirupa and all !

I would be grateful if someone can look into the issue and see why the sounds do not play while the movie does .

Thank you !
