Volledige versie bekijken : Auto scroll
thebeatman
%Europe/Berlin %770 %2005, 18:28
Beste mensen!
Ik heb nu een Dynamic text vak gemaakt met de naam "simple_txt" Hierin word een .txt bestand geladen. Dit gebeurt met dit AS:
// create a new loadVars object
mySimpleText = new LoadVars();
// use the loadVars.load() method to retrieve the textfile
mySimpleText.load("my_simple_text.txt");
// use the loadVars.onLoad() event to put the data in the textfield
mySimpleText.onLoad = function(success) {
if (success) {
simple_txt.text = this.mySimpleVar;
} else {
getURL("javascript:alert('Could not load the requested textfile');");
}
};
Kan iemand mij helpen om het zo te maken dat hij automatisch scrollt? Ik heb al van alles nagekeken en geprobeert maar ik krijg het niet voor elkaar.
Groeten,
Ronald
Fatty Owl
%Europe/Berlin %792 %2005, 19:01
hoe bedoel je automatisch scrollt? bedoel je zo? :
this.onEnterFrame = function(){
simple_text.scroll++
}
thebeatman
%Europe/Berlin %795 %2005, 19:05
hoe bedoel je automatisch scrollt? bedoel je zo? :
this.onEnterFrame = function(){
simple_text.scroll++
}
Nou ik zou willen dat dat textvak automatisch scrollt. Het moet namelijk een news ticker worden. Maar waarop zou ik dit AS moeten zetten dan?
theFlashWizard
%Europe/Berlin %802 %2005, 19:15
dmv een interval:
http://www.kirupa.com/developer/actionscript/setinterval.htm
http://www.actionscripts.org/tutorials/intermediate/setInterval/index.shtml
textfield.scroll verhogen..
Fatty Owl, dat gaat wel erg snel hoor.. dat is 12 regels per seconde volgens mij.. :D
thebeatman
%Europe/Berlin %812 %2005, 19:30
Bedankt voor de tip ik snap er nog niet zoveel van maar ik ga het zeker eens goed doorlezen!
Ik heb nu nog een script gevonden waar het mee zou moeten gaan. Maar waar moet ik dit script opzetten?
//START script
scrollerSolved = false
goBackwards = false
APause = setInterval(ScrollBaby, 750);
//calls a function called ScrollBaby every 500 hundreths of a second
//(or .5 second)
function ScrollBaby() {
if (goBackwards != true) {
_root.textInstance.scroll += 1;
}
if (goBackwards == true) {
_root.textInstance.scroll -= 1;
}
//the actual "moving" of the text
if (scrollerSolved != true) {
numberOfLinesExisting = _root.text.scroll;
numberOfLinesCounted += 1;
if (numberOfLinesExisting<=numberOfLinesCounted) {
numberOfLinesCounted = numberOfLinesExisting;
goBackwards = true;
scrollerSolved = true;
}
}
//my algorithm to get the length of the text in the field in lines
temp = _root.text.scroll;
if (temp == numberOfLinesCounted ) {
goBackwards = true;
setInterval(null, 2000) //bounce delay
}
if (1 == _root.text.scroll) {
goBackwards = false;
setInterval(null, 2000) //bounce delay
}
}
Laiverd
%Europe/Berlin %829 %2005, 19:54
http://www.flashfocus.nl/forum/attachment.php?attachmentid=889
thebeatman
%Europe/Berlin %835 %2005, 20:03
Bedankt daarvoor daar kan ik al wat mee. Nu heb ik echter nog een vraag over. Kan ik hem zo maken dat hij de text vanuit een .txt bestand laad en per bericht even stopt. Net als bij deze:
Voorbeeld (http://www.flashfiles.nl/showDetail.asp?TypeId=13&NewsId=8021)
Groeten,
Ronald
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.