# Externally Load Text for Hover Captions

**URL:** <https://forum.kirupa.com/t/externally-load-text-for-hover-captions/223354>\
**Category:** flash\
**Created:** [April 21, 2007, 6:26pm UTC](https://forum.kirupa.com/t/externally-load-text-for-hover-captions/223354 "2007-04-21T18:26:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![briand5](https://avatars.discourse-cdn.com/v4/letter/b/c0e974/32.png) [@briand5](https://forum.kirupa.com/u/briand5)\
**Post date:** [April 21, 2007, 6:26pm UTC](https://forum.kirupa.com/t/externally-load-text-for-hover-captions/223354/1 "2007-04-21T18:26:47Z")

</div>

Hi, I am trying to modify the hover caption tutorial from here at Kirupa to load the text in the caption from an external text file. Could anyone give me a hand trying to figure this out? I tried the simple way of loading external text but because the text is loaded in a MovieClip this does not work. Here is my code for the hover menu that currently loads the text dynamically through ActionScript:

> 

MovieClip.prototype.resize = function() {  
var w = box.caption.textWidth+0  
var h = box.caption.textHeight+0;

};  
Button.prototype.hover = function(refuge) {  
this.onRollOver = function() {  
\_root.x = 1;  
box.createTextField(“caption”, 1, box.test.\_x+3, box.test.\_y-145, 2000, 500);  
box.caption.type = “dynamic”;  
box.caption.html = true;  
box.caption.color = “FFFFFF”;  
box.caption.multiline = true;  
box.caption.wordWrap = true;  
box.caption.size = 10;  
box.caption.htmlText = refuge;  
box.caption.autoSize = “left”;  
box.test.resize();  
};  
this.onRollOut = function() {  
\_root.x = 0;  
box.caption.text = " ";  
};  
};

item1.hover(“\<font face="Arial"\>\<font color=‘#ffffff’\>\<font size="15"\>\<b\>This is my Text1\</font\>”)  
item2.hover(“\<font face="Arial"\>\<font color=‘#ffffff’\>\<font size="15"\>\<b\>This is my Text2\</font\>”)  
item3.hover(“\<font face="Arial"\>\<font color=‘#ffffff’\>\<font size="15"\>\<b\>This is my Text3\</font\>”)  
item4.hover(“\<font face="Arial"\>\<font color=‘#ffffff’\>\<font size="15"\>\<b\>This is my Text4\</font\>”)  
item5.hover(“\<font face="Arial"\>\<font color=‘#ffffff’\>\<font size="15"\>\<b\>This is my Text5\</font\>”)  
stop();

Thank you for any help,  
Brian
