1 person found this helpful
this.my_textArea.tabIndex = 1;
Thank you robdillon! Your line is the first one of all the versions I tried that does not throw back an error. So something must be good here. Only problem is I still cannot tab between the text Areas.
this.my_textArea1.tabIndex = 1; this.my_textArea2.tabIndex = 2; this.my_textArea3.tabIndex = 3;
I get no error but I can still get no focus on any of them. Meaning that no matter if I use the tab key or the mouse click, to move between them, they would all scroll together, whereas, of course, I would like only one at each time to enjoy exclusive attention.
Any type of focus-setting code will only work if the container that holds the items to be focused on is in focus. This means that you may need to have the user click in the section of the html document where you want to force focus.
Other than that, there could be any number of other problems with your file.
Thank you robdillon! Your line is the first one of all the versions I tried that does not throw back an error. So something must be good here.
No, all that means is that you're setting a property on an object. You could be doing this.my_textArea1.iDontLikeGreenEggsAndHam = 1; and it would happily accept that.
It sounds like you're saying that ALL text areas scroll at the same time, which is very weird and make me think you're using some custom code to implement scrolling. In that case, which textarea has focus wouldn't make any difference, unless it explicitly checks which textarea has focus. Also you haven't said whether this is an AS3 or Canvas document.
Thank you, robdillon. Not sure I understand, though. It`s Canvas (You`re right, sorry Clay`s) and it`s the only element on the html page. If a user starts clicking the tab key, he`ll automatically go through the various elements in the page, right? All I want is for those objects that are inside the canvas to be present in this tab key enumeration chain and to have an hierarchy in it.
Thank you for that important explanation, Clay`s. All of them DO scroll at the same time when the wheel is pressed and naturally it happens because my code is set this way and I need to add a condition. And you are right, I would like to know if it`s possible to check which object on the canvas has focus, (No matter if this focus was granted by mouse click or by tab) and then allow the wheel to scroll it accordingly and exclusively. As for now I am checking for mouse click and for keydown, to detect the click or tab event. Trying to find out if there`s a simpler and more elegant way to do it via the property of Focus.
Canvas mode does not natively support any GUI elements, so how are you getting scrollable textareas?
Right! I found very rare and few examples of such elements. Like this one:
Phaser Kinetic Scrolling Plugin by jdnichollsc
But I ended up using a much simpler element made by user kglad and posted in one of the discussions here.
That detail really should have been mentioned in your first post. So, I'm going to guess that the simple code is NOT simulating a true textarea (because textarea elements allow input), but rather is just a masked textfield set up to monitor mousewheel events. You are not going to be able to give these things focus by just assigning a variable, because they have no concept of focus. The only way to do that is to add more code to support it.
Indeed, they are not input fields and your description is correct. Thanks for the info, I hoped the property of focus could be assigned to any object on stage, but as I understand it isn`t, I`ll content myself with mimicking this property. Trying to keep questions simple but as I understand info is missing I`ll do my best to give a broader view next time, thanks.