Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Maxscroll Question



Hey-
i have my dynamic text loaded into a text field, and i have created buttons to scroll the dynamic text field on press, both up and down..

Now, how can i make my scroll buttons only appear if the loaded text is longer that what the dynamic text field can display at one time?

i assume it will use the maxscroll property, but i'm not sure exactly how to do it..

thanks,
-myk



FlashKit > Flash Help > Flash MX
Posted on: 12-06-2003, 04:51 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

When Is A Maxscroll Not A Maxscroll...
Forgive me if I am wrong, but variable.maxscroll should give you the number of the last line in a dynamic text field, right?

I have got a second text field that is supposed to display the maxscroll (for testing purposes only), but it keeps on displaying 1.

I have the variable set up;

scrollNumMax = home.news.maxscroll;

and the text field is named scrollNumMax. The test field is loading text from an external .txt file, and it is in the movie clip "home". Any ideas why it is doing this to me?

Thanks....

Maxscroll Again
Hi,

How can I set text to the bottom with the maxscroll function in a dynamic textfield?
(I know maxscroll is readonly, so how can I set the scroll to the last line of the text?)

thanx
kgp
http://www.geocities.com/moonysite
http://www.vbsjabbeke.com

Maxscroll
I am loading a txt file, no bigger than 6.5 k into a txt box, and using the scroll syntax to scroll down the text. The problem arises around halfway, when flash will not let you scroll down the text field any further.

I have been reading about 'maxscroll' and pressume that this has something to do with it. I need to know what is happening and how to work around the maxscoll function if this is the case. the code i am using is below.


Code:

frame....

variable_name.scroll = "1";

down button....

on (press, keyPress "<Down>") {
text.scroll = Number(text.scroll)+1;
}
thanks for any help in advance

Maxscroll? Please Help
what does maxscroll return?
I'm scrolling a dynamic text box. I'm trying to determine if the box needs to be scrolled by how much text it contains. therefore displaying or hiding the scroller mc.
here's what I tried...

if(textFieldName.maxscroll <= 1){
scroller._visible=false;
}

and

if(textFieldName.maxscroll <= 2){
scroller._visible=false;
}

and a few other variations... no luck.
any suggestions would be greatly appriciated.
thanks.

Maxscroll Always == 1 ?
I'm creating a dynamic textfield and loading text into it... no prob.
then I'm trying to attach a the scrollbar component based on whether or not it's needed. but it seems as though whether or not my textBox is 10 lines longer than the text loded into it, or 10 lines to short to display all text... I still get textBox.maxscroll of 1.

anyone have this problem before... any Ideas or comments would be greatly appriciated.
thanks in advance.

Maxscroll
For some reason when I try and exaluate maxscroll it only works if it is on an onRelease.

I have a function to find out if maxScroll is larger than 1. However this function needs to be triggered twice by a mc with an onRelease before it executes properly. I thought this might be a timing issue... i.e. the text hadn't been loaded before the the function was called and therefore the maxScroll couldn't evaluate, but if i trace the text and the maxScroll to the function the text is coming out fine but the maxScroll evaluates to 1 (not 11). If you then click on an mc that also runs this same function it then correctly evaluates the maxScroll. Why it not do it correctly the first time?

Any ideas... i know this is a little complicated in explanation but it is driving me crazy... thanks J.





























Edited: 12/04/2007 at 09:33:09 PM by jonnybennett

Maxscroll
Can someone please post some code for a working example of scroll max? I'm new to Flash and am trying to screate scrolling text in a dynamic box without using scroll bars. Thanks in advance for any help!

Maxscroll Problem
Hi guys,

another problem; tried on the newbies forum several times, but no one could help me (or no one understood me)

I'm making a program where the user must give answers to the program. So I've got an input textfield and a dynamic textfield above it. (kind of a chatbox)

How can I put the last line of the text after any input of the user or question of the program to the bottom of the textfield. So the textfield jumps automaticly to the bottom of the text, without clicking a scroll button. (it has something to do with the maxscroll )

Probably easy if you know how to...

