256 Levels of recursion
November 27th, 2007 . by polyGeekIf you didn’t know, the magic ingredient to video.Maru is recursion. And recursion can be a dangerous thing when it isn’t controlled because it leads to infinite loops. But even if it is controlled the Flash player halts after 256 recursive calls because it thinks it has reached an infinite loop.
I wish they would up the number of recursive calls to something around 1024 loops but that’s another story.
Here is the error message you would see if you go over 256 recursions:
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.
Here’s the simple solution to fixing this if this happens to you while using video.Maru. Simply select everything that is a part of your video player - including the video.Maru SWC - and hit F8 to convert it to a MovieClip. It doesn’t matter what you name the MovieClip and it doesn’t need an instance name.
That should fix everything for you.
The reason for this is that the video.Maru SWC is on the same level with lots of other MovieClips and buttons on your stage. So when video.Maru runs it recursively runs through everything from the level it is on to see if it is a part of the video interface. By placing only the video interface elements into a MovieClip it isolates the rest of your FLA from video.Maru.
An analogy of what’s happening
If you have a site built in Flash you could think of your FLA as a forest. The Stage is like the forest floor and the trees are your MovieClips. And each tree has branches and leaves just like MovieClips have other MovieClips nested inside.
So if you put video.Maru on the forest floor - the Stage - it would recursively try and crawl through every tree in the forest. But your video interface is usually just one specific tree in the forest. So you need to put video.Maru on just that tree. It will now recursively crawl through just that tree but won’t climb down and attempt to crawl through other trees.






