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 )
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 06-15-2006, 10:01 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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 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
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
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.
Textfield That Won't Update Itself
I am a beginner , and this is my first question on this forum , forgive my stupidity
I just created one texfield on the stage with a variable name "myNumberTotal"
I created one buttons on the stage with this code:
on(Release) {
_root.myNumberTotal += 10;
}
Then on the frame i put this code :
var myTotalNumber:Number;
Then i test the movie , what happens is the textbox show me "undefined" , when i click it , it shows me NaN but i thought i already declared it as a number datatype .... Please please lend me a hand in this issue .. thanks
AS3 Textfield Won't Update
Hey Guys,
I am new to this forum and fairly new to flash. I have a textfield that is being created and added to a movieclip. I am loading external data from a databse and populating the textfield with the information.
However, the textfield is not being updated in the movieclip. The text property of the textfield is getting changed but it is not updating in the movieclip.
Has anyone ever run into this? Is there something I have to do to update the display of the textfield?
Any help would be greatly appreciated. Thank you.
John
Update Textfield Contents
hey all,
i've got a textfield i want to change the contents of by clicking on buttons. theoretically, all my content will be stored in an xml file or text file, and will be read out into variables. those variables represent the content which should change in my textfields. i've tried things like TextField.text = "whatever", TextField.text = variableName, TextField.replaceSel(variableName), TextField.replaceSel("text"), sheesh, nothing is working and, i admit, this could be due to the fact that im not especially proficient with flash to begin with.
i know that naming textfields corresponding to variables assigns the variable content(text) to the textfield. but, i want to be able to change that text on the fly.
any help would be appreciated.
thanks,
-carlos
TextField Doesn't Update
The following event handler takes a few seconds to run. I want to give the user a courtesy message while processing happens. The problem is that the "Updating . . ." message never appears. After the processing delay only "Done" shows up. I've worked around the problem by putting the "Updating . . ." message in an event handler for SliderEvent:THUMBDRAGGED. But processing doesn't really begin until the thumb is released. I'd rather have my program tell the truth.
Code:
public function sliderChanged(e:SliderEvent):void {
myStatus.text = "Updating . . .";
removeDots();
placeAllDots();
thresholdText.text = thresholdSlider.value.toString();
myStatus.text = "Done";
}
[help] TextField.styleSheet Update
I am using attachMovie to place a movieclip on the stage. This movieclip contains an html text field, which I populate with text by setting the textfield variable equal to my string. I am attempting to apply some CSS styles to the text by using TextField.styleSheet, but it doesn't work... at first. If I try to apply the styleSheet later, it works fine.
This feels like one of those issues where the styleSheet has to be applied in a specific order (before text is loaded, after text is loaded, or only when Mars and Venus align on a Thursday) but I just can't put my finger on it. Does anyone have experience working with TextField.styleSheet, and have advice for me?
ActionScript Code:
var thisClip = _root.attachMovie("myClip","_myClip",_root.getNextHighestDepth());
thisClip.txtVar = "<body> Hi there </body>";
thisClip.txtField.styleSheet = myStyleObject; //Style sheet defined elsewhere
I have also tried delaying thisClip.txtField.styleSheet = myStyleObject; by placing it in a setInterval construct.
Thanks!!!!
AS3 - Dynamic Textfield Will Not Update
I have two buttons called buttonLeft and buttonRight. These buttons don't update the month_txt dynamic textfield. I have traced the statement and the textfield should update but doesn't. Can anyone tell me where I am going wrong with this?
Code:
package {
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.Font;
import flash.display.SimpleButton;
import flash.events.MouseEvent;
import myFont;
import NavButton;
import right;
import left;
public class Calendar extends MovieClip {
var calendar:MovieClip = new MovieClip();
var monthsOfYear:Array = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var daysOfWeek:Array = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var daysOfMonths:Array = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var currentDate:Date;
var myDate:Date;
var month_mc:MovieClip = new MovieClip();
var day_mc:MovieClip;
var days_mc:MovieClip = new MovieClip();
var daysNo:Number;
var startDay:Number;
var i:Number;
var buttonRight:right;
var buttonLeft:left;
public function Calendar(__x:Number, __y:Number, fetch:String = null) {
if (fetch) {
currentDate = new Date(fetch);
} else {
currentDate = new Date();
}
myDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
publishMonth();
publishDays();
calendar.x = (235-170)/2;
calendar.y = (203-140)/2;
this.addChild(calendar);
//////////////////////buttons don't update dynamic textfield!////////////////////////////////////////////////
buttonRight = new right();
addChild(buttonRight);
buttonRight.x = 210;
buttonRight.y = 40;
buttonRight.addEventListener(MouseEvent.MOUSE_UP, getNextMonth);
buttonLeft = new left();
addChild(buttonLeft);
buttonLeft.x = 20;
buttonLeft.y = 40;
buttonLeft.addEventListener(MouseEvent.MOUSE_UP, getPreviousMonth);
}
public function getNextMonth(event:MouseEvent) {
var nextMonth=currentDate.month+= 1;
var month_txt:TextField=new TextField;
month_txt.text=monthsOfYear[nextMonth] + " " + currentDate.getDate() + ", " + currentDate.fullYear;
trace(month_txt.text=monthsOfYear[nextMonth] + " " + currentDate.getDate() + ", " + currentDate.fullYear);
}
public function getPreviousMonth(event:MouseEvent) {
var previousMonth=currentDate.month-= 1;
var month_txt:TextField=new TextField;
month_txt.text=monthsOfYear[previousMonth] + " " + currentDate.getDate() + ", " + currentDate.fullYear;
trace(month_txt.text=monthsOfYear[previousMonth] + " " + currentDate.getDate() + ", " + currentDate.fullYear);
}
//////////////////////////////////////////////////////////////////////
public function publishMonth() {
var month_txt:TextField = new TextField();
month_txt.text = monthsOfYear[currentDate.getMonth()] + " " + currentDate.getDate() + ", " + currentDate.fullYear;
//trace(month_txt.text = monthsOfYear[currentDate.getMonth()] + " " + currentDate.getDate() + ", " + currentDate.fullYear);
month_txt.autoSize = TextFieldAutoSize.CENTER;
month_txt.embedFonts = true;
var month_tf = new TextFormat();
month_tf.font = "Arial Black";
month_tf.color = 0xFFFFFF;
month_tf.size = 14;
month_txt.setTextFormat(month_tf);
month_txt.selectable = false;
month_mc.x = 40;
month_mc.y = 0;
month_mc.addChild(month_txt);
calendar.addChild(month_mc);
}
Update Text In Textfield
i don't see what's wrong here:
when i delete the _txtFld.appendText(text); in the updateText function the text disappears after i call it. with the append text, it sets the new text.
thanks for any help.
Code:
public class MyTextField extends textFormating {
private var _txtFld:TextField;
public function MyTextField(text:String) {
setNewTextFormat(12, 0xFF0000);
_txtFld = new TextField;
_txtFld.text = text;
_txtFld.multiline = true;
_txtFld.wordWrap = true;
_txtFld.autoSize = TextFieldAutoSize.LEFT;
_txtFld.embedFonts = true;
_txtFld.mouseEnabled = false;
_txtFld.selectable = false;
_txtFld.setTextFormat (txtTitel);
addChild(_txtFld);
}
public function updateText(text:String):void {
_txtFld.appendText(text);
_txtFld.text = text;
trace(_txtFld.text);
}
}
Update A Dynamic Textfield From An Eventlistener
Having a 5 day nightmare over this!
I really need to update the text in a text field from the event.PROGRESS Handler below, its alot of code to read but it all traces and works fine, just cant get info from the handler to the textField..
The Salt and Vinegar (UN OPENED) pringles on my desk are yours!
ActionScript Code:
package
{
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.events.*;
import flash.net.*;
import flash.display.*;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.text.Font;
import flash.text.*;
import xmllist;
public class imagemc extends MovieClip
{
public var holder:MovieClip = new MovieClip;
public var holder_Preloader:MovieClip = new MovieClip;
public var holder_Sprite:MovieClip = new MovieClip;
public var holder_Preloader_Text:TextFormat = new TextFormat;
public function imagemc (xmlArray,URLimages):void
{
//trace ("CLASS CONSTRUCTOR : IMAGEMC");
for (var i:int=0; i<xmlArray.length; i++)
{
buildSlideContent (xmlArray,URLimages,i);
}
}
public function buildSlideContent (xmlArray,URLimages,i):void
{
// CREATE MAIN CLIP
var holder:MovieClip = new MovieClip();
holder.graphics.lineStyle (1, 0xFF0000, 1);
holder.graphics.moveTo (0, 0);
holder.graphics.lineTo (760, 0);
holder.graphics.moveTo (760, 0);
holder.graphics.lineTo (760, 390);
holder.graphics.moveTo (760, 390);
holder.graphics.lineTo (0, 390);
holder.graphics.moveTo (0, 390);
holder.graphics.lineTo (0, 0);
holder.x = 20;
// CREATE PRELOADER CLIP //
var holder_Preloader:MovieClip = new MovieClip();
holder_Preloader.graphics.lineStyle (1, 0xFF6600, 1);
holder_Preloader.graphics.moveTo (0, 0);
holder_Preloader.graphics.lineTo (760, 0);
holder_Preloader.graphics.moveTo (760, 0);
holder_Preloader.graphics.lineTo (760, 390);
holder_Preloader.graphics.moveTo (760, 390);
holder_Preloader.graphics.lineTo (0, 390);
holder_Preloader.graphics.moveTo (0, 390);
holder_Preloader.graphics.lineTo (0, 0);
holder_Preloader.x = 0;
// IMPORT TEXT
var Font_Levenim:Font=new Font1();
var Font_Levenim_Format:TextFormat = new TextFormat();
Font_Levenim_Format.font=Font_Levenim.fontName;
// CREATE TEXT FIELD //
var holder_Preloader_Text:TextField = new TextField();
holder_Preloader_Text.defaultTextFormat = Font_Levenim_Format;
holder_Preloader_Text.embedFonts = true;
holder_Preloader_Text.x = 0;
holder_Preloader_Text.y = 10*i;
holder_Preloader_Text.width = 350;
holder_Preloader_Text.height = 20;
holder_Preloader_Text.border = false;
holder_Preloader_Text.background = false;
holder_Preloader_Text.text = "HELLO WORLD";
holder_Preloader_Text.textColor = 0xFF0000;
holder_Preloader_Text.multiline = false;
holder_Preloader_Text.wordWrap = false;
holder_Preloader_Text.selectable = false;
// CREATE IMAGE HOLDER SPRITE
var holder_Sprite:MovieClip = new MovieClip();
holder_Sprite.graphics.lineStyle (1, 0xFF6600, 1);
holder_Sprite.graphics.moveTo (0, 0);
holder_Sprite.graphics.lineTo (760, 0);
holder_Sprite.graphics.moveTo (760, 0);
holder_Sprite.graphics.lineTo (760, 390);
holder_Sprite.graphics.moveTo (760, 390);
holder_Sprite.graphics.lineTo (0, 390);
holder_Sprite.graphics.moveTo (0, 390);
holder_Sprite.graphics.lineTo (0, 0);
holder_Sprite.x = 80;
// CREATE IMAGE
var ldr:Loader = new Loader();
var url:String = URLimages+xmlArray[i];
var urlReq:URLRequest = new URLRequest(url);
ldr.load (urlReq);
ldr.x = 0;
ldr.name = "LD_IMG_"+i;
holder.name = "MC_HOLDER_1_"+i;
holder_Preloader.name = "MC_PRELOADER_1_"+i;
holder_Sprite.name = "MC_HOLDER_1_IMG_"+i;
holder_Preloader_Text.name = "TF_PRELOADER_TEXT_1_"+i;
addChild (holder);
holder.addChild (holder_Preloader);
holder.addChild (holder_Sprite);
holder_Preloader.addChild (holder_Preloader_Text);
holder_Sprite.addChild (ldr);
configureListeners (ldr.contentLoaderInfo);
}
private function configureListeners (dispatcher:IEventDispatcher):void
{
dispatcher.addEventListener (Event.COMPLETE, completeHandler);
dispatcher.addEventListener (HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener (Event.INIT, initHandler);
dispatcher.addEventListener (IOErrorEvent.IO_ERROR, ioErrorHandler);
dispatcher.addEventListener (Event.OPEN, openHandler);
dispatcher.addEventListener (Event.UNLOAD, unLoadHandler);
dispatcher.addEventListener (ProgressEvent.PROGRESS, progressHandler);
}
private function completeHandler (event:Event):void
{
trace ("HANDLER : COMPLETED > " + event + event.currentTarget.loader.name);
}
private function openHandler (event:Event):void
{
trace ("HANDLER : OPEN > " + event + ldr);
}
private function progressHandler (event:ProgressEvent):void
{
///////////////// NEED TO UPDATE "TF_PRELOADER_TEXT_1_"+i HERE ///////////
trace ("HANDLER : PROGRESS LOADED > " + event.bytesLoaded + " total: " + event.bytesTotal);
}
private function securityErrorHandler (event:SecurityErrorEvent):void
{
trace ("HANDLER : SECURITY > " + event);
}
private function httpStatusHandler (event:HTTPStatusEvent):void
{
trace ("HANDLER : HTTP STATUS > " + event);
}
private function ioErrorHandler (event:IOErrorEvent):void
{
trace ("HANDLER : I O ERROR > " + event);
}
private function unLoadHandler (event:Event):void
{
trace ("HANDLER : UNLOADED > " + event);
}
private function initHandler (event:Event):void
{
trace ("HANDLER : INIT > " + event);
}
}
}
Update Text Of Dynamic Textfield
I have created a dynamic textfield, but I doesn't change after the defined number of iterations .
At the end of the script is a conditional setting, changing the textField.
However, the text just dissapears.
Anyone ?
Attach Code
import flash.events.*;
import flash.geom.Rectangle;
import flash.text.*;
// first make an array to put all our snowflakes in
var snowFlakes : Array = new Array();
// dynamic text
//define textfield
var dyntext_NDW : TextField = new TextField();
dyntext_NDW.type = TextFieldType.DYNAMIC;
dyntext_NDW.x = 120;
dyntext_NDW.y = 150;
dyntext_NDW.width=600;
//dyntext_NDW.height = 200;
dyntext_NDW.autoSize = TextFieldAutoSize.LEFT;
dyntext_NDW.multiline = true;
dyntext_NDW.text = "text1";
trace ("how many ?");
// define formatting
var format1:TextFormat = new TextFormat();
format1.color = 0xFF0000;
format1.size = 30;
format1.font = "Courier";
format1.font = "AFKlampenborg";
var format2:TextFormat = new TextFormat();
format2.font = "Courier";
dyntext_NDW.setTextFormat(format1);
var startRange:uint = 6;
//put on stage
addChild (dyntext_NDW);
// and decide the maxium number of flakes we want
var numFlakes : uint = 250;
// and define a rectangle to store the screen dimensions in.
var screenArea:Rectangle = new Rectangle(0,0,800,300);
addEventListener(Event.ENTER_FRAME, frameLoop);
// and define the function that is called on an ENTER_FRAME event
function frameLoop(e:Event)
{
var snowflake : SnowFlake;
// if we don't have the maximum number of flakes...
if(snowFlakes.length<numFlakes)
{
// then make a new one!
snowflake = new SnowFlake(screenArea);
// add it to the array of snowflakes
snowFlakes.push(snowflake);
// and add it to the stage
addChild(snowflake);
}
// now calculate the wind factor by looking at the x position
// of the mouse relative to the centre of the screen
var wind : Number = ((screenArea.width/2) - mouseX);
// and divide by 60 to make it smaller
wind /=60;
function dynText():void {
dyntext_NDW.text = "NDW 123 overwrite";
addChild (dyntext_NDW);
}
// now loop through every snowflake
for(var i:uint = 0; i<snowFlakes.length; i++)
{
trace ( "flakes = ", i);
snowflake = snowFlakes[i];
// and update it
snowflake.update(wind);
// update tekst
if (i==20) {
dynText();
}
}
}
Update A Textfield From A Function Inside An As File
I'm trying to update a text field on my stage based on the results of a function. My function is in a as file however when it gets to the
textField.text="something" part it errors out with the following message
ReferenceError: Error #1065: Variable mainDisplay is not defined.
here is the line in my functin code
mainDisplay.text="GAME OVER TRY AGAIN";
how do i reference the textField mainDisplay from the function contained with the as file
I have tried stage.mainDisplay
any help would be appreciated.
regards
[MX2004] How To Update Textfield Only When Changed? - Urgent
I have 2 textfields...
They have to be related to each other so when I change the data in one of them, the other changes too (not identically... calculations and stuff)
And when I change the second one the, first one has to change accordingly... like a 2-way thing
Has that something to do with listeners mby? Never used them b4
[MX2004] How To Update Textfield Only When Changed? - Urgent
I have 2 textfields...
They have to be related to each other so when I change the data in one of them, the other changes too (not identically... calculations and stuff)
And when I change the second one the, first one has to change accordingly... like a 2-way thing
Has that something to do with listeners mby? Never used them b4
Moock's VirtualPet - TextField Update Not Working
Hi...
I've followed Colin Moock's AS3 notes to create a VirtualPet
I've got it working from the code at: http://www.adobe.com/devnet/actionsc...n_moock_f6.pdf
...but am now trying to add a textField on the stage that will display the % of calories remaining.
Extra code I have created in VirtalPet.as:
1. private var petView (An instance of VirtualPetView)
2. petView.displayInfo() (Called from the digest() method, which is called by the Timer every second)
Extra code I have added in VirtualPetView.as:
1. The method, displayInfo()
2. The method, createTextField(whichField:TextField, x:Number, y:Number, align:String, size:Number, color:Number, bold:Boolean)
3. The textField calories_txt, created in VirtualPetView by the above method.
The problem:
It displays correctly at first: "50% remaining". However there is no change to the textField content after that, as the VirtualPet becomes more and more hungry.
The method which should update the textField is called displayInfo(), and is definitely being called, as a trace action within the function is working properly, giving the correct value of remaining calories.
Please see the source code in the zip file attached.
Link In External File To Update Text In Other Textfield?
hi,
I am trying to create a link in a external text file, that will make a text appear in another textbox on the stage.
ie i have two textbox's on the stage, one called SubMenu one called MainText. Both are filled reading from an external text file. Now I would like to create a hyperlink in the SubMenu textfile that will make a new text appear in the MainText.
Anyone have any idea?
what i have sofar is this (the SubMenu text file):
SubMenu=Galleries
<p><a href="http://www.adamandtheweightfansite.com/NewsText.txt" target="MainText">Gallery 1</a></p>
<p>Gallery 2</p>
MainText or _MainText doesnt make a difference. It keeps opening it in a new browser.
I think that if we can make this work, we will have created a way to update menu's without any flash knowledge.
Any help is greatly appreciated. Oh im using MX Pro
Lisa
Dynamic Text Field Won't Show Update Until NEXT Update Happens
Hi,
In a very simple Flash file with bascially just a dynamic text field and a button I attached some very simple code to the button that updates the text fields .text parameter, like this:
on(click) {
some_textfield.text = some_value;
}
With trace(...) I have verified that "some_value" is what I want it to be. However, the txt field doe NOT get updated! It gets that (b ythen old) value the NEXT time I press the button!
So when I start the flash movie and click the button nothing happens, the next time I see the value I should have seen the first time, etc. - always one event late. Since the trace() I put inside the on(click) handler shows the correct value I'm really at a loss to explain why the text field is not updated.
Any explanations?
PS: By the way, I'm using font "_sans" so there's no font to embed, but trying Arial with "embed numbers" (I want to display an integer number) doesn't work either. I only mention that because I think to have observed something like the above strange behavior caused by embedding (or not) the characters.
Edited: 09/04/2007 at 09:23:57 AM by Hasenstein
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.
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
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
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
[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
|