thanx in advance
kgp
http://www.geocities.com/moonysite
http://www.vbsjabbeke.com

Scroll And Maxscroll
I had the following statement in my movie:

Code:
x=textfield.scroll


The text in the textfield is loaded by using the loadVariablesNum action. If the text is loaded this way, the variable "x" (see above) will return undefined. Why?

Also, I decided to do this:

Code:
textfield="bla bla bla bla bla bla bla bla bla"
x=textfield.maxscroll


I wanted to play with maxscroll this time. This time "x" is always 1. I don't know why......The textbox has about 20 lines......

[Edited by kidder on 11-13-2001 at 03:03 AM]

Scroll And Maxscroll
Does anyone know of any tutorial that teaches the scroll and maxscroll function? I don't know why, but everytime I use the maxscroll function, the value returned is always 1 (and some more I can't see everything in the textbox, meaning I have to scroll, so I can't seem to find out why maxscroll always return 1). If I use loadVariablesNum or loadVariables to load data, scroll will always return undefined.

Scroll , Maxscroll , Please Help
Hello everybody,

I have a movieclip which has a text box and a movieclip called scroller.

The scroller movieclip contains two buttons to control scrolling of the text box.

i want to show and hide this scrlloer movieclip depending on the amt of text passed to the textbox.

ie: i dont want to show the scroll bars when there is not enough text to require scroll


should i use maxscroll ? if so , How?
code sample would help .

thanks in advance
kiran

Maxscroll And BottomScroll
I have a text field that is scrolled when a button is pushed.

I wanted a movieClip to be visible as long as there is more text to view.

Please help.

I know maxscroll gives me the maximum number of lines to scroll, but I am not sure how to determine if it has been reached.

I tried a comparison with bottomScroll with no positive results.

Textfield Maxscroll?
I'm having a problem with the maxscroll property. I obviously want to know the maxscroll of a dynamic textfield so that I can whip up a scroll bar that adjust to the amount of text in my textfield, just like a web browser. The problem I am having is that I only want to check maxscroll during the onClipEvent(load) because onClipEvent(EnterFrame) checks every time the particular frame is entered. However, using onClipEvent(load) checks before the text gets loaded into the textfield, so it always yields 1. Any suggestions?

Maxscroll Query
Anyone know about maxscroll? Someone suggested a do while loop to grow a textfield while maxscroll is greater than 1 to get all the text displayed without scrolling.

Seems straightforward enough, but my maxscroll is a bit erratic and keeps on dumping me into endless loops no matter how big I make the field.

Scroll, Maxscroll-please Help
Greetings to all of you guys,
looking for help with action script designing scrolling window.
Here is the problem: Trying to design a scrolling window with four interactive buttons controlling the text.
I designed functional scrolling window with dynamic text. Let's name it My_text and make it 100 lines long. It scrolls up&down and the visible portion of the text is 25 lines. So far so good.
Now I am trying to add 4 buttons which should control position of the text within the scrolling window. By clicking on each button the user should jump to corresponding portion of the text. So I need to add action script to each button to go to corresponding part of the text. Can you guys help me with the action script? I know I should go to Actions-onRelease, go to Variables and enter certain criteria for scroll and maxscroll? for each button, but this is the part I need some help with.
Thank you very much, any help will be appreciated-
Lee Bosh

CreateTextField & Maxscroll
Hi there,

I'm playing around with createTextField for the first time, and there is one thing I just don't understand.
all of the code below works but one thing. I cant get a proper result from maxscroll!! Its driving me nuts really.
I tried _root["testValue"+i].maxscroll, but its return is always 1.
when I try the same in a createdTextField without a forloop, I get a normal result.....what am I doing wrong????


PHP Code:




for(i=0;i<names.length;i++){
_root.createTextField("testField"+i,i,50,(100+(i*13)),100,13);
_root.createTextField("testValue"+i,(i+names.length),150,(100+(i*13)),200,13);
    //add text from arrays
    _root["testField"+i].text = names[i];
    _root["testValue"+i].text = value[i];
    //format field
    with(_root["testField"+i]){
        border = true;
    }
    with(_root["testValue"+i]){
        multiline = true;
        wordWrap = true;
        border = true;
    }
}







