|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
scroll boxes
I found the scroll box option built into Flash MX and it's cool, but I want to be able to make a scroll box with my own arrows. The other catch is, I want it to loop as long as I hold the button down. So, like these 2 sites show...
http://www.absolutecross.com/tutorials/flash/scrolling/ http://actionscript-toolbox.com/sampletextscroller.php My own arrows but I don't want it to stop at the bottom, I want it to smoothly just start back at the top. The first link is the closest to the way I'm trying to do it because there's no bar, just arrows. Now, i'll be putting thumbnails of larger images in this thing. Clickable to the larger images. i'm assuming I can just make the flash movie of the thumbnails like I did before.. Just can't figure out the scrolling without the actual scroll box and the endless loop. I know this is a lot to ask but you guys always come through and i'm in serious need now. Any help I can get is great. Thanks in advance! |
|
#2
|
|||
|
|||
|
Hi, ok make two buttons (or one arrow button and flip the second instance). I'm going to pretend this is a new movie for now. Now place your text box on stage. make the text field dynamic and give it both an instance name and a variable name.
load text into the variable. do this manually for now so in your roots first frame enter something like : mynewTextVar = "type a really long string here, copy and paste bla bla bla"; You just want enough to test out scrolling. i.e. enough that goes beyond the current text box size. Now in your buttons you want to enter: //Down Arrow Button on(release) { //This is the text box not the text var if(mynewTextBox.scroll != mynewTextBox.maxscroll) { mynewTextBox.scroll += 1; } else { mynewTextBox.scroll = 1; } } //Up Arrow Button on(release) { //This is the text box not the text var if(mynewTextBox.scroll != 1) { mynewTextBox.scroll -= 1; } } I noticed a newer post askign for help with scroll boxes. You should look at the code in that post as it is more in-depth. This is just a sample. You may have to swap the +'s and -'s above, depends on what you want. Also the lowest line in a text field may be 0. Im almost 100% sure its 1 but I could be wrong. To get your text field to scroll as if the user was holding the buton down you can create a new movie with two frames. The first frame will contain the if statements from the above buttons (with updated target paths) and the second frame would have something like: if(stillScrolling) { gotoAndPlay(1); } Then when you click a button it should call that new movie and activate the loop i.e on(release) { if(_name == "upButton") { textScrollerCode.scrollDown = false; } else { textScrollerCode.scrollDown = true; } textScrollerCode.stillScrolling = true; } //and deactivate the loop when you move the mouse off the button on(rollOut) { textScrollerCode.stillScrolling = false; } you may want the button to deactivate the scroller on(release)...probably best to do both just in case theres a glitch during play back. You still have some work to do like checks etc but this is the groundwork. -Tann |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > scroll boxes |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|