Hey all,
I’m making a site in Flash MX, and I have dynamic text boxes so that the data can be easily changed. For navigation I’m using rollover buttons.
My rollover buttons are actually movie clips. I don’t like to use buttons for rollover animations because when you roll off of them, they jump back to their normal state without a smooth transition. This doesn’t look too good.
When a user navigates the site and clicks, I want the rollover buttons to load up dynamic text in 2 different boxes (header and content) from a .txt file on the server.
I did this successfully with regular buttons, but for some reason, the exact same actionscript doesn’t work with the movieclips. How come? I did this from a tutorial on this site. Heres my code for the movie clips:
on (rollOver) {
this.gotoAndPlay("roll_on");
}
on (rollOut) {
this.gotoAndPlay("roll_off");
}
on (release) {
loadText = new loadVars();
loadText.load("contactContent.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
scroller.html = true;
scroller.htmlText = this.contactContent;
}
};
loadText = new loadVars();
loadText.load("contactHeader.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
header.html = true;
header.htmlText = this.contactHeader;
}
};
}
Thanks for your help!