thanks a lot

Scroll = Maxscroll;
hello, I have recently been handed the task of converting a flash chat application from Flash MX to Flash MX 2004.

I have changed all the text boxes uses, and converted them to TextArea components. Everything is working perfectly minus one small detail.

In the Flash MX actionscript I had this code for the main chat box.


InstanceName.scroll = InstanceName.maxscroll;

It was triggered everytime the box "refreshed" the content essentially. So the scroller was always at the bottom.

I need to know how this can be accomplished in a TextArea Component. We want it to look like IRC with the new data coming in the bottom, and the scroller always at the bottom of the content..

I hope this makes sense, I have been spinning my wheels for too long on this one..

Thanks alot anyone who can help!!!!

Scroll Maxscroll
I am working with a script that I downloaded from Flash Kit. It is a simple text scrolling script that uses scroll and max scroll. I like the script because it moves the text in such a way that the pixel fonts don't get blurred. I wan to update the script because I see that scroll and max scroll are deprecated. What have these commands changed to in Flash MX 2004?

Thanks,

How To Determine Maxscroll?
I am using Flash MX (on Mac OS 10.3 if that makes any difference).
How do i get teh maxscroll value of my dynamic text boxes?
Each time i use the trace method i ALWAYS get a return value of 1.
I am stuck
Please unstick me

Thanks

Maxscroll Value (TextField)
Lately, I have had some troubles with the maxscroll variable. This value should tell how long a TextField is, in terms of #lines.
But its value doesn't get updated acurately in my case : my flash swf adds words to a textfield, then resets its content, everytime a button is pushed. The first time, the maxScroll is set correctly, but the second time it is set wrongly.

It's maybe because the maxscroll value increases, but is delayed by some frames..... Is there a function to force a wait(), maybe? Has this bug been noticed elsewhere?
Thx for any help

[F8] Scroll And Maxscroll
Hi!

I load data from an external XML file.

Code:
_root.createTextField("maxscrolling",10,200,80,200,100)//
_root.maxscrolling.text="line"+_root.contents.scroll+" of"+_root.contents.maxscroll;
the output it's line 1 of 7, that's incorrect...

when i click on the scroller button


Code:
_root.scrolling.row_down.onPress = function() {
_root.contents.scroll++;
_root.maxscrolling.text="line"+_root.contents.scroll+" of"+_root.contents.maxscroll;

}
the correct value is shown: 2/171

why?can any1 help me?
thaaaaanx

[F8] Datagrid - Maxscroll
Hi!

How do I get the datagrid autoscroll to absolute bottom?

maxscroll and vPosition (to maxIndex) does not work for me.


Regards,
S-fish

MinScroll MaxScroll?
Code:
// actions on frame
scrollUp=false;
scrollDown=false;
scrollArea.scrollText = "Your sinuses... yada yada ...swallowed.";

// clip event actions
onClipEvent(enterFrame) {
if (_root.scroll1.scrollUp) {
_root.scroll1.scrollArea.scrollText.scroll++;
}else if (_root.scroll1.scrollDown) {
_root.scroll1.scrollArea.scrollText.scroll--;
}
}

// button actions
on (press) {
scrollDown = true;
}
on (release, releaseOutside) {
scrollDown = false;
}

on (press) {
scrollUp = true;
}
on (release, releaseOutside) {
scrollUp = false;
}
this code works for scrolling a textfield.

I want to know if there is a way to know when the textfield is at the top or the bottom of the text inside. How can I do this using this code? Any help or suggestions are mucho appreciado
thanks as.org

Determining Maxscroll
I'm using this to control my scrolling

onClipEvent (enterFrame) {
if (scrolling) {
_root.awards.press.awards.scroll--;
}
}

and I'm trying to use something like this to control the up/down arrows to appear only if needed

