Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-24-2005, 09:17 AM   #1
David Heath
Registered User
 
Join Date: Aug 2005
Posts: 42
Default Automatically Scrolling Text Using The Scrollbar

Hello there,

At the moment I have a single text box ('Section1Text_txt') which has a scrollbar component linked to it ('cmpScrollBar'). The text box is linked to an XML file which feeds paragraphs into the box sequentially as the user moves forward in the movie. As you can image, the text box fills up pretty quickly, and it isn't long before the user needs to scroll down to see the newly added text.

At the moment I have the following line of code to automatically scroll the text box to the bottom, so that the user can easily read the newest text added:

section1Text_txt.scroll +=25;

This seems to work fine, except for when the text almost causes the scrollbar to appear (it is invisible unless needed), in which case the scrollbar becomes invisible for a half second or so before disappearing again. This is not ideal at all, so I am asking if there is a way around this, or if there is an alternative way of approaching this problem.

I tried adding a white graphic symbol over the top of the scrollbar (covering it up)), and causing it to only become invisible (thus revealing the scrollbar) if the scrollbar itself is needed, but the scrollbar component doesn't seem to recognise the '.visible' caommand and so this didn't work at all.

Any ideas?
David Heath is offline   Reply With Quote
Old 11-24-2005, 04:32 PM   #2
shassouneh
Registered User
 
shassouneh's Avatar
 
Join Date: Jul 2005
Posts: 21
Default clarification?

OK a couple of quick clarifications.
.visible is not a command. Its a property. And the preoper syntax for it is _visible (the underscore is a must). So you might try something like

cmpScrollBar._visible = false;

Also, May I suggest that you force your users to wait say 10 or 15 seconds or until say 30% of the text has loaded? That way you wouldn't have to worry about anything except making sure that 30% fits nicely into your text field. Think about it: How fast is someone willing to or capable of reading anyways. By the time he/she reads the 30% of stuff u loaded, some new text would have trickled in, and so on!

That being said, and if you insist on proceeding in the fashion you described earlier, perhaps you can try setting up a listener and onLoadProgress you do some checking to see if there is enough text for a scroll bar, and only then would u reveal it by hiding the movie clip on top of it.
So it would go something like this:

Code:
var listener:Object = new Object();
var loading_stream_obj:Object = new Object();//This would 
//probably be your File or XML object or whatever can keep
//track of how much has been loaded
listener.onLoadProgress = function()
{

       //calculate the number of lines or find out how much has been loaded
      //if enough has loaded
     //do something like: myMaskClip._visible = false;

}//end of listener
loading_stream_obj.addListener(listener);
I am not an expert myself, and I know what I just wrote might be confusing, but I am hoping that at least it might give you some ideas to work on.

Good luck
shassouneh is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Horizontal dynamic text scrolling marquee Hotown ActionScript 1.0 (and below) 11 07-18-2008 01:35 PM
loading images into dynamic text boxes mprovojr ActionScript 2.0 5 10-09-2007 06:10 PM
help with text scrolling darth Other Flash General Questions 0 09-03-2004 04:18 PM
HIGH 5's for Help - Scrolling dynamic text probs Karas ActionScript 1.0 (and below) 1 02-12-2002 09:05 AM
Scrolling text prob...JESSE? Can you help again? Karas ActionScript 1.0 (and below) 0 02-08-2002 06:28 PM


All times are GMT. The time now is 12:39 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.