PDA

View Full Version : Selection/Focus Text Input Component


crazybuffalo
06-28-2007, 01:48 AM
Hi,

Well I was about to give up on this project until LOLFlash helped me get a list box working properly. Now it looks like I need some guidence on selections and focus for text input components.

My flash is going to calculate the sunrise and sunset times and angles. So it's necessary to be user friendly for the focus/selection to work properly. I have this sunrise/sunset calculation working with javascript in a webpage. There are 6 input fields that require data for the calculations, 3 pair of degrees and minutes, and 1 where the user types the name of the location. the latter isn't necessary but would be nice to have the selection/focus working properly.

The other 6 though currently work on the webpage so a user can't leave the data field unless the criteria for that field is met. For instance, if the minutes boxes are greater than 59. Plus all entries have to be numbers but flash has the restrict property to accomplish this.

I'm also trying to get things so that when a user clicks into one of these fields, all the characters are selected. This is so a user just has to start typing numbers.

I've been searching the forums here and the web but can't seem to get things to work. I've tried on(FocusIn) for each input where I do the focus/selection in the on() code and tried sending the input object to a function on the root timeline, no success.

When I use:

Selection.setFocus("_root.longDeg");

in an on() event or in a listener, I get a weird message
256 levels of recursion were exceeded in one action list.
This is probably an infinite loop.
Further execution of actions has been disabled in this movie."
Now when I put this same code in the actions frame all by itself, the txt input is selected when the flash loads and typing will delete what's there.

I just need a nudge in the right direction. So attached is my fla and xml files. These are the current files and are different from the link in my list box help thread. I found a funny thing, I made a new fla file by copying the frames of my original and pasting in a new fla. file size went from 2.5 mb to 660 some kb. hmmm

My hobby is landscape photography and knowing when the sun rises and sets and in what direction is important. I have a few friends who are bugging me to put my page back up. But I haven't addressed browser sniffing on this for at least 6 years. It would be even more of a project to make it crossbrowser and cross platform friendly, at least I thought so at first hehe.

Thanks!

LOLFlash
06-28-2007, 03:25 AM
The only problem I have only Flash 8 Pro and your style is Flash MX. I can help you to make one frame application running but not _root movie clip It is too complicated in what frame Object exist or not: like forth dimension for me.