반응형
=======================
=======================
=======================
How to create multiple tab loops in AS3 by using fl.managers.FocusManager?
2down votefavorite |
I want to create a tab-enabled popup window in an AS3 Air project. Currently, when I press tab several times, the focus goes through all the components in my popup window and then starts focusing the buttons and TextFields from the components that are behind the popup. I have tried to solve this problem in two ways, but none of them worked. I will explain both of the methods here
flash actionscript-3 actionscript focusmanager |
add comment |
3 Answers
up vote1down vote | Yeah tabbing can be a real pain. I had a similar problem, where tabbing stopped working after I had a popup open. Problem was that the popup was alive in the background and hijacked the tabbing. This solved my problem, with individual tabcycles now working for main app and popups: |
add comment |
Did you find this question interesting? Try our newsletter
Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).
up vote0down vote | Depending on what you are trying to achieve, you maybe able to use tabIndex instead of the FocusManager. http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/display/InteractiveObject.html#tabIndex |
show 2 more comments |
up vote0down voteaccepted | I ended up writing my own FocusManager which does what I need. It turned out to be easier than I initially thought. I'm sorry to say that I can't post the code here, but I'll give you a short description of what I did and hope that it helps:
I would still like to see some guidelines on how to correctly use the existing FocusManager. |
반응형
728x90
=======================
=======================
=======================
출처: http://stackoverflow.com/questions/7849864/somewhat-basic-as-3-0-quest-please-help-asap
somewhat basic AS 3.0 quest, please help asap
What is the best way to navigate through an actionscript swf using arrows? actionscript-3 actionscript flash-cs4 flash-cs5 |
add comment |
1 Answer
up vote0down voteaccepted | set the tabIndex property of the TextInput. That should allow you to tab through the form. It is inadvisable to override the default functionality for arrow keys because they are used to move the text insertion point within the textInput As for enter, you'll have to listen for the keyUp event and, if you detect an enter key, move to the next field. EDIT For Flash CS5, this code should work: important: first drag a component from the "User Interface" group onto the stage and delete it. This should put all the required components in the library ready for you to use EDIT2 Change in your code to this: |
show 18 more comments |
=======================
=======================
=======================
출처: http://stackoverflow.com/questions/7849864/somewhat-basic-as-3-0-quest-please-help-asap
For instance, if I have an ordered set of objects [a, b, c, d, e] with their tabIndex property correctly assigned, and the focus is currently on object c, I want to change the focus so that: a) Nothing is focused; b) Next time I press tab, object a gets focused. stage.focus = null solves (a), however it remembers the current index causing object d to be focused when tab is pressed. flash actionscript-3 |
add comment |
3 Answers
up vote1down voteaccepted | Instead of trying to change the index , you could switch the tabEnabled property of the remaining objects to false, when the focus is on the first objet , enabled it again. This example is not structured in functions, it's just demo code to clarify what I mean Press tab again, focus is on a |
add comment |
up vote0down vote | the easiest way imho is to set focus to e and then to null |
add comment |
up vote0down vote | I'm not sure that this is the best way to go about it, but it definitely works. Basically you keep track of the UI element that is in focus. Then before nulling the focus you store the element currently in focus. Have a look - I tested this with a few TextInputs and a Button: |
=======================
=======================
=======================
반응형
'ADOBE' 카테고리의 다른 글
adobe 플래시 AIR IOS 개발, 등록 관련 (0) | 2020.09.21 |
---|---|
[Flash] html 플래시 배경 투명하게 올리기 관련 (0) | 2020.09.15 |
flash 플래시 보안 관련 (0) | 2020.09.15 |
Flash Builder 4.5로 iPhone 4용 듀얼 브라우저 앱 만들기 air 플래시로 만든 앱 IOS(아이폰, 아이패드)에 등록하기 (0) | 2020.09.15 |
Flash Air 의ADT 패키지 빌드시 SWF 버전이 안맞아 에러가 나는 경우. (0) | 2018.05.09 |