Greetings.
My movie worked fine when I imported images to use as buttons. Later, however, I decided I'd swap some of the images as the movie is being played via the loadMovie function. Here's my main function ("p", "numb", and "i" are global variables):
_global.update = function() {
loadVarsText = new LoadVars();
loadVarsText.load("news.txt");
loadVarsText.onLoad = function(success) {
if (success) {
numb = this.num;
p = numb-i+1;
set("se"+0, eval("this.s"+p));
set("da"+0, eval("this.d"+p));
set("bo"+0, eval("this.b"+p));
showtext(0);
set("name", eval("this.s"+p));
loadMovie("head_"+name+".jpg", "head")
loadMovie("previous.jpg", "pre.previous")
loadMovie("next_dim.jpg", "nex.next")
}
}
}
When you click the "previous.jpg" and "next_dim,jpg" images, it is supposed to go through some simple code and update function to load different variables from my text file...but it doesn't. It just displays what was originally imported and doesn't rather than changing it.
Code for the "previous.jpg" image:
on (press) {
if (i<numb) {
i++;
update();
}
}
Code for the "next_dim.jpg" image:
on (press) {
if (i>1) {
i--;
update();
}
}
Thanks.
My movie worked fine when I imported images to use as buttons. Later, however, I decided I'd swap some of the images as the movie is being played via the loadMovie function. Here's my main function ("p", "numb", and "i" are global variables):
_global.update = function() {
loadVarsText = new LoadVars();
loadVarsText.load("news.txt");
loadVarsText.onLoad = function(success) {
if (success) {
numb = this.num;
p = numb-i+1;
set("se"+0, eval("this.s"+p));
set("da"+0, eval("this.d"+p));
set("bo"+0, eval("this.b"+p));
showtext(0);
set("name", eval("this.s"+p));
loadMovie("head_"+name+".jpg", "head")
loadMovie("previous.jpg", "pre.previous")
loadMovie("next_dim.jpg", "nex.next")
}
}
}
When you click the "previous.jpg" and "next_dim,jpg" images, it is supposed to go through some simple code and update function to load different variables from my text file...but it doesn't. It just displays what was originally imported and doesn't rather than changing it.
Code for the "previous.jpg" image:
on (press) {
if (i<numb) {
i++;
update();
}
}
Code for the "next_dim.jpg" image:
on (press) {
if (i>1) {
i--;
update();
}
}
Thanks.