# Caption displayed in a specific area

**URL:** https://forum.kirupa.com/t/caption-displayed-in-a-specific-area/28821
**Category:** Uncategorized
**Created:** [August 19, 2003, 12:55am UTC](https://forum.kirupa.com/t/caption-displayed-in-a-specific-area/28821 "2003-08-19T00:55:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![trevorsaint](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/trevorsaint/32/268_2.png) [@trevorsaint](https://forum.kirupa.com/u/trevorsaint)
#### Post date: [August 19, 2003, 12:55am UTC](https://forum.kirupa.com/t/caption-displayed-in-a-specific-area/28821/1 "2003-08-19T00:55:24Z")

</div>

Hi all.

What I am after is when rollover button for a caption to be displayed in a particular location that has been prepared, rather like the caption tutorial, except this will be revealing more than a word but rather a sentence. I already have an effect for the rollovers and would like to know a good way of doing this. I have four buttons and require a caption for each on rollover,

anyone have ideas??

T

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2003, 1:29am UTC](https://forum.kirupa.com/t/caption-displayed-in-a-specific-area/28821/2 "2003-08-19T01:29:34Z")

</div>

Make the sentence and put it where you want - turn it into a movieClip. Give the sentences instance names like sentence1 and sentence2, etc. Then put these actions on the sentence movieClip: (eg - sentence1)

```auto

onClipEvent(load){
this._visible=false;
}

```

Then add this to the button actions:

```auto

on(rollOver){
_root.sentence1._visible=true;
}
on(rollOut){
_root.sentence1._visible=false;
}

```

That’ll do it.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2003, 1:41am UTC](https://forum.kirupa.com/t/caption-displayed-in-a-specific-area/28821/3 "2003-08-19T01:41:40Z")

</div>

Two ways:

1. Create moviclips of your captions, put them on the stage and give them instance names (captionMC1, captionMC2 etc.)

Declare their visibility false on the first frame:  
[AS]captionMC1.\_visible = false;  
captionMC2.\_visible = false;[/AS]  
Then type this action for the button:  
[AS]on (rollOver) {  
\_root.captionMC1.\_visible = true;  
}  
on (rollOut) {  
\_root.captionMC1.\_visible = false;  
}[/AS]  
2. You can use a dynamic text box and do it all with actionscript. Create a dynamic text box big enough for your caption, then give it a variable name like “caption”.

On the button type:  
[AS]on (rollOver) {  
caption = “Your caption here”;  
}  
on (rollOver) {  
caption = " ";  
}[/AS]  
Method 2 would be easier for more buttons, but you can play around with the appearance of movieclips more than dynamic texboxes.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [August 19, 2003, 2:27am UTC](https://forum.kirupa.com/t/caption-displayed-in-a-specific-area/28821/4 "2003-08-19T02:27:19Z")

</div>

Thanks for your responses, I will try them out asap

Trev
