PDA

View Full Version : Getting movie properties dynamically



GKFC
September 3rd, 2003, 09:58 PM
Hi all,

Currently I have a stage.swf (the parent) which loads child movies "inside itself" into an area called external.

Currently, for each of these movies I have to set properties in stage such as:

Movie Name,
Movie Title,
Length (how many frames)

Now, the annoying part of this is the length. If at any point I decide I want to add or remove a scene from a child, I have to reset the relevant "length" variable on stage.

what I really want to know is, is there a way that when each of the child movies load, stage can find out dynamically how many frames they have?

I can create a Movie Class to have all these variable declarations in one place, but that doesn't really solve the problem I have. I'd still have to manually go through and change variables ad hoc....

Still, the way I have got it at the moment works, but I just want to make it sexier if possible

;)

Thanks for your time,

G.

claudio
September 3rd, 2003, 10:15 PM
Im guessing you are loading them into a movie clip called external.
trace(external._totalframes);//outputs the number of frames

GKFC
September 4th, 2003, 02:10 AM
thanks for your reply!!

trouble is, I use ActionScript on each of the frames of the child movies to control the path flow through them.

Furthermore, in some of the child movies there are movies WITHIN them that will count towards the total number of frames in the movie....

all I really want to get a count of is the total number of ActionScript frames in each of the child movies.... not the total combined number of frames....

using the code above seems to output the right answer occasionally, but will break once it gets to one of the child movies that contains submovies and display an incorrect number....

hmmm....

Jack_Knife
September 4th, 2003, 06:18 AM
You could have all the frames add to a variable when they are run for the first time, but then all the frames would have to be run b4 you can get the result. Other than that, i'm not sure.