# Hover Caption Tutorial Help (resizing background square)

**URL:** <https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561>\
**Category:** flash\
**Created:** [July 24, 2003, 5:09am UTC](https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561 "2003-07-24T05:09:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saeven](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@Saeven](https://forum.kirupa.com/u/Saeven)\
**Post date:** [July 24, 2003, 5:09am UTC](https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561/1 "2003-07-24T05:09:01Z")

</div>

Hello,

Thanks in advance for the help.

I’ve completed the Hover Caption tutorial at [http://www.kirupa.com/developer/mx/captions.htm](http://www.kirupa.com/developer/mx/captions.htm) successfully. What I’d like to do in addition, is to resize the caption box to match the caption text’s length.

I’ve tried giving the background box a name (box) and turning it into a button and then doing:

\_root.caption.box.\_width = \_root.caption.help.length \* 8;

But the box never aligns with the text properly after that. I’m totally new to flash and don’t know what methods to call in order to get the bottom corner of the text and bottom corner of the box and align them properly. Any help appreciated greatly.

Kind regards.  
Alex

---

<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:** [July 24, 2003, 5:37am UTC](https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561/2 "2003-07-24T05:37:42Z")

</div>

try this:  
[AS]  
myLength = \_root.caption.help.length\*8; //8 or whatever u want  
setProperty(\_root.caption.box,\_width,myLength);  
[/AS]

e.s.x.s 😉

---

<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:** [July 24, 2003, 5:56am UTC](https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561/3 "2003-07-24T05:56:48Z")

</div>

Hi, I’ve tried that route through different methods. Here is the result:

![](http://whoiscart.net/see.gif)

The first image shows the object and how the text field (called help) and the background orange box (called box) are positioned.

Adding your code to the tutorial button actionscript items that are placed in the mouseovers for the four buttons shown, the results are properly sized boxes in incorrect locations. I would like for the text to be inside the box, not overlapping as shown.

Thanks for the response.  
Alex

---

<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:** [July 24, 2003, 6:05am UTC](https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561/4 "2003-07-24T06:05:55Z")

</div>

ok… change the code to this one:  
[AS]  
myLength= \_root.caption.help.length\*8;  
myWidth= \_root.caption.help.\_width;  
myX = \_root.caption.help.\_x;  
setProperty(\_root.caption.box,\_x,myX+(myWidth/2));  
setProperty(\_root.caption.box,\_width,myLength);  
[/AS]

e.s.x.s

---

<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:** [July 24, 2003, 2:13pm UTC](https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561/5 "2003-07-24T14:13:19Z")

</div>

It seems to move the box, but the result is even more offset than previous.

I’ve posted a stripped fla (to reduce size) here:

[file posted here](http://whoiscart.net/help.zip)

I’ll send $15 Paypal if anyone can help me sort this out. I’m sure it’s a one liner somewhere.

Thanks in advance.  
Alex

---

<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:** [July 24, 2003, 2:31pm UTC](https://forum.kirupa.com/t/hover-caption-tutorial-help-resizing-background-square/26561/6 "2003-07-24T14:31:12Z")

</div>

i have made it for u;)  
but i can’t upload here:( give me your mail and i’ll send u the file…🙂

e.s.x.s
