PDA

View Full Version : need help playing separate movie clips in same area


eye5
11-26-2002, 08:39 AM
Hi. I am currently working on a project where the user will have the ability to construct sentences by dragging and dropping 2 of 10 different word choices in between the words "the _ is _." For each sentence that is constructed, a unique animation will play.

My current problem is that I'm not sure how to get each movie clip to play in the same area without them overlapping. I need all of the animations to play in at the same size and in the same area (in the middle of the scene).

If you are interested in taking a look at what I have so far, follow the links below. One is for version 5 and the other MX. If you do decide to download the work in progress, note that the movie clips are set off to the side for now, so the swf's included in the ZIP file won't show them. Any and all assistance and suggestions would be a great help to me. Thanks so much.

http://gladstone.uoregon.edu/~anewton/wordanim_5.zip (Apx. 1.6MB)
http://gladstone.uoregon.edu/~anewton/wordanim_mx.zip (Apx. 2.5MB)

Also, if you have any suggestions of ways to improve what I have done so far, please let me know. Thanks.

-Adam Newton

eyefive@hotmail.com
Multimedia Design BFA Student
University of Oregon

crabcake
11-26-2002, 02:21 PM
If I understand this .fla correctly, you want them to be able to see the movies on the side of the stage in the black area in the center. You want them to see a certain movie based on the combination of words they choose, and you have a movie for all possible combinations. You ccould do this by setting the coordinates of the chosen movie to the center of the stage and making the coordinates of the other movies equivalent to outside the viewable area. You could also set the visibility of all but the chosen movie to false using a recursive function. For both of these to work effectively, however, you would probably need to rename your MCs to sequential form — myMC1, my MC 2 etc. and write some sort of reset code.

I would suggest the easiest way to do this is to place all your little movies into another holding MC. The first keyframe of this holding MC should be blank and have a stop. Each little movie should go into a separte keyframe on the timeline of your holding MC and each of these keyframes should have a unique label. You need to get rid of the stop script in the first frame of each of your little movies, because you will then tell the playhead to go to and stop at the relevant frame in your holding MC. At the moment you have commands like

_root.faith_unknownMC.gotoAndPlay("start");

in your loadMC function, but this would change to

holdingMC.gotoAndStop("faith_unknown");

where the frame "faith_unknown" holds your "faith_unknownMC". You would do this for all of the command lines that are currently in your script.

If you are doing this is FlashMX you might want to use switch, just for the sake of readability. I would probably also have tested for the first condition, then for the second to save having to test both for each option. In other words, instead of

else if (firstword == "intent" && secondword == "dead") {
_root.intent_deadMC.gotoAndPlay("start");
} else if (firstword == "intent" && secondword == "unknown") {
_root.intent_unknownMC.gotoAndPlay("start");
} else if (firstword == "intent" && secondword == "intangible") {
_root.intent_intangibleMC.gotoAndPlay("start");
} else if (firstword == "intent" && secondword == "peaceful") {
_root.intent_peacefulMC.gotoAndPlay("start");
} else if (firstword == "intent" && secondword == "good") {
_root.intent_goodMC.gotoAndPlay("start");

it would be

else if (firstword == "intent"){
if (secondword == "dead"){
_root.intent_deadMC.gotoAndPlay("start");
}else if (secondword == "unknown"){
_root.intent_unknownMC.gotoAndPlay("start");
}else if (secondword == "intangible"){
_root.intent_intangibleMC.gotoAndPlay("start");
}else if (secondword == "peaceful"){
_root.intent_peacefulMC.gotoAndPlay("start");
}else if (secondword == "good"){
_root.intent_goodMC.gotoAndPlay("start");
}
}

Just simply because the machine will then check and ignore any inappropriate first word code and save having to check all those second word option when the first is already an excluding factor.

jcgodart
12-22-2002, 07:15 PM
You can even make it easier:
_root[firstword+"_"+secondword+"MC"].gotoAndPlay("start");
One line to replace all your tests !