Flashblocks Flash CMS
Welcome, Guest
Please Login or Register.    Lost Password?
Scrollbar: visible only when needed (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: Scrollbar: visible only when needed
#5473
Scrollbar: visible only when needed 4 Months ago
Hello readers,

I am using a TextField and all is working fine. But there is one thing:
I want a scollbar to appear only when there is more text added in the FlashBlocks Text Editor than that the Textfield can show.

So in other words: I do not want to see anything of a scollbar when it is not needed.

Can I make a UIscrollbar appear and completely diaappear depending if the text is too long for the TextField?

thx, Eddy
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5474
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:Scrollbar: visible only when needed 4 Months ago
Unfortunately Flash's UIScrollBar component does not have a method to handle this. You could listen to the Editblock that is attached to the text field and set the scrollbar from there.
Code: :

  var ebListen:Object = {}; ebListen.complete = function(obj:Object){     if (obj.target.targetMC.scroll == obj.target.targetMC.maxscrollscrl._visible false     else scrl._visible true } eb.addEventListener("complete"ebListen);



Another option, if you are using embedded fonts, is to use the smooth scroller 2 module that comes with Flashblocks. See the demo site.
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/09/04 21:53 By admin.
  The administrator has disabled public write access.
#5476
Re:Scrollbar: visible only when needed 4 Months ago
thanks for your fast response, I will investigate.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5477
Re:Scrollbar: visible only when needed 4 Months ago
where do I place this code?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5479
admin ()
User Online Now Click here to see the profile of this user
Flashblocks Birthdate: 2005-02-14
 
Re:Scrollbar: visible only when needed 4 Months ago
Place this on the same frame as the UIScrollBar. "eb" is the Editblock instance name
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5481
Re:Scrollbar: visible only when needed 4 Months ago
thanks again
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#5483
Re:Scrollbar: visible only when needed 4 Months ago
Yes :)) it works. Thanks. Did need to give the UIScrollBar an Instancename too.

This is then what the code looks like (italic parts are where one should put thier own InstanceNames) :

var EditBlockInstancenameListen:Object = {};
EditBlockInstancenameListen.complete = function(obj:Object){
if (obj.target.targetMC.scroll == obj.target.targetMC.maxscroll) UIScrollBarInstancename._visible = false
else UIScrollBarInstancename._visible = true
}
EditBlockInstancename.addEventListener("complete", EditBlockInstancenameListen);


Don't forget! : code on the same frame as the UIScrollBar.

Note: Text will only show when put in by the FlashBlocks Text Editor.



Thanks Admin
 
Report to moderator   Logged Logged  
 
Last Edit: 2008/10/11 11:08 By Hilholland.
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop

Thank you