Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : infinite loop error... Braking my head


kglad
2/1/2004 9:45:01 PM
copy and past your loadMovieNum statements.

Alejandro Ramos
2/1/2004 9:57:42 PM
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
2/2/2004 10:44:06 AM
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$1@forums.macromedia.com, "kglad"
[quoted text, click to view]
Alejandro Ramos
2/2/2004 11:39:48 AM
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?













kglad
2/2/2004 3:21:46 PM
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.

Alejandro Ramos
2/2/2004 9:44:38 PM
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
2/3/2004 11:28:56 AM
OK, you can get the .fla files and see the example at:

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

Please let me know what you think

Thanks again

Alejandro
kglad
2/3/2004 2:34:20 PM
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
2/3/2004 5:30:25 PM
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$1@forums.macromedia.com, "kglad"
[quoted text, click to view]
kglad
2/4/2004 1:39:43 AM
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
2/4/2004 12:45:06 PM
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$1@forums.macromedia.com, "kglad"
[quoted text, click to view]
kglad
2/4/2004 2:54:52 PM
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.

AddThis Social Bookmark Button