Discuss how to use and promote Web standards with the Mozilla Gecko engine.
If anyone has run into this & knows a way around it (or even has an idea) please let me know.
Thanks a lot,
The second example is incorrect, IE-only syntax. The first is correct.
The movie does start right away. It has a starting sound that plays. But, flash movies are not assigned focus when first loaded. By default, the user has to click on the movie to give it focus.
For specific information, I have a flash movie that has typing. The movie is actually an educational activity for students (as young as kindergarder). When the page loads, it gives audio instructions ("type the word that you see"), and has a word like "CAT". They then retype the word in a box below the word CAT. This needs focus immediately when the page loads. Having any intermediate steps would only complicate things for the kids.
In addition to this, I have functional buttons (re-say instructions, for example) that are seperate flash movies. For IE, whenever these buttons are clicked I have them sending focus back to the main flash movie, that way if they were typing, they could keep typing after clicking the button. It may sound strange, but it is very comfortable, and extremely uncomfortable to have to re-click to give focus back. For the functional buttons (flash movies) I use the code:
<object onFocus="document.getElementById('FLASHID').focus();" ... .... >
Using onCLick would work just the same (and neither will work in Firefox).
Console will say:
document.getElementById("FLASHID").focus is not a function.
This is what I mentioned in my first post. Further analysis shows that all methods/functions on the flash component (focus, click, blur, etc) do not work.
So no, this will not work.
I really appreciate the responses and effort on this from everyone. Please keep going!
There are no syntax issues. Remember that it works in IE (and yes, I know IE often makes 'poorly' coded things work), but you'll have to trust me that it isn't a syntax issue. I've gone to great lengths to analyze & test this. You could reproduce it by simply using the above mentioned body tag, and adding a flash component with the same ID to the HTML page.
You can even try putting an onFocus="" in the <object> component - this will let you know when focus is given.
Having these 2 things is sufficient to reproduce & effectively fix the issue.
OK OK.. here's the exact HTML to reproduce:
Okay, the code makes sense. I am curious if it works with EMBED instead of OBJECT (though OBJECT is obviously more proper, since it's the standard)
There's probably a workaround for this. I'll play with this later if I get a chance. It may not be until evening.
It may even involve FSCommands or something.
You also may need
Just so I get it: There's an Input Text field within the Flash movie that needs to be focused when the page loads. The OBJECT must get the browser focus, and then Flash movie will give focus to the input. Right?
You've got it exactly.
I, myself, thought the same things about the <object> and <embed>. I have tried both, and thats why I used both tags in my initial posts - cuz I figured some people might ask about using <embed>.
I just now tried the "allowScriptAccess" param, which sadly did not work, but thanks for the suggestion.
When trying with the <embed> I tried the swLiveConnect just for the heck of it (it didn't work of course).
You may be right about the FScommand, but I haven't yet thought of a solution using it. If that is the way to go, then that's fine with me.
I had also thought about trying to simulate a mouse click on a Point that is overtop of the flash movie, but I'm doubtful Firefox would allow a simulated click due to security issues (and yes, if you're just now thinking it, I have tried <body onLoad="document.getElementById('FLASHID').click();"> ).
no, don't simulate clicks. you're right that it's a security issue.
I have used FSCommands. I'm not sure how they'd help though...
What about going at this from another point of view. Instead of trying to focus the flash component, what if we capture the key presses in browser, and send them to the flash movie... Does anyone know how to programatically send a key press to a component? For example, if you had a page with forms & text inputs, sending key presses to different text fields that you decide without those text inputs having to be focused (no, not a value= type thing).
It really would be helpful if someone that actually works on the mozilla browser & knows some of its functionality and how it was programmed could help... Don't make me download the code and become an example of the benefits of open source .
Got any luck?
I have problems with it too.
I've searched on macromedia's site, but got nothing for mozilla or firefox.
http://www.macromedia.com/cfusion/knowl ... ode=simple
I wonder why does mozilla (and firefox) have no focus method implementation of <embed>?
More over: there is no embed tag in HTML 4.01 or DOM specification!!! 8-0
Who is online
Users browsing this forum: No registered users and 1 guest