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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple movie clips - on release 1

Status
Not open for further replies.

simonWMC

Programmer
Dec 2, 2002
180
GB
hi guys

I am trying to create a frame with 3 questions on it. The user answers either yes or no to all the questions. They are free to answer the questions in any order and are given feedback for each answer they select.

I have created a box on the same frame that i want the feedback to appear in. I have used a separate movie clip for each bit of feedback (6 x MC)

The problem is, that the overlap.
I am using the movieclipname.play () method. I also have the feedback on the second frame of each MC, with nothing but a stop () on the first frame so they can sit and be invisable.

I tried to get round this by calling all 6 MC's on each button, but setting five to movieclipname.play () and the one i want to work to movieclipname.play (2). But this doesn't help

any ideas ?

suppose i could play with the visability ???
 
i would just have one dynamic text box to display all feedback...the contents of the box changing with user interaction.
 
If you need to perform show/hide acions on a series of clips it's a good idea to use numbered clips so that you can go through all of them with a loop - such as 'movieclip1', 'movieclip2' etc:

Have some code like this on the main timeline which runs through all of the clips turning them invisible/visible depending on which button is pressed:

function showHideClips(targetClip) {
for (var i = 1; i<=6; i++) {
if (targetClip != i) {
this['movieclip'+i]._visible = 0;
} else {
this['movieclip'+i]._visible = 1;
}
}
}

And something like this on each button (sending a different value depending on which button it is, this example works for button 5):

on(release){
showHideClips(5);
}

The other option (a beter one I think) is just to have the feedback as text held in an array and depending on which button is pushed an empty dynamic textbox picks up the value of the appropriate feedback:

Main timeline (any strings can go in here or they can be variable references etc):

feedbackArray=['tip1','tip2','tip3','tip4','tip5','tip6'];

Button:

on(release){
dynamicTextBox.text=feedbackArray[3];
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top