Tuesday, 22 September 2009

scroll bar

Create 2 lyers "actions" and "Lyer 1"

Add actionscript for lyer "actions" on frame 1 :


ms = textbox.Message.maxscroll; if (ms>1) { if (dragpress<1) { scale = 138/ms; _root.textbox.scrollbar.scrollbox._yscale = 200/textbox.Message.maxscroll; _root.textbox.scrollbar.scrollbox._y = -68+((textbox.Message.scroll-1)*scale); if (textbox.scrollbar._visible == false) { _root.textbox.scrollbar._visible = true; } } else if (textbox.scrollbar.scrollbox._y<-66 and move<0) { move = 0; textbox.scrollbar.scrollbox._y = -68; } else if (textbox.scrollbar.scrollbox._y+textbox.scrollbar.scrollbox._height>69 and move>0) { move = 0; } else { textbox.scrollbar.scrollbox._y = textbox.scrollbar.scrollbox._y+(move*scale); textbox.Message.scroll = ((textbox.scrollbar.scrollbox._y+68)/scale)+1.2; } } else { if (textbox.scrollbar._visible == true) { textbox.scrollbar._visible = false; } }
Add actionscript for lyer "actions" on frame 2:

gotoAndPlay (1);
Create MC (emailmovie) for lyer "Lyer 1" and in INSTANS window name is a "textbox"



Edit MC (emailmovie)



Lyer 2 has an actionscript on frame 1

loadVariables ("message.txt", "_root.textbox"); stop ();
Lyer 1 has a text field on frame 1
Lyer 3 has a MC scrollbar on frame 1 and in INSTANS window name is a "scrollbox"

No comments: