PDA

View Full Version : scrollpanes, input textfields, and tabIndex


TheLostMarble
02-25-2003, 05:09 AM
I have an MC of a form which uses a number of Input textfields. I need to assign tab order and did so using the tabIndex properties - which I have done before with success. However, this time, there seems to be a problem. It is not working. I have double checked all other items on the stage to make certain I do not have overlapping tabIndex values, so there is only one other problem I can think of, but do not know what to do about it.

I am loading the MC using the ScrollPane component. Is it possible that this component is interfering with the tab functionality? If so, does anyone know of a fix, or how to get around it without removing the component? I am of a mind to drop the scrollpane (and all other components) for good since they frequently cause my Flash to crash while developing.

Any help is greatly appreciated. Thanks!

Billy T
02-25-2003, 11:33 PM
you could try turning tabEnabled off for the scrollpane mc

TheLostMarble
02-26-2003, 04:16 AM
Yeah, I though of that. Unfortunately, it did not work. I seem to have a lot of problems with components in general - as in they cause my Flash MX to crash on a fairly regular basis. Not certain why. I think I am just going to design my own scroll bar and use that with some masking.

Billy T
02-26-2003, 04:21 AM
yeah I've found the scrollpane in particular to be a complete pain in the ass

cheers

TheLostMarble
02-26-2003, 08:27 PM
Well, after a depressing search for any tutorials that show how to create a scrollbar (one that is as flexible as the component) I gave up. I even tried examining the code for the scrollbar component, but it is a bit beyond my current skill level, or I am just way too lazy.

I was able to use a regular scrollbar component; utilizing the setScrollProperties function and then making calls to the getScrollPosition function within the target MC's OnClipEvent(enterFrame) function combined with some very basic masking, I hit gold.

I was correct in my assumption that the tab error was caused by the scrollpane component. (perhaps this component should be referred to as the scrollpain component)

I still do not know why, but I plan on filing a complaint/support ticket if I can figure out where it should go. I cannot find any information on this particular problem - which may or may not mean that it has never been discovered.

Billy T
02-26-2003, 09:49 PM
so how do get the scrollbar to adjust itself to the size of the mc content?

TheLostMarble
02-27-2003, 04:26 AM
Well, it is all in the setScrollProperties function. It gets three parameters:
1. page size
2. minimum scroll value
3. maximum scroll value

So I entered in the size of my mask (400) as the first value, then 0, then the height of the MC - 400 as the max value.

I used the function in the onClipEvents(load) function and tracked the scrollbar position in the MC's onClipEvents(enterFrame) function, like so:

onClipEvent (load) {
_parent.myScroll.setScrollProperties(400, 0, this._height - 400);
startPos = _y;
}

onClipEvent(enterFrame) {
_y = startPos - _parent.myScroll.getScrollPosition();
}

Works like a charm! I have sent in a ticket to Macromedia on the problems I have had and will post their reply here if it proves informative.

mindfriction
07-22-2004, 01:58 PM
Hi guys in regard to getting the tabIndex to work within scrollpane or a nested mc, you must do 3 things.


this._parent.tabEnabled=false;//the parent for which the following textfields are nested (in the case of scrollpane its tmp_mc--in which your scroll content resides--)
this._parent.tabChildren=true;
myTextField1_txt.tabIndex=1
....
...
...
myTextField2_txt.tabIndex=6
Selection.setFocus("myVar1");//where myVar1 is the variable path (NB: this could be the var set in myTextField_txt for example)


Oh and tabIndex sometimes has trouble in Test Movie area (you must click on the movie to give movie 'focus' before it works), and sometimes focus can be affected by the browser.

Goodluck ;)