if(_root.awards.press.awards.maxscroll > 1){
up2._visible = true;
down2._visible = true;
}else{
up2._visible = false;
do2._visible = false;
}

but it's not working so far.

Any ideas?

Text Maxscroll And More
here is another! i made some sort of a live chat. ive created 2 text fields on the movie, 1st one is the textfield that gets the value from the server (which blinks all the time when the interval reaches) and 2nd textfield that get the value of the 1st text which will be seen by the enduser. the problem is when new text comes along and you were reading in the middle of the textbox using the scroll bars, it send you to the last message recieve and scroll the whole damn thing. this really annoys a lot of us here and any suggestions will be much appreciated. and if i annoyed you too with my explanations, i am really sorry.

[CS3/AS2] TextArea Maxscroll
Hi,

I have a text area, content_txt, that I load html with a stylesheet into using this code:


Code:
//code for loading CSS and text into swf;


function getRotatorStyles() {
content_txt.text = "loading content";
// load stylesheet first
var flash_css = new TextField.StyleSheet();
flash_css.onLoad = function(success:Boolean) {
if (success) {
content_txt.styleSheet = flash_css;
getRotatorContent();
} else {
content_txt.htmlText = "Error - could not load CSS.";
}
};
flash_css.load("cast/style.css");
};

// load the text into the text box
function getRotatorContent() {
content_txt.htmlText = "Loading content";
// we've loaded the StyleSheet now let's load the content from the text file

//start by loading the variables from the text file


var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success){
if (success){

content_txt.htmlText = my_lv.info;
} else {
content_txt.htmlText = "A problem has been detected";
}
};
my_lv.load("cast/cast.htm");
};
The problem is that content_txt.maxscroll always returns 1, but I know from testing that the actual value is 121. content_txt.htmlText.maxscroll, content_txt.text.maxscroll, content_txt._text.maxscroll, all return undefined. How can I get an accurate value of maxscroll for this text area? I need it to get a custom scroll bar to work correctly.

Any insight is appreciated. Thanks,

-Noah

Determining Maxscroll
I'm using this to control my scrolling

onClipEvent (enterFrame) {
if (scrolling) {
_root.awards.press.awards.scroll--;
}
}

and I'm trying to use something like this to control the up/down arrows to appear only if needed

if(_root.awards.press.awards.maxscroll > 1){
up2._visible = true;
down2._visible = true;
}else{
up2._visible = false;
do2._visible = false;
}

but it's not working so far.

Any ideas?

[as] Maxscroll Facts
Hello! I had problem with the maxscroll property. Always returning “1” no matter how much text is loaded. I made some tests to understand why is that. It seems that the value of maxscroll depends on the frame and the _visible value of the parent MovieClip. Here's the example:

I made a textField inside a MovieClip:


ActionScript Code:
content = "Some long text goes here..."
 
container_mc = _root.createEmptyMovieClip("containter_mc", _root.getNextHighestDepth())
 
tf_txt = container_mc.createTextField("tf_txt", container_mc.getNextHighestDepth(), 0, 0, 150, 50)
 
with(tf_txt){
    text = content
    wordWrap = true
    border = true
}

When the maxscroll is traced using onEnterFrame, the result is "1" in the first loop. In the other loops it is returning the real value.


ActionScript Code:
onEnterFrame = function(){
    trace("tf_txt.maxscroll = " + tf_txt.maxscroll + ";")
}


If container_mc._visible = false, the maxscroll returns "1" no matter which loop is that.

If you have an idea why maxscroll is behaving so, please share.
10x

Maxscroll Returning Wrong Value
I have a frame with a text field on it with one line of text, getting the maxscroll returns "1" like it should.

but if I change the text field (where maxscroll should be 9) and right after get the maxscroll. it returns the wrong value (return 1) for a few frames, (like 4) then shows the correct value.

Ex. onEnterFrame shows the following results with actions in paranteses

(onEnterFrame tracing maxscroll)
1
1
1
1
1
1
1
(add a bunch of text to the text field, maxscroll should be 9 right after this call)
1
1
1
1
10
10
10
10
10
10


