Account Options

  1. Sign in
Google Groups Home
« Groups Home
How can I set focus to my flash object?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
teshca  
View profile  
 More options Dec 8 2007, 10:13 am
From: teshca <Nickolay.Artamo...@gmail.com>
Date: Sat, 8 Dec 2007 07:13:08 -0800 (PST)
Local: Sat, Dec 8 2007 10:13 am
Subject: How can I set focus to my flash object?
Hi. I am trying to migrate my application from SWFObject v1.5 to
SWFObject v2.0. I read documentation but I still don't get how can I
set focus to my flash object. I use swfobject.embedSWF, and then
document.getElementById(flashObjectId).focus(), but this rise
exception because element with that Id not yet exists. How can I be
sure that swfobject.embedSWF already finish its work and I can get dom
element? The simple setTimeout works but It is a kind of hack. Is
there a better solution for my problem?

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Bobby  
View profile  
 More options Dec 9 2007, 5:44 am
From: Bobby <bobbyvandersl...@gmail.com>
Date: Sun, 9 Dec 2007 02:44:08 -0800 (PST)
Local: Sun, Dec 9 2007 5:44 am
Subject: Re: How can I set focus to my flash object?
You can only call upon DOM elements when the DOM is loaded. Just use
the SWFObject 2.0 API [ http://code.google.com/p/swfobject/wiki/SWFObject_2_0_api_javascript_dev
] to execute the functionality after the DOM is loaded and after your
Flash content has been inserted, e.g. add the following code after
your embedSwf method:

function setFocusOnFlash() {
  var fl = document.getElementById(flashObjectId);
  if (fl) { fl.focus(); }

}

if (swfobject.hasFlashPlayerVersion("9.0.0")) { // insert the version
you test for
  swfobject.addDomLoadEvent(setFocusOnFlash);

}

Just let me know if this works for you.

On Dec 8, 4:13 pm, teshca <Nickolay.Artamo...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
teshca  
View profile  
 More options Dec 9 2007, 12:25 pm
From: teshca <Nickolay.Artamo...@gmail.com>
Date: Sun, 9 Dec 2007 09:25:11 -0800 (PST)
Local: Sun, Dec 9 2007 12:25 pm
Subject: Re: How can I set focus to my flash object?
Thanks Bobby.
Your solution works fine for me.
I tried to do almost the same, but I used addLoadEvent instead of
addDomLoadEvent so it was't work without setTimeout hack.

On 9 дек, 13:44, Bobby <bobbyvandersl...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »