Question
Maximum nested display containers?
Hi,
This question is as much about best practice in building flash apps as it is about a specific problem I'm having. Is there a limit on the number of layers of display object containers that can be nested? I'm trying to build a web site, and currently, it's structured as follows: A preloader loads the main swf. The main swf displays a menu, and loads a different swf for each menu choice. One of the menu choice swf's in turn loads a swf. So, there is a maximum of 4 levels of nested display object containers in my app.
My problem is that display objects in the fourth level are not accessible from the third level. When I try to reference the fourth level .content from the third level, I get mixed results. For example, I'm able to listen for timeline-related events, like ENTER_FRAME, and to use methods like gotoAndPlay, but any reference to a display object in the fourth-level container results in a null object reference error. I tried running a function that recursively lists display objects by container, and it lists everything fine until it gets to the fourth level, at which time a null object reference error is issued. The display objects that I'm trying to reference are present in every frame of the 4th-level swf.
Is there a better way to structure a flash app than loading multiple layers of swf's? Is there a recommended maximum of or actual limitation on the number of sub-containers in an app?
--Dave
This question is as much about best practice in building flash apps as it is about a specific problem I'm having. Is there a limit on the number of layers of display object containers that can be nested? I'm trying to build a web site, and currently, it's structured as follows: A preloader loads the main swf. The main swf displays a menu, and loads a different swf for each menu choice. One of the menu choice swf's in turn loads a swf. So, there is a maximum of 4 levels of nested display object containers in my app.
My problem is that display objects in the fourth level are not accessible from the third level. When I try to reference the fourth level .content from the third level, I get mixed results. For example, I'm able to listen for timeline-related events, like ENTER_FRAME, and to use methods like gotoAndPlay, but any reference to a display object in the fourth-level container results in a null object reference error. I tried running a function that recursively lists display objects by container, and it lists everything fine until it gets to the fourth level, at which time a null object reference error is issued. The display objects that I'm trying to reference are present in every frame of the 4th-level swf.
Is there a better way to structure a flash app than loading multiple layers of swf's? Is there a recommended maximum of or actual limitation on the number of sub-containers in an app?
--Dave