As you can see the correct value doesn't become available until a few frames later

I'm still testing to find out if this is a bug or not???

Netscape Problem With Maxscroll
I have site I'm making with self-made scrollbars that work on dynamic text field that has _sans as font. I got around to testing on browsers. In Netscape 4.7 maxscroll doesn't work. The maxscroll should be 10 but Netscape is coming up with 1. Works fine on IE and more recent Netscapes.

What's the problem and what do I do?

Problems Tracing Maxscroll
Hi there,

I am always getting a return value of one (1) when i try to trace the maxscroll property of a dynamic text field taht loads text from a .txt file in my movie.....I am using Flash Studio MX and haven't been able to determine the reason i keep getting this value.

Is anyone able to help me? I'm really stuck on this one

Thanks

Francesca
ccesca@mac.com

_height Based Off .maxScroll
Hi All,
I'm having a little problem with my AS2 .maxscroll. I am using the total number of text lines(.maxscroll) multiplied by 14 to give me the _height of a movie clip called entryBackMiddle... Seems to work until I look closer... it appears that some of my clips are sized to long and other clips are to short... Originally I was using .textHeight but that keeps giving me undefined so I switch over to maxscroll...

I've marked in red what I think might be the problem. I have also included a file and the entire code of how I'm looping thought my xml and attaching my clip in case its something else is wrong.
code:
//-------------Text Size------------//
var maxScrollHeight:Number = this["entry_clip" + h + "" + i].entry_text.maxscroll;
//var theTextHeight:Number = this["entry_clip" + h + "" + i].entry_text.textHeight;
trace(theTextHeight);
trace(maxScrollHeight);
//
//var maxTextHeight:Number = theTextHeight*60;
var maxTextHeight:Number = maxScrollHeight * 14;
var maxTextBottomY:Number = maxTextHeight;
trace (theTextHeight);
//
if (this["entry_clip" + h + "" + i].entry_text.maxscroll > 1) {
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxBack.entryBackBottom._y = maxTextBottomY - 10;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackBottom._y = maxTextBottomY - 10;
//
//trace("The field is more than one line");

} else {
trace ("It's only one line");
}
//-------------Text Size------------//



It loops thought the xml just fine.

code:
/***** LOAD EXTERNAL XML****/
var timeLineXMLConn:XML = new XML ();
this.timeLineXMLConn.ignoreWhite = true;
this.timeLineXMLConn.load ("CompleteTimelines.xml");
this.timeLineXMLConn.trigger ();
trace ("this is = " + this);
this.timeLineXMLConn.onLoad = function (success:Boolean):Void {
if (success) {
//trace("this is Loaded = "+this);
eval ("entry_clip" + i).entry_text.text = timeLineXMLConn;
this.timelineXML.onload = processXML (timeLineXMLConn);
} else {
trace ("error loading XML file");
}
};
/***** LOAD XML****/

function processXML (xml:XML) {
trace ("processXML = " + "Called");
// the y value of our entries,
// ie how far above the line they are
root_element = timeLineXMLConn.firstChild;
// loop through the XML
for (h = 0; h < root_element.childNodes.length; h++) {
trace ("--------- h = " + h + " -------- ");
element = root_element.childNodes[h];
// pulling out the data as we go
for (i = 0; i < element.childNodes.length; i++) {
entry_text = root_element.childNodes[h].childNodes[i].firstChild.nextSibling.nextSibling.firstChild.nod eValue;


var newPlot = this.attachMovie ("entry_clip", "entry_clip" + h + "" + i, this.getNextHighestDepth ());
this["entry_clip" + h + "" + i]._x = Math.round(Math.random()* 800)+ 20;
this["entry_clip" + h + "" + i]._y = Math.round(Math.random()* 600)+ 20;
this["entry_clip" + h + "" + i].entry_text.autoSize = true;
//this["plot" + h + "" + i].entry_clip.entry_text.wordWrap = true;
this["entry_clip" + h + "" + i].entry_text.multiline = true;
this["entry_clip" + h + "" + i].entry_text = entry_text.toString ();
//this.timelines_MC["plot"+h+""+i].entry_clip.entry_text.setTextFormat(this.myformat );
//

//-------------Text Size------------//
var maxScrollHeight:Number = this["entry_clip" + h + "" + i].entry_text.maxscroll;
trace(theTextHeight);
trace(maxScrollHeight);
//
//var maxTextHeight:Number = theTextHeight*60;
var maxTextHeight:Number = maxScrollHeight * 14;
var maxTextBottomY:Number = maxTextHeight;
trace (theTextHeight);
//
if (this["entry_clip" + h + "" + i].entry_text.maxscroll > 1) {
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxBack.entryBackBottom._y = maxTextBottomY - 10;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackBottom._y = maxTextBottomY - 10;
//
//trace("The field is more than one line");

} else {
trace ("It's only one line");
}
//-------------Text Size------------//
}

}
}




