I want to load in text based in a text file on a site all by 1.txt, 2.txt … up to 20.txt. I had them load by rollover and put the text in a box but the client doesn’t want it that way they want the info to pop-up so I went with a hover caption trying to get the text to pop-up instead of filling the box. To my suprise the tut for the Hover captions is loaded -into- the captions in the actionscript I need to know the code to fill the caption with the text that gets loaded in each frame like so…
{AS}
stop();
loadText = new LoadVars();
loadText.load(“1.txt”);
//creating the loadVarsText function
loadText.onLoad = function() {
bone_txt.text = this.bonetext;
};{/AS}
And of course here is the caption code as far as I got it, not working btw… (cut off at button 5 for better readability)
[AS]
b1.onRollOver = function() {
captionFN(true, bone_txt, this);
this.onRollOut = function() {
captionFN(false);
};
};
b2.onRollOver = function() {
captionFN(true, bone_txt, this);
this.onRollOut = function() {
captionFN(false);
};
};
b3.onRollOver = function() {
captionFN(true, bone_txt, this);
this.onRollOut = function() {
captionFN(false);
};
};
b4.onRollOver = function() {
captionFN(true, bone_txt, this);
this.onRollOut = function() {
captionFN(false);
};
};
b5.onRollOver = function() {
captionFN(true, bone_txt, this);
this.onRollOut = function() {
captionFN(false);
};
};
captionFN = function (showCaption, captionText, bName) {
if (showCaption) {
_root.createEmptyMovieClip(“hoverCaption”, this.getNextHighestDepth());
cap.desc.text = captionText;
cap._width = 7*cap.desc.text.length;
cap._alpha = 75;
//
if ((bName._width+bName._x+cap._width)>Stage.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
hoverCaption.onEnterFrame = function() {
cap._x = _root._xmouse+xo;
cap._y = _root._ymouse+yo;
cap._visible = true;
};
} else {
delete hoverCaption.onEnterFrame;
cap._visible = false;
}
};
[/AS]