Hi,

That's interesting behavior.

When you say removing the observer complicates things...why? Knowing
that would help people address your issue.

I would probably address it in one of two ways:

1. Use a flag (e.g., to indicate that the Flash stuff is there), and
have your event handler check the flag. But if that also complicates
things, then:

2. In the event handler, look to see if the Flash content is there.
E.g.:

    var theDiv = /* ...get the div, e.g., via $ or $$ or whatever */;
    theDiv.observe('click', handleClick);
    function handleClick(event) {
        if (!this.down('object') && !this.down('embed')) {
            // The Flash content isn't there; add it
        }
    }

(I don't use Flash, but IIRC you use either <object> or <embed> to put
it in, so...) That example looks for any <object> or <embed> element,
but you can narrow that down with more precise CSS selectors. For
instance, if you use a `data-name` attribute on the element to
specifically indicate what it is, then

       if (!this.down('*[data-name=theFlashStuff]'))

Docs for Element#down here:
http://api.prototypejs.org/dom/element/down/

FWIW, HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com


On Aug 7, 10:36 am, steve <[email protected]> wrote:
> Hi,
>
> I have a click observer attached to a div. When the div is clicked
> it's content is replaced with flash content. In Chrome and IE the
> controls on the flash component, which has now replaced the original
> content of the div, are fully accessible and usable but in Firefox
> when you try to use the controls on the the flash component the
> original div click observer fires again and reloads the flash content
> making the flash component unusable. Removing the observer does allow
> access to the flash control but this complicates the situation for me.
> I would of thought the content inside a div would precede the div
> itself. Anybody know why I'm seen different behavior in Firefox and is
> there anyway to allow flash content and it's controls to out-weigh the
> div observer?
>
> All the best,
> Steve

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to