Hi all,
I can’t seem to get the external tex file loaded into a dynamic text field.
I am trying to display an external text file into a dynamic text field using a next page button. The layout is this I have 80 frames. Frames 1-10 with a static text field with text & a next page button and Frames 11-20 with a dynamic text field with a previous button. I want to onRelease of the next page button in the first set of 10 frames to load the external text file into the dynamic text field of the next set of 10 frames. Also, being able to jump back and forth from next page to next.
Below I layed out all the contents in my test.fla file.
Hope this will give you an understanding of what I am trying to do.
I need to be able to click a next page button and loading an external text file into a dynamic text field, vice versa.
I have set the variable in the text file.
I used this code to try and load the text file into a dynamic text field, using actinscript. Which frame or frames do I need to include this script in? I know it has got to be multiple ones.
var styles = new TextField.StyleSheet();
styles.load(“cssdocName.css”);
textfieldName.html = true;
textfieldName.styleSheet = styles;
var lv:LoadVars = new LoadVars();
lv.onData = function(content) {
textfieldName.text = content;
}
lv.load(“htmldocName.html”);
Thanks for your time!
I have 6 different layers with 80 frames:
Layer titles:
- labels
- actions
- next_prev buttons
- contents
- tabs
- outline
Now in each layer:
-
outline layer: just an outline border [displayed in Frames 1-80]
-
tabs layer: movie clips tab1, tab2, tab3 within each tab is a movie clip
called bottomline [displayed in Frames 1-80] -
contents layer: Static Text Field [displaying text in Frames 1-10]
Frame 1 ActionScript
stop();
Dynamic Text Field instance name dpmoreinfo_txt
[displayed in Frames 11-20]
Frame 11 ActionScript
stop();
Dynamic Text Field instance name dpmoreinfo2_txt
[displayed in Frames 21-30]
Frame 21 ActionScript
stop();
Static Text Field [displaying text in Frames 31-40]
Frame 31 ActionScript
stop();
Dynamic Text Field instance name spmoreinfo_txt
[displayed in Frames 41-50]
Frame 41 ActionScript
stop();
Static Text Field [displayed text in Frames 51-60]
Frame 51 ActionScript
stop();
Dynamic Text Field instance name cmoreinfo_txt
[displayed in Frames 61-70]
Frame 61 ActionScript
stop();
Dynamic Text Field instance name cmoreinfo2_txt
[displayed in Frames 71-80]
Frame 71 ActionScript
stop();
next_prev buttons
layers: dpmoreinfonext_btn [Frames 1-10]
Frame 1 ActionScript
dpmoreinfonext_btn.onRelease = function() {
gotoAndStop(“dpmoreinfo”);
};
dpprev_btn & dpmoreinfo2next_btn [Frames 11-20]
Frame 11 ActionScript
dpprev_btn.onRelease = function () {
gotoAndStop(“DataPulse”);
};
dpmoreinfo2next_btn.onRelease = function () {
gotoAndStop(“dpmoreinfo2”);
};
dpmoreinfoprev_btn [Frames 21-30]
Frame 21 ActionScript
dpmoreinfoprev_btn.onRelease = function () {
gotoAndStop(“dpmoreinfo”);
};
spmoreinfonext_btn [Frames 31-40]
Frame 31 ActionScript
spmoreinfonext_btn.onRelease = function () {
gotoAndStop(“spmoreinfo”);
};
spprev_btn [Frames 41-50]
Frame 41 ActionScript
spprev_btn.onRelease = function () {
gotoAndStop(“StructurePulse”);
};
cmoreinfonext_btn [Frames 51-60]
Frame 51 ActionScript
cmoreinfonext_btn.onRelease = function () {
gotoAndStop(“cmoreinfo”);
};
cprev_btn & cmoreinfo2next_btn [Frames 61-70]
Frame 61 ActionScript
cprev_btn.onRelease = function () {
gotoAndStop(“Courses”);
};
cmoreinfo2next_btn.onRelease = function () {
gotoAndStop(“cmoreinfo2”);
};
cmoreinfoprev_btn [Frames 71-80]
Frame 71 ActionScript
cmoreinfoprev_btn.onRelease = function () {
gotoAndStop(“cmoreinfo”);
};
labels layer: Frame name is DataPulse [Frame 1-10]
Frame name is dpmoreinfo [Frame 11-20]
Frame name is dpmoreinfo2 [Frame 21-30]
Frame name is StructurePulse [Frame 31-40]
Frame name is spmoreinfo [Frame 41-50]
Frame name is Courses [Frame 51-60]
Frame name is cmoreinfo [Frame 61-70]
Frame name is cmoreinfo2 [Frame 71-80]
Actions layer: Frame 1 ActionScript
contents.stop();
numberOfTabs = 3;
for (i=1; i<=numberOfTabs; i++) {
line = eval(“tab”+i);
line.onRelease = function() {
for (i=1; i<=numberofTabs; i++) {
otherTabs =
eval(“this._parent.tab”+i);
otherTabs.bottomLine._visible =
true;
}
this.bottomLine._visible = false;
contentFrame = Number (this._name.substr(3,
1));
this._parent.contents.gotoAndStop(contentFrame);
}
}
tab1.bottomLine._visible = false;
tab1.onPress = function() {
gotoAndStop(“DataPulse”);
};
tab2.onPress = function() {
gotoAndStop(“StructurePulse”);
};
tab3.onPress = function() {
gotoAndStop(“Courses”);
};