[AS] XML SMS ticker

Pagina: 1
Acties:
  • 41 views sinds 30-01-2008

  • Jermaine
  • Registratie: Januari 2003
  • Laatst online: 24-04 17:56
Hoi,

Ik heb een probleempje en kom er niet meer uit.. Ik heb een script gemaakt voor een sms ticker.. maar moet het smsje automatisch laten laden en niet doormiddel van buttons naar het volgende smsje gaan..

Kan iemand mij Helpen? Dit is de code.

Alvast bedankt!

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;

username = [];
nickname = [];
image = [];
text = [];

total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {


username[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
nickname[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
image[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
text[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;

}
firstImage();

} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {

if (Key.getCode() == Key.LEFT) {

prevImage();

} else if (Key.getCode() == Key.RIGHT) {

nextImage();

}

};
Key.addListener(listen);
previous_btn.onRelease = function() {

prevImage();

};
next_btn.onRelease = function() {

nextImage();

};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {

filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {

preloader.preload_bar._xscale = 100*loaded/filesize;

} else {

preloader._visible = false;
if (picture._alpha<100) {

picture._alpha += 10;

}

}

};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[p], 1);
user_txt.text = username[p];
nick_txt.text = nickname[p];
text_txt.text = text[p];

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
user_txt.text = username[p];
nick_txt.text = nickname[p];
text_txt.text = text[p];


}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
user_txt.text = username[0];
nick_txt.text = nickname[0];
text_txt.text = text[0];


}

}

  • Niakmo
  • Registratie: Juni 2001
  • Laatst online: 10-02-2024
Dit is precies de code die op kirupa.com staat in een van de tutorials. Staat genoeg uitleg zou ik zeggen.


maar toch even een hint

code:
1
mijnInterval  =  setInterval(nextImage, 4000);


net deze regel zet je een interval dat hij om de 4000 ms de fucntie nextImage uitvoerd. Nu alleen nog even iets inbouwen dat hij bij het aankomen bij het laatste smsje doorgaat naar het eerste smsje.

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Jermaine: wil je voortaan toch iets beter kijken naar de regeltjes die wij hebben op dit forum (specifiek voor WG: [rml][ W&G FAQ] Welkom in W&G: FAQ en Beleid[/rml]).

Het is niet de bedoeling om kant en klare code hier neer te zetten, zonder enige eigen inzet.

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


Dit topic is gesloten.