Any and all help will be greatly appreciated :-)
Thanks in advance
Scott

TextField.maxscroll Update
hi,
posted a similiar question yesterday (see below), but I've managed to generalize it quite a bit:

When the size of my textField is changed dynamically, the .maxscroll value is not updated. Seems it waits for the next user interaction. How come? Is there any command to sort of update it? Hilfe!

( http://www.actionscript.org/forums/s....php3?t=108570 )

TextField.maxscroll Always Returns 1?
I'm publishing in Flash Player 7 and using the older Flash MX scroll bar component. I just want it to disappear when not needed but maxscroll always returns 1 when using trace.

The AS that should work:

Code:
sbar._visible = (homeinfo.maxscroll > 1);
but these always return "1" reguardless of the amount of text:

Code:
trace("scroll" + homeinfo.scroll);
trace("maxscroll" + homeinfo.maxscroll);
trace("bottomScroll" + homeinfo.bottomScroll);
The textbox has an instance name "homeinfo" and it is a dynamic textbox which loads an html file just fine.

This seems like I'm missing something obvious or am not aware of some incompatibility. Thanks so much in advance!

TextField.maxscroll Always Returns 1?
I'm publishing in Flash Player 7 and using the older Flash MX scroll bar component. I just want it to disappear when not needed but maxscroll always returns 1 when using trace.

The AS that should work:

Code:
sbar._visible = (homeinfo.maxscroll > 1);
but these always return "1" reguardless of the amount of text:

Code:
trace("scroll" + homeinfo.scroll);
trace("maxscroll" + homeinfo.maxscroll);
trace("bottomScroll" + homeinfo.bottomScroll);
The textbox has an instance name "homeinfo" and it is a dynamic textbox which loads an html file just fine.

This seems like I'm missing something obvious or am not aware of some incompatibility. Thanks so much in advance!

[F8] How To Work Out The MaxScroll Of A Dynamic Textfield?
Hey guys,

Ive created a news textbox that reads information from an xml document. The only issue i have is that the scroller that i use to move the textbox up and down (just 2 buttons, 1 up 1 down) doesnt know how many lines are in the textbox so the maxScroll variable needs to be hard-coded into it (in other words the base of which to stop scrolling downwards is a hard-coded number instead of a dynamic variable that adapts to the amount of content in the text).

Is there anything i can do to determine how much information is in the textbox, so i can create a dynamic maxScroll variable?

BTW, im moving the textbox up and down instead of using the typical .scroll because i prefer the smoother animation.

Any help would be appreciated, thx

Mc._height Based Off Text.maxScroll
Hi All,
I'm having a little problem with maxscroll. I am using the total number of text lines(maxscroll) multiplied by 14 to give me the _height of a movie clip called entryBackMiddle... Seems to work until I look closer... it appears that some of my clips are sized to long and other clips are to short... Originally I was using .textHeight but that keeps giving me undefined so I switch over to maxscroll...

I've marked in red what I think might be the problem. I have also included a file and the entire code of how I'm looping thought my xml and attaching my clip in case its something else is wrong.

Code:
//-------------Text Size------------//
var maxScrollHeight:Number = this["entry_clip" + h + "" + i].entry_text.maxscroll;
//var theTextHeight:Number = this["entry_clip" + h + "" + i].entry_text.textHeight;
trace(theTextHeight);
trace(maxScrollHeight);
//
//var maxTextHeight:Number = theTextHeight*60;
var maxTextHeight:Number = maxScrollHeight * 14;
var maxTextBottomY:Number = maxTextHeight;
trace (theTextHeight);
//
if (this["entry_clip" + h + "" + i].entry_text.maxscroll > 1) {
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxBack.entryBackBottom._y = maxTextBottomY - 10;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackBottom._y = maxTextBottomY - 10;
//
//trace("The field is more than one line");

} else {
trace ("It's only one line");
}
//-------------Text Size------------//

It loops thought the xml just fine.


Code:
/***** LOAD EXTERNAL XML****/
var timeLineXMLConn:XML = new XML ();
this.timeLineXMLConn.ignoreWhite = true;
this.timeLineXMLConn.load ("CompleteTimelines.xml");
this.timeLineXMLConn.trigger ();
trace ("this is = " + this);
this.timeLineXMLConn.onLoad = function (success:Boolean):Void {
if (success) {
//trace("this is Loaded = "+this);
eval ("entry_clip" + i).entry_text.text = timeLineXMLConn;
this.timelineXML.onload = processXML (timeLineXMLConn);
} else {
trace ("error loading XML file");
}
};
/***** LOAD XML****/

function processXML (xml:XML) {
trace ("processXML = " + "Called");
// the y value of our entries,
// ie how far above the line they are
root_element = timeLineXMLConn.firstChild;
// loop through the XML
for (h = 0; h < root_element.childNodes.length; h++) {
trace ("--------- h = " + h + " -------- ");
element = root_element.childNodes[h];
// pulling out the data as we go
for (i = 0; i < element.childNodes.length; i++) {
entry_text = root_element.childNodes[h].childNodes[i].firstChild.nextSibling.nextSibling.firstChild.nodeValue;


var newPlot = this.attachMovie ("entry_clip", "entry_clip" + h + "" + i, this.getNextHighestDepth ());
this["entry_clip" + h + "" + i]._x = Math.round(Math.random()* 800)+ 20;
this["entry_clip" + h + "" + i]._y = Math.round(Math.random()* 600)+ 20;
this["entry_clip" + h + "" + i].entry_text.autoSize = true;
//this["plot" + h + "" + i].entry_clip.entry_text.wordWrap = true;
this["entry_clip" + h + "" + i].entry_text.multiline = true;
this["entry_clip" + h + "" + i].entry_text = entry_text.toString ();
//this.timelines_MC["plot"+h+""+i].entry_clip.entry_text.setTextFormat(this.myformat);
//

//-------------Text Size------------//
var maxScrollHeight:Number = this["entry_clip" + h + "" + i].entry_text.maxscroll;
trace(theTextHeight);
trace(maxScrollHeight);
//
//var maxTextHeight:Number = theTextHeight*60;
var maxTextHeight:Number = maxScrollHeight * 14;
var maxTextBottomY:Number = maxTextHeight;
trace (theTextHeight);
//
if (this["entry_clip" + h + "" + i].entry_text.maxscroll > 1) {
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxBack.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxBack.entryBackBottom._y = maxTextBottomY - 10;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._height = maxTextHeight;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackMiddle._y = 0;
this["entry_clip" + h + "" + i].textBoxshadow.entryBackBottom._y = maxTextBottomY - 10;
//
//trace("The field is more than one line");

} else {
trace ("It's only one line");
}
//-------------Text Size------------//
}

}
}

Any and all help will be greatly appreciated :-)
Thanks in advance
Scott

