-
Scroll text/html text
Awhile back, someone was nice enough to let me use his scrolling text box for my site.
It works wonderfully, but I really need to distinguish certain text with either bold, italic, or color.
Is it possible to add html text code to this scroll box. I'm not very good with actionscript so any help would be very much appreciated.:
<b>function scroller(f, x, y, w, h, e, o, l, c, r) {
var z = 0;
p.removeMovieClip();
function drawsquare(t, n, w, h, c, b) {
t.createEmptyMovieClip(n, ++z);
typeof (c) == "string" ? t[n].lineStyle(c, b) : t[n].lineStyle(1, b);
typeof (c) == "string" ? t[n].beginFill(0xffffff, 0) : t[n].beginFill(c);
t[n].lineTo(w, 0);
t[n].lineTo(w, h);
t[n].lineTo(0, h);
t[n].endFill();
return t[n];
}
function scrollcontent(xy) {
ra = r;
dy = 0-((xy/(y+h))*mc._height);
updateAfterEvent();
mc.onEnterFrame = function() {
Math.round(dy) == Math.round(mc._y) ? delete mc.onEnterFrame : mc._y += (dy-mc._y)*ra, ra += r*r;
};
onMouseUp=function() {
delete onMouseMove;
}
}
p = this.createEmptyMovieClip("scrollinglayer", ++z);
p._x=x, p._y=y;
mc = p.createEmptyMovieClip("textlayer", ++z);
fm = new TextFormat(o, l, c, null, null, null, null, null, null, w/e/2, w/e);
lv = new LoadVars();
lv.load(f);
lv.onData = function(r) {
s = r.toString().split("\r\n").join("\n");
mc.createTextField("tf", 0, w/e, 0, w, h);
mc.tf.wordWrap = true;
mc.tf.autoSize = true;
mc.tf.setNewTextFormat(fm);
mc.tf.text = s+"\n";
};
o = drawsquare(p, "o", w, h, "1", c);
b = drawsquare(p, "b", w/e, h, "1", c);
k = drawsquare(p, "k", w/e, h, c, c);
d = drawsquare(p, "d", w/e, l+e, c, c);
m = drawsquare(p, "m", w, h, c, c);
d.setMask(k), mc.setMask(m);
d.onPress = function() {
delete this.onEnterFrame;
d.startDrag(false, d._x, 0, d._x, h-(d._height-1));
d.onRelease = d.onReleaseOutside=d.onMouseUp=function () {
d.stopDrag();
};
onMouseMove = function () {
scrollcontent(d._y);
};
};
b.onPress = function() {
scrollcontent(_ymouse-(d._height));
d.y>h-(d._height-1) ? d.y=h-(d._height-1) : d.y=Math.round(_ymouse)-d._height;
d.onEnterFrame = function() {
d.y>h-(d._height-1) ? d.y=h-(d._height-1) : Math.round(d._y) == d.y ? delete d.onEnterFrame : d._y += (d.y-d._y)*ra;
};
};
}
//scroller("faq.txt", xposition, yposition, width, height, percentage, "fontfamily", fontsize, color, scroll speed);
scroller("faq.txt", 0, 0, 520, 390, 40, "verdana", 15, 0xb3b3b3, .1);</b>
-
That's awefully complex code for a simple text scroller. At least for me.
-
lol, well, for me too. I didn't write it and I'm lost lol
But still, it's a very cool scrolling text box.
-
This is most probably Moagrius' script, and yes he likes complicated scripts. He's mostly on the actionscript forum, so you should post on that forum, and ask him!
http://www.flashkit.com/board/forumd...php?forumid=30
-
i heard my name...
the o, l, and c parameters are font-family, font-size and color respectively.
if you want more than that, take this line
Code:
fm = new TextFormat(o, l, c, null, null, null, null, null, null, w/e/2, w/e);
and beneath it put
Code:
fm.bold = true;
fm.italics = true;
fm.underline = true;
fm.indent = 4;
fm.leading = 6;
fm.color = 0x000000;
fm.size = 12;
//etc...
whatever properties you want to affect. for a complete list of properties, go to the help docs and look up TextFormat class.
-
i heard my name...
Yeah sure! And I have land for sale in Florida!
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|