I'm using setFocus() to set the focus onto a button (Flash Lite 2.0):
setFocus(this.myButton);
When I emulate my FlashLite app on a non-touch screen device (Nokia N95, say) it works fine. However if I try to emulate my app on a touch screen device (say, Nokia 5800 XPress) the button doesn't receive the focus?
Any help would be appreciated here, as I'm stumped.
I had one movie clip named 'mcNext' and inside that I had a button named next_btn. My publish version was FlashLite 2.1 and actionscript version set to AS 2.0
I repeated your code on the root timeline, as as you said it worked. But this didnt solve my problem. Check out the attachment on this post. For me (unless I'm going mad) when the SWF loads initially, the focus works on the button contained within the MovieClip. Then when I click 'Menu 1' and it goes to frame 2 (which contains a replica Movie Clip) it doesnt work!! What's happening!!!???
I am sorry but not clearly understood your probs.....what you wana happen once your file goes to frame 2. Now it shows a green obect which is a movie clip.
On frame 1 I have a movie clip, which contains another movie clip, which contains a button. When you load the swf this button gets focus successfully.
On frame 2 I have the identical movie clip (which contains another movie clip, which contains a button). But when the timeline moves to frame 2 (via a button click) the button doesnt get focus? And I'm not sure why?
I just tested this on a Windows Mobile 5 installed with FlashLite 2.1 and the things worked fine for me. When the file went to second frame it automatically showed focus on the button. Device obviously was a touch screen device.
This is really strange why this is not heppening with you. Can you tell me what you need to do to get the focus on button when ur file goes to 2nd frame?
Touchscreen: I load swf, button in frame one is in focus, I click the 'Menu 1' button, it goes to frame 2, button on frame 2 IS NOT focussed.
non-Touchscreen: I load swf, button in frame one is in focus, I NAVIGATE UP one, click the 'Menu 1' button, it goes to frame 2, button on frame 2 IS focussed.
I've simplified it even more now (see attachment). There is 1 button and one movie clip in the library. On touch screen device (5800), the button in frame one gets focus. when i click the MC in frame 1 to go to frame 2, the button in frame 2 doesnt get focus!! Is anybody else getting this or is there something wrong with my device profile???
OK.....still on setFocus().....who can tell me how to set focus to a Movie Clip straight away when the app loads? At the moment, I've put a MC on the root of the stage (instance name 'mclip'). In frame 1, I have:
Code:
_focusrect = true;
test = eval(_root.mclip)
Selection.setFocus(test)
I was hoping for a yellow box to appear around my MC, but it doesnt? And Selection.getFocus() returns null?? Arrrrgggghghhhh!! This should be simple!! I must be missing something.....
...but apparently setFocus should take a movie clip as a parameter too, but setting focus to a MC doesnt work for me? Forget about the button for now please. How can I set focus to a movie clip? Because using setFocus() isnt working for me?
...worked like a charm. I'm gonna go investigate tabEnabled now. I wasn't even aware of focusEnabled - I just used focusRect. I'll have to find what the difference is there too i think.....
Marlo, you seem to know what you're talking about re: focussing components etc. Going back to my post number 10 in this thread, is there any way to get the button in frame 2 to focus?
You'll notice that the button in frame 1 focusses fine, but when i click the menu button to go to frame 2, the button on frame 2 doesnt get focus.