Problem With Dynamic Text Maxscroll
I add the dynamic_text._height according to the external txt, so if the maxscroll == scroll the dynamic_text._height is just ok. so I make the dynamic_text in a mc. if i put the mc in the workspace(500x600) everything is ok. but if i put the mc outside the workspace(mc._x = 601) then no matter how the dynamic_text._height increse , the maxscroll do not change...
any help is welcome....

Dynamically Loaded, Css-ed Text And Maxscroll?
Hey guys,

I'm developing a small site which dynamically loads .txt files into a main textbox which has a completely working custom scrollbar and buttons. The scrollbar would resize vertically based on the textbox.maxscroll value for the loaded text. The problem is that since I have adjusted my .txt files to work with CSS formatting, the scrollbar resize doesn't work. The up/down buttons and scrollbar scrolling are fine but resizing doesn't. I put a trace in the code for the maxscroll value but for the CSS formatted .txt files is always 1 no matter how much content is in the file. Anyone? I'm totally out of possible reasons. Any help greatfully appreciated.

Cheers, Mike

When Tracing Maxscroll Of My Dynamic Text Boxes, I Always Get '1' ?
Does anyone know why this is??? Its very fustrating

Thanks in advance.

Scroll, Maxscroll, Scrolling Textbox Black Magic
this is driving me nuts. I am trying to make a flash chat where I enter some text into one text box and when I hit a 'send' button it appends that text to another text box that serves as the chat window.

