Professional Web Applications Themes

infinite loop error... Braking my head - Macromedia Flash Actionscript

This one is really banging my head! I have a base movie on level 0 with some loadvars functions, a shared object, and 2 buttons that use loadmovienum to load other movies. The 2 other movies use dataset and datagrid, and get their data from the level0 functions, and shared object. One of this movies should load on level3 and the other one on level4. This is what I do to get the error: - I load movie1 on level3, then close it with unloadMovieNum(3), then load movie2 on level4. I get: "256 levels of recursion were exceeded in one ...

  1. #1

    Default infinite loop error... Braking my head

    This one is really banging my head!

    I have a base movie on level 0 with some loadvars functions, a shared
    object, and 2 buttons that use loadmovienum to load other movies.

    The 2 other movies use dataset and datagrid, and get their data from the
    level0 functions, and shared object.

    One of this movies should load on level3 and the other one on level4.

    This is what I do to get the error:

    - I load movie1 on level3, then close it with unloadMovieNum(3), then load
    movie2 on level4.

    I get: "256 levels of recursion were exceeded in one action list.
    This is probably an infinite loop.
    Further execution of actions has been disabled in this movie."

    What is this all about?

    If I load movie1 on level3, then close it, then load movie2 on level3
    instead of level4, the error does not occur.

    Thanks in advance for any pointers

    Alejandro




    Alejandro Ramos Guest

  2. #2

    Default Re:infinite loop error... Braking my head

    copy and past your loadMovieNum statements.


    kglad webforumsuser@macromedia.com Guest

  3. #3

    Default Re: infinite loop error... Braking my head

    I'm sorry, but I don't understand what you mean. Copy and paste where?

    Do you know why this error happens?



    On 2/1/04 10:45 PM, in article bvjs0t$9ka$1forums.macromedia.com, "kglad"
    <webforumsusermacromedia.com> wrote:
    > copy and past your loadMovieNum statements.
    >
    >
    >
    Alejandro Ramos Guest

  4. #4

    Default Re: infinite loop error... Braking my head

    Hmmm, I guess what you meant was for me to paste the code on the email...
    Thanks again...

    Here it is:

    On level0 I have:

    function Data_democountry() {
    var items;

    myVarsx = new LoadVars();
    myvarsx._path = this
    trace(myvarsx._path)

    this.myVarsx.onload = myVarsLoadedX;


    myVarsx.load("http://www.aerodyne-int.com/citruslab_tests/democenter.asp",
    myvarsx._path);
    }

    function myVarsLoadedX(success) {

    if(success) {
    trace ("bien")
    trace (myVarsx.pid)
    loadMovieNum("democenter.swf", 3);
    // split the strings into arrays
    contArray = new Array();
    contArray = myVarsx.country.split(";");
    statesArray = new Array();
    statesArray = myVarsx.astates.split(";");
    productArray = new Array();
    productArray = myVarsx.prods.split(";");
    pidArray = new Array();
    pidArray = myVarsx.pid.split(";");

    }
    else trace("load failed");
    }

    The menu is on level 15, where I have 2 buttons:

    button1:

    on (release) {
    trace (_global.home);
    unloadMovieNum(2);
    unloadMovieNum(3);
    unloadMovieNum(4);
    unloadMovieNum(11);
    unloadMovieNum(12);
    unloadMovieNum(13);
    _level0.Data_democountry();
    }
    }

    button2:

    on(release){
    loadMovieNum ("store/shoppingcart.swf",14)
    }

    Both movies: democenter.swf & store/shoppingcart.swf have dataset and
    datagrid components.

    If I delete this components on store/shoppingcart.swf from stage and
    library, the error disapears....

    What do you think?














    Alejandro Ramos Guest

  5. #5

    Default Re: infinite loop error... Braking my head

    there are numerous problems with the code you posted and none of them are related to the problem you're asking about. your recursion problem is related to one or both of those components. i'd recommend making a separate movie and test if you can load/unload movies containing those components into different levels.


    kglad webforumsuser@macromedia.com Guest

  6. #6

    Default Re: infinite loop error... Braking my head

    Ok, I have turned the whole thing into a very simple example:

    The filed used are

    1) test1.swf : is the base movie which contains

    - three buttons:

    Button "load on level3":
    on (release) {
    loadMovieNum("test2.swf", 3)
    }

    Button "load on level 4":
    on (release) {
    loadMovieNum("test2.swf", 4)
    }

    Button "unload all":
    on (release) {
    unloadMovieNum(3)
    unloadMovieNum(4)
    }

    - code on the timeline:

    dataarray = new Array()
    dataarray = (["apple", "pear", "banana", "mango", "lemon", "orange",
    "tangerine", "melon", "lime", "grape"])

    2) test2.swf: is the loaded movie which has a combobox component named
    "combotest".

    - code on the timeline:

    combotest.dataProvider = _level0.dataarray


    So, here I can actually show you a couple of weird things if you do the
    following:

    - click to load the movie on level3, it works well

    - click again to reload it on level3, it shows the data, but the combobox
    behaves weird: if you scroll then you cant select from the list, also the
    focus highlight stays there...

    - Then, to get the "infinite loop error", you just have to "unloaad all" and
    try to load the movie on level4, then try clicking on the combobox. It
    sometimes give the error, sometimes crashes flash instead.

    What's up with this?

    Hope this helps, I would attach the fla files, but they exceed the permitted
    posting message size.

    I really appreciate your help, thanks again

    Alejandro.

    Alejandro Ramos Guest

  7. #7

    Default Re: infinite loop error... Braking my head

    OK, you can get the .fla files and see the example at:

    [url]http://www.aerodyne-int.com/citruslab_tests/test/pleasehelp.htm[/url]

    Please let me know what you think

    Thanks again

    Alejandro

    Alejandro Ramos Guest

  8. #8

    Default Re: infinite loop error... Braking my head

    the problem is due to the coding of the combobox. you'll need to debug it or make your own. there's nothing wrong with your code.


    kglad webforumsuser@macromedia.com Guest

  9. #9

    Default Re: infinite loop error... Braking my head

    But isn't this combobox something I paid for? Isn't it supposed to work? I
    can't believe no one had this problem before...

    Any more pointers???

    Thanks

    Alejandro

    On 2/3/04 3:34 PM, in article bvobhb$lb8$1forums.macromedia.com, "kglad"
    <webforumsusermacromedia.com> wrote:
    > the problem is due to the coding of the combobox. you'll need to debug it or
    > make your own. there's nothing wrong with your code.
    >
    >
    >
    Alejandro Ramos Guest

  10. #10

    Default Re: infinite loop error... Braking my head

    well, directly or indirectly we probably did pay for those components. i see a tech note on problems with the combobox when loading into a movieclip, but not when loading into a level. however, mm is using a loadMovie() statement to load into a level instead of loadMovieNum(). try the loadMovie() to see if that helps.


    kglad webforumsuser@macromedia.com Guest

  11. #11

    Default Re: infinite loop error... Braking my head

    LoadMovie() does not do the trick. Same thing cotinues to happen.

    Also the problem is not only with the combobox but also with datagrid, and
    dataset components...

    Isn't this a basic thing you should be able to do?



    On 2/4/04 2:39 AM, in article bvpigu$e9m$1forums.macromedia.com, "kglad"
    <webforumsusermacromedia.com> wrote:
    > well, directly or indirectly we probably did pay for those components. i see
    > a tech note on problems with the combobox when loading into a movieclip, but
    > not when loading into a level. however, mm is using a loadMovie() statement
    > to load into a level instead of loadMovieNum(). try the loadMovie() to see if
    > that helps.
    >
    >
    >
    Alejandro Ramos Guest

  12. #12

    Default Re: infinite loop error... Braking my head

    well, components are often (perhaps always) made by 3rd party authors. i suspect the ones bundled with flash 2004 have been checked by mm, but the code used to create them is often problematic (and, as far as i can tell, always inefficient).
    this forum has more questions about component problems than it does about actionscript problems. if i were you, i'd try and track down the person that authored the component(s) that you think are causing the problem.


    kglad webforumsuser@macromedia.com Guest

Similar Threads

  1. Mysql infinite loop?!
    By StockN@gmail.com in forum MySQL
    Replies: 1
    Last Post: May 9th, 11:06 PM
  2. Weird Infinite loop
    By Andrew Milne in forum PHP Development
    Replies: 4
    Last Post: September 29th, 12:43 PM
  3. Replies: 0
    Last Post: August 30th, 11:02 AM
  4. #25316 [NEW]: _php_stream_write() gets stuck in infinite loop on any error to send()
    By polone at townnews dot com in forum PHP Development
    Replies: 0
    Last Post: August 29th, 06:49 PM
  5. #25037 [NEW]: SentText infinite loop
    By richard at bradders2000 dot co dot uk in forum PHP Development
    Replies: 0
    Last Post: August 11th, 10:25 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139