Copy link to clipboard
Copied
I am using Fash Professional CS6. I have created a text box that I can scroll through the scroll wheel of my mouse, as the scroll bar is hidden. But when I try to scroll the text through the arrow keys it is not allowing me to so that. As this is website and everyone is not going to have a scroll wheel, I have to make the arrow keys work to scroll the text. Could you please help me in fixing this problem? I tried to search this problem, but I haven't seen any questions so far.
Copy link to clipboard
Copied
what code are you using for arrow keys?
if you're not using any then whether your textfield scrolls depends on whether it has focus and your keyboard/os/flash player plugin.
Copy link to clipboard
Copied
I am not using any code. I just used the UI tools and removed the icons. I have the plugins but it is not allowing me to do so. And I have not put a FocusEvent listener in the actionscript code. Do you know how I can fix this.
Thank you very much
Copy link to clipboard
Copied
if tf is your textfield:
stage.addEventListener(KeyboardEvent.KEY_DOWN,f);
function f(e:KeyboardEvent):void{
if(e.keyCode==38){
tf.scrollV++;
} else if(e.keyCode==40){
tf.scrollV--;
}
}
Copy link to clipboard
Copied
tf should be the instance name of the text field. Right?
Sorry, as I said I am new to flash. So this might be a really silly question.
Copy link to clipboard
Copied
I named tf as the instance name and copied the code. But the code allows me to use the downkey to scroll halfway through the text and goes back to the top of the page.
Copy link to clipboard
Copied
there's nothing in my code that would cause that.
Copy link to clipboard
Copied
that is what I am thinking. I uploaded the code on sramani.org/about.html
You can check. I still can't find a fix for it. Thank you very much for your responses
Copy link to clipboard
Copied
i'm not sure what you want me to do with that link.
Copy link to clipboard
Copied
do you think that is the only fix for this problem?
Copy link to clipboard
Copied
it's the simplest most straight-forward 'fix', but there might be others.
Copy link to clipboard
Copied
do you know of any? thank you very much
Copy link to clipboard
Copied
no, not for a swf.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now