View Full Version : How?/Why?
AS Newbie here... :o
Could someone be kind enough to explain how Jesse's 'Simple Scrolling Marquee' works. (perhaps Jesse himself-if he's not too busy :) )
>>Clicky here to see what i'm talking about<< (http://www.actionscript.org/showMovie.php?id=356)
-Thank-you-
simail
09-29-2002, 09:16 PM
hi flx,
yea this is a cool way of scrolling.
ok here goes:
onClipEvent (load) {
_root.text = "ActionScript.org ... We put the 'nScri' in 'ActionScript'!... hey give me some credit! I had to think of some text to put here! "
_root.text is declared here, notice that "text"is the instance name given to the dynameic text box.
}
onClipEvent (enterFrame) {
tmp = _root.text.substr(0, 1);
//The substr(start_index,length) function extracts letters from the string. The start index is 0 which is the first letter of the string and the lenghth is one letter. This is given to the variable tmp.
//trace(tmp);
_root.text = _root.text.substr(1, _root.text.length -1)+tmp;
//OK, now _root.text is changednow consists of the string minus the first letter(the index is set to 1 which is letter "c". Jesse now puts the missing letter onto the end with +tmp. I don't know what the -1 is for as it works without it.
//trace(_root.text)
}
you'll notice i've put a couple of traces in. the second one is perticularly intersting as shows what's going on.
____________
regards
simail
K, it makes a lil more sense now. Little tip for you if you didnt already know.. by using [ AS ] [ /AS ] tags you can display actionscript code. Well most of the stuff shows up as it would in the AS window e.g the pinky "//" messages. Well i think it does.. try it and see :)
Thanx again...
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.