Reveal

 
Index > Teachers Animation Toolkit > Reveal > Editing the code

Click on frame 1 of the scripts layer and then make the actions (code) window visible using F9.

 

The existing code contains a function to look for all those labels and hotspots you added so that they can be referred to in other functions that show or hide them when the movie starts and when the user clicks on the two buttons.

 

This is why it is important that you named them all according to the conventions mentioned in the instructions (i.e. label5 and hotspot12).

 

The movie displays a prompt when the user passes the mouse over a hotspot. So now you need to add these prompts (one per label). Find the code below and add new entries for each label. I have added an example in red.

 

// add the prompts to show when the mouse rolls over each hotspot
prompt[1] = "What C protects the bone?";

prompt[2] = "What F is this bone?";

 

If you don't want to use the feature simply delete this bit of code or edit the first prompt so that it reads:


prompt[1] = "";

 

Finally, if you are sticking with the prompts, each hotspot needs a tag so that the movie knows which prompt to display when the mouse passes over them. If you have more than one hotspot for each label, the tags will be the same.

 

// give the matching label for each hotspot
hotspot1.tag = 1;
hotspot2.tag = 1;
hotspot3.tag = 1;

 

The code above shows that the first three hotspots are all linked to label1 and so they all have the same tag value.

 

Add a reference to each hotspot and then work out which label each one belongs to and therefore which prompt you want to be displayed. If this isn't clear, you might want to have a look at the template for the fully working example.

 

If you use very long prompts, you might find that they don't fit in the dynamic text box on the stage.

 

Select the text box (it is on the controls layer).

 

Use its properties window to alter the font size or you could make it multiline once you have double-clicked into it and used the handle to drag it into a different size.

the output box

 

output box properties window