Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » Scroll bar for dynamic textarea


Scroll bar for dynamic textarea

Reply
  #1 (permalink)  
Old 02-15-08, 07:06 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Scroll bar for dynamic textarea

I have a playlist that is generated in a dyamic textarea using a for loop. How can I make a scroll bar appear when there are so many items in the playlist that they go off the bottom of the stage?
__________________
Aye!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-03-08, 07:23 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
*BUMP*

I can post code if needed!
__________________
Aye!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-05-08, 08:11 AM
blinn_shade's Avatar
blinn_shade blinn_shade is offline
Aspiring Coder
 
Join Date: Aug 2007
Posts: 540
Thanks: 0
Thanked 0 Times in 0 Posts
sure lets see it.
__________________
Can you think outside the box but remain inside the box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-05-08, 08:22 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Hopefully this is enough of the code for the part in question:

ActionScript Code:
  1. //Load Playlist
  2.  
  3.  
  4. var wrapper:MovieClip = this.createEmptyMovieClip("wrapper", this.getNextHighestDepth());
  5.  
  6.  
  7. wrapper._y =120;
  8. wrapper._x = 220;
  9.  
  10. //load playlist
  11. var xml2:XML = new XML();
  12. xml2.ignoreWhite = true;
  13. xml2.onLoad = function()
  14.  
  15. {
  16.     var nodes:Array = this.firstChild.childNodes;
  17. for(var i = 0; i <nodes.length;i++)
  18. {
  19.    var playListEntry:MovieClip = wrapper.attachMovie("playListEntry", "playListEntry" + i, i);
  20.    playListEntry._y = (playListEntry._height * i) + 10;
  21.    playListEntry._x = 0;
  22.    listen = "Track "+ (i+1)+": " +(nodes&#91;i].attributes.artist + " - " + nodes[i].attributes.track);
  23.    playListEntry.playList.text = listen;
  24.    playListEntry.trackinfo = "Now Playing: " +nodes&#91;i].attributes.artist + " - " + nodes[i].attributes.track;
  25.    playListEntry.listen2 = "Track "+ (i+1)+": " +nodes&#91;i].attributes.artist + " - " + nodes[i].attributes.track;
  26.    playListEntry.gotoAndStop("plist");
  27.    playListEntry.songToPlay = nodes&#91;i].attributes.url;
  28.    s.loadSound(nodes&#91;0].attributes.url, false)
  29.  playListEntry.onRollOver = function()
  30.    {
  31.       this.gotoAndStop("plistOver");
  32.         this.playList.text = this.listen2;
  33.     } 
  34.     playListEntry.onRollOut = function()
  35.    {
  36.        this.gotoAndStop("plist");
  37.         this.playList.text = this.listen2;
  38.    }
  39.     playListEntry.onRelease = function()
  40.    {
  41.        s = new Sound();
  42.    
  43.     s.setVolume(75);
  44.     s.loadSound(this.songToPlay, true)
  45.        trackInfo.text = this.trackinfo;
  46.  
  47.     mute.gotoAndStop("on");
  48.        playPause.gotoAndStop("pause");
  49.        next.gotoAndStop("next");
  50.     }
  51.    
  52.   //Next Button
  53.  
  54.  
  55.  
  56. }
  57. }
  58.  
  59. //Load xml document
  60. xml2.load(songurl);
__________________
Aye!

Last edited by UnrealEd; 03-22-08 at 07:42 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 03-05-08, 08:35 AM
blinn_shade's Avatar
blinn_shade blinn_shade is offline
Aspiring Coder
 
Join Date: Aug 2007
Posts: 540
Thanks: 0
Thanked 0 Times in 0 Posts
How many items can reach till the bottom?
__________________
Can you think outside the box but remain inside the box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 03-05-08, 08:55 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
at the moment about 5. But it just depends on how big I set my text area and stage in the fla file.
__________________
Aye!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 03-07-08, 11:15 PM
blinn_shade's Avatar
blinn_shade blinn_shade is offline
Aspiring Coder
 
Join Date: Aug 2007
Posts: 540
Thanks: 0
Thanked 0 Times in 0 Posts
You could try using the setproperties and make it invisible if there is 5 or less items.
__________________
Can you think outside the box but remain inside the box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 03-08-08, 10:52 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
would that create a scroll bar or would it just make tracks 6 and onwards totally inaccessible?
__________________
Aye!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 03-09-08, 03:10 PM
blinn_shade's Avatar
blinn_shade blinn_shade is offline
Aspiring Coder
 
Join Date: Aug 2007
Posts: 540
Thanks: 0
Thanked 0 Times in 0 Posts
It will not display the scrollbar if there i only 5 items, it will display the scrollbar if there is 6 or more items.
__________________
Can you think outside the box but remain inside the box?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 03-09-08, 04:08 PM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
ok. As I am a total beginner in flash, could you help me out on how to add this to my code. Do I add it to my actionscript file? How do I determine how many entries there area?

I assumed t would be something like this:
Code:
 if (i > 5) {
setProperty("playListEntry", _visible, 0);
}
But I don't know exactly where to put it and it is probably totally wrong.
__________________
Aye!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
scroll bar script danlew Script Requests 3 02-02-06 11:24 AM
Scroll Bar danlew CSS 1 02-01-06 02:49 PM
scroll bar script danlew Script Requests 1 01-31-06 07:02 AM
how to create scroll bar ,using javascript DOM deepraj JavaScript 1 12-29-05 03:03 AM
All Browser compatable scroll bar gps HTML/XHTML/XML 0 06-24-04 02:22 AM


All times are GMT -5. The time now is 09:22 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.