Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

flash mx 2004 125 component limit?? 2

Status
Not open for further replies.

jcaulder

Programmer
Apr 22, 2002
241
US
I have been creating a very extensive, datacentric web application using Flash MX 2004. This application will have many forms and many, many components on each form. I am just starting and already have 155 components on 4 forms.

My question is, I was browsing the help system and came across the following:

"Use components whenever possible to create interactivity. Put no more than 125 total component instances in a single FLA file."

I am new to Flash so I hope I'm just reading this wrong. This doesn't truly mean my application can only have 125 components does it?? If so, what is my alternative if I want to develop an application with perhaps 500 components(textinput, buttons, forms, etc) or more?

Thanks!
 
You can make several FLA's (which will eventually become SWF's) and you can call and load them into a single movie clip as needed.

There's always a better way. The fun is trying to find it!
 
The main reason we used Flash was to have a seamless experience for the user coming through the web. It seems multiple swf's would prohibit this.

Or are you saying you can have a primary, parent swf that controls and (pre)loads the others as needed so it still appears seamless to the user? And perhaps the parent swf can track all necessary variables through some communication to the child swf's?

While this seems to add a lot of complexity, if it works, I can still manage. Do you know of any sites that show a basic example of building an application using this framework? I have had great difficulty in finding any realistic examples of 'industrial strength' applications built using Flash MX 2004.

Apparently, the 125 is just a recommendation because I have already exceeded that without any notice of problems. However, I didn't want to go too much farther without understanding the full implications of this.

Thanks for the reply!


 
Looks like swf's from the same domain can share data, methods, etc. without much problem according the AS2.0 Reference Manual. I guess that would alleviate my problem.

I will just break the application into logical, separate swf's and load each as needed. Still not completely sure how the navigation will work since all the swf's will be form based and only one form from a swf can be visible at a time. I guess I can hide one swf and reveal another from the parent swf?

Still some work to do but looks like it is possible. I wonder if the "125 components" is just a recommendation to reduce complexity and file size or if there is some inherent bug in Flash. File size isn't that big of an issue because all users will be on broadband connections as this will be a corporate, although distributed internet, application. Furthermore, file size doesn't really grow much after you've used the components on a previous form since they are already included in the swf.

Guess I'll keep digging. Maybe I'll keep building on what I have until I crash Flash. I've never heard of any development environment that physically limited the number of buttons, forms, etc. available to the developer. Seems a little unusual. Unless they are using an array with fixed length to store object references. But that wouldn't make sense and would also imply a hard value of 125(which I've exceeded).

Anyway, if anyone knows the true meaning behind the 125, I'd love to know!
 
You can add multiples swf's to a main timeline at run time by using the loadMovieNum(); action. You then begin to work on multiple z levels. You can address any movie on any level by preceding the call by the level number just as you would the _root level. (ie: _level1, _level2, etc...)

An example:
Load the second movie into your main movie:
Code:
loadMovieNum("movie1.swf",1,"GET");

to address the main timeline of the movie above:
Code:
_level1.timeLine.gotoAndPlay(1);

This procedure is fairly commonly used for even non-application flash movies as a method of optimization. I would think that this could actually work to your benefit as you would only have to load things (components) as they are needed rather than loading all of the components at once.

What you will find is that loading new swf's into another movie at runtime will not effect the state of your main movie. You will still be able to enjoy persistant state.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
Pixl8r is right - this is a common method in Flash and is executed very well. I've used this method, although on a limited scale, and was quite pleased with the results. The added benefit is that your file loads faster and you have more flexibility - you can call and load only the SWF's that are necessary to the user's experience/requirements rather than load an entire large file when the user actually needs, or wants, just a portion of it.

There's always a better way. The fun is trying to find it!
 
Ok, well these posts have helped tremendously.

One last question: Is it easy to hide one swf and its form while revealing another swf and its form.

Oh, I guess you use the 'gotoAndPlay' method of the desired swf to show it and hide the current playing swf. Then, you merely have to make the desired form visible in the current swf.

So using this method, you have the _root level to contain the main navigation which when selected by the user, plays(and loads if necessary) the required nested swf and makes visible the necessary form contained within it. SWF's that aren't currently active still maintain their state, they just aren't playing. If the user is sent back to them, they would still be loaded and contain the data they last had when the user left them.

If I've understood all of this, I think you have given me the solution. I was worried for a while there.

Thanks to both of you for the responses! Just have to rethink my navigation scheme somewhat now.
 
The answer to your visibility questions is yes... it's easy. You can change the visibility of the different movies (levels) by using _visible. Ex:

Code:
_level1._visible=false;

Make sure that you load the movies on different levels (1,2,3,...) if you want them all to stay loaded. If you load a movie into the same level as a previous movie the previous movie will be unloaded.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
if using flash 7, make sure the parent swf doesn't itself have any flash 7 components, as there are issues with a swf with flash 7 UI components loading other such swfs into it.

Philip Keiter
Senior Flash Software Developer
Sphyrras
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top