Skip to main content
Participating Frequently
March 19, 2015
Question

problem with scrolling text through arrow keys after exporting file to html

  • March 19, 2015
  • 7 replies
  • 459 views

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.

This topic has been closed for replies.

7 replies

ankitabhiAuthor
Participating Frequently
March 20, 2015

do you know of any? thank you very much

kglad
Community Expert
Community Expert
March 20, 2015

no, not for a swf.

ankitabhiAuthor
Participating Frequently
March 20, 2015

do you think that is the only fix for this problem?

kglad
Community Expert
Community Expert
March 20, 2015

it's the simplest most straight-forward 'fix', but there might be others.

ankitabhiAuthor
Participating Frequently
March 20, 2015

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

kglad
Community Expert
Community Expert
March 20, 2015

i'm not sure what you want me to do with that link.

ankitabhiAuthor
Participating Frequently
March 19, 2015

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.

kglad
Community Expert
Community Expert
March 19, 2015

there's nothing in my code that would cause that.

ankitabhiAuthor
Participating Frequently
March 19, 2015

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.

ankitabhiAuthor
Participating Frequently
March 19, 2015

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

kglad
Community Expert
Community Expert
March 19, 2015

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--;

    }

}

kglad
Community Expert
Community Expert
March 19, 2015

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.