Here is the issue, I through some ingenious coding :-/ produced a way how to create dynamically loaded random quotes onto hover captions, I know alot of you helped out and I thank you, the problem is now that it will load all that info but many times almost 90% of the time the caption will be too small to show the text, or too large and the text pops up all the way to the left of the site.
I posted you an image it is supposed to say We design websites, from full Flash sites to small HTML ones, however the excess is cut off, you can see the site at www.qualitytechnologies.net if you need clarity on the issue, I believe I also have a fla example file but I may be wrong, here is parts of the code:
The code for the hover caption on frame xx
[AS]
hover_mc.b1.onRollOver = function() {
captionFN(true, this);
this.onRollOut = function() {
captionFN(false);
};
};
hover_mc.b2.onRollOver = function() {
captionFN(true, this);
this.onRollOut = function() {
captionFN(false);
};
};
…
captionFN = function (showCaption, bName) {
if (showCaption) {
_root.createEmptyMovieClip(“hoverCaption”, this.getNextHighestDepth());
//cap.desc.text = captionText;
cap._width = 7*cap.fill_text.text.length;
cap._alpha = 75;
//
if ((bName._width+bName._x+cap._width)>Stage.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2+cap._width;
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]
The random loading code, on frame 1-6 on the hover_mc clip, there are 6 buttons there from b1 to b6 of course.
[AS]
/****************************************
Random Quotes Script*****************
****************************************/
ranQuote = new LoadVars();
ranQuote.onLoad = function(success) {
if (success) {
RanNum = Math.ceil(Math.random()*5);
ran = this[“filltext”+RanNum];
_root.cap.fill_text.text = ran;
}
else {
_root.cap.fill_text.text = “The text failed to load due to an error”;
}
}
ranQuote.load(“comprepair.txt”);
stop();
[/AS]
And each button uses a type of this to start the random code:
[AS]on (rollOver) {
gotoAndStop(“1”);
}[/AS]
That should be enough to start off at least, I do see what the problem is, the hover caption code will continue to play regardless of the random code, I need a stop/reset code somewhere but can’t figure out where.
Someone please help me I have been working on this thing for about a month now, and now it is getting really fun. Thank you.