That chat window has 4 lines of text visible, so I've written something like this into the 'send' button:

on (release) {

chatdisplay = chatdisplay + ":" + _root.mynick + ": " + chatinput + "
";
chatinput = "";
chatdisplaycount++;
if (chatdisplaycount > 4) {
chatdisplay.scroll += 1;
}
}

the problem is after i enter the 5th line of text, it does not scroll up, but after I enter the 6th line of text and hit send, it does scroll up but only by one so now I cant see the last line of text i entered, only the second to last line. so one would think I'm reading the line count wrong or something, but changing the if statement doesnt help, in fact nothing helps, the display is always one line behind.

even weirder, i set a test variable to check out what the maxscroll value is for the text box that updates each time I hit send. after hitting four lines (the height of the text box), it shows 1 as it should, but when I send the 5th line it still is at 1, only after the 6th line does it change to 2, and then keeps incrementing properly but by 1 offset from what it seems it should be.

finally I tried something like:

chatdisplay.scroll = chatdisplay.maxscroll;

which should always show me the last line of the text box, but still its always one line behind. its like the maxscroll value is lying to me. doing something like chatdisplay.scroll = chatdisplay.maxscroll +1; doesnt work either.

I also created another button that has a chatdisplay.scroll += 1; action on it to manually scroll the chat window down, and it works just fine, its not like the textbox is stuck or my text isnt actually there. what the hell is going on here? equally strange is the fact that if I type in 4 lines of text into the window in flash the authoring prog and then export it, sometimes only 3 lines appear unless i size the box just right, a little bit bigger than what the 4 lines are taking up on screen. If I try to resize the box to only be big enough to show the 4 lines, when I export it only shows 3. Could this be another part of the problem?

anyone ever have problems like this with flash text boxes and know a solution? thanks.

-zoltan

Determine Number Of Lines In A Textfield Before 'maxscroll' Has Changed ?
Hi there,

I'm trying to determine the number of lines of text in the (dynamic)textfield before the 'maxscroll' value has changed or the textfield is full.
Normaly you would determine the lines of text by adding up the 'maxscroll' value with the number of ('possible') lines in the textfield, right?
But how to determine the number of lines any time? Character width is variable so... Any suggestions?

ThanX, cYa.

How Do I Determine The Maxscroll Property Of My Dynamic Text Field?
Please help me...I am using Flash MX (in mac OS 10.3 , if tha makes any difference) , and when i trace maxscroll i always always get a return value of 1.

What's wrong

I'M LST

MyDynamicText.maxscroll Is Only 1 When Set To "<img Src='myTallMovie'>"
Code:
myDynamicTextVar = "<img src='myTallMovie'>";
trace(myDynamicText.maxScroll); // outputs 1
The scrollbar doesn't show since it's not registering the correct height.

What's the best way to fix this?

Copyright © 2005-08 www.BigResource.com, All rights reserved