Page is a not externally linkable
stevenb_1959 - 12:20 pm on Sep 12, 2006 (gmt 0)
Below is my code, the text files are named the same at this point until I have one dynamically loaded text area functioning properly. // ----------------<Load CSS>--------------------- \\ //this.loadedInfo.info.load ("vars/tony_hyde_interview.txt"); //loads text into dynamic text box called loadedinfo // set the alignment of the submenu options to autoSize right // create TextFormat objects that define the states of the submenu options // disable the submenu option that corresponds to the currently-loaded section // re-enable the submenu options //--------------<Reviews option>-----------------\\ //--------------<features option>-----------------\\ //--------------<OTHERS option>-----------------\\ Any help would be greatly appreciated:)
I amnot sure exactly how you code is incorporated into my existing code.
The three dynamically loaded texts are "reviews" in the reviews options area,"features" in the features option area and the "other" in the other options area.
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.load("styles/styles.css");
cssStyles.onLoad = function (success:Boolean) {
if (success) {
loadedInfo.styleSheet = cssStyles;
} else {
loadedInfo.text = "There has been a problem loading the requested information. Please contact the Webmaster and report your error.";
}
}
// ----------------</Load CSS>--------------------- \\
// ----------------<scroll buttons>--------------------- \\
this.scrollDown.onPress = function() {
scrollDirection = "down";
scrollText();
}
this.scrollUp.onPress = function() {
scrollDirection = "up";
scrollText();
}
this.scrollUp.onRelease = function() {
delete _root.onEnterFrame;
}
this.scrollDown.onRelease = function() {
delete _root.onEnterFrame;
}
function scrollText() {
_root.onEnterFrame = function() {
if (scrollDirection == "up") {
loadedInfo.scroll -= 1;
} else if (scrollDirection == "down") {
loadedInfo.scroll += 1;
}
}
}
// ----------------</scroll buttons>--------------------- \\
loadText = new LoadVars();
loadText.load("vars/tony_hyde_interview.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
loadedInfo.html = true;
loadedInfo.htmlText = this.loadedInfo;
}
};
this.reviewsMC.reviews.autoSize = "left";
this.featuresMC.features.autoSize = "left";
this.otherMC.other.autoSize = "left";
var btnDisable:TextFormat = new TextFormat("Bitstream Vera Sans", 12, null, true, true);
var btnEnable:TextFormat = new TextFormat("Bitstream Vera Sans", 11, null, false, true);
this.ourHistoryMC.ourHistory.setTextFormat(btnDisable);
this.ourHistoryMC.enabled = false;
function reEnableOptions() {
this.reviewsMC.enabled = true;
this.reviewsMC.reviews.setTextFormat(btnEnable);
this.featuresMC.enabled = true;
this.featuresMC.features.setTextFormat(btnEnable);
this.otherMC.enabled = true;
this.otherMC.other.setTextFormat(btnEnable);
}
this.reviewsMC.onRollOver = function() {
this.reviews.setTextFormat(btnDisable);
}
this.reviewsMC.onRollOut = function() {
this.reviews.setTextFormat(btnEnable);
}
this.reviewsMC.onRelease = function() {
reEnableOptions();
this.reviews.setTextFormat(btnDisable);
this.enabled = false;
//loadedInfo.text = "";
//loadedInfo.text = newTextloaded
loadText = new LoadVars();
loadText.load("vars/tony_hyde_interview.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
loadedInfo.html = true;
loadedInfo.htmlText = this.loadedInfo;
}
};
}
//--------------</Reviews option>-----------------\\
this.featuresMC.onRollOver = function() {
this.features.setTextFormat(btnDisable);
}
this.featuresMC.onRollOut = function() {
this.features.setTextFormat(btnEnable);
}
this.featuresMC.onRelease = function() {
reEnableOptions();
this.features.setTextFormat(btnDisable);
this.enabled = false;
loadText = new LoadVars();
loadText.load("vars/berlinafeatures.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
loadedInfo.html = true;
loadedInfo.htmlText = this.loadedInfo;
}
};
}
//--------------</features option>-----------------\\
this.otherMC.onRollOver = function() {
this.other.setTextFormat(btnDisable);
}
this.otherMC.onRollOut = function() {
this.other.setTextFormat(btnEnable);
}
this.otherMC.onRelease = function() {
reEnableOptions();
this.other.setTextFormat(btnDisable);
this.enabled = false;
loadText = new LoadVars();
loadText.load("vars/tony_hyde_interview.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
loadedInfo.html = true;
loadedInfo.htmlText = this.loadedInfo;
}
};
}
//--------------</OTHERS option>-----------------\\
thanks
Steve