Sie sind nicht angemeldet.

jschrader

Fortgeschrittener

  • »jschrader« ist der Autor dieses Themas

Beiträge: 237

Wohnort: Bavaria, Germany

Beruf: Photographer, Producer

  • Nachricht senden

1

Donnerstag, 28. Juli 2011, 20:51

Small parent child problem

Hi guys,

I have linked an image (plugin as child) to a hotpsot (hotspot as parent) to make it follow the spot while rotating the panorama.
The image will only be visible when clicking the hotspot.

Works ok. But: The area of the image (child) appears clickable even when hidden. Setting the child to enabled="false" has no effect.

Any clues?

Zephyr

Profi

Beiträge: 1 003

Wohnort: Netherlands

Beruf: Web developer

  • Nachricht senden

2

Donnerstag, 28. Juli 2011, 21:08

the child takes over all the attributes of the parent. I think when you hide the plugin you should remove the parent attribute.

I think the design of the child/parent should be altered a bit. for instance, if the parent doesnt have a enabled attribute defined. then the child can set its own enabled attribute. But as soon the parent has the attribute, it overwrites all the children. I think it should be different: If the child has a property, it should aplply it to itself (overwrite the parent), else take the parents,

If I for instance make a textfield, 1000px wide, and 20 heigh, to act as a background for some buttons, and then add a textfield button, then no matter what I add as width/height or other property. I uses the property of the parent. Which for me, limits the use of the parent/child system. Strangely enough, if the paren is an image, I dont seem to have those issues.

3

Donnerstag, 28. Juli 2011, 21:19

Hi,
when hidden
what means "when hidden" in this case?
is "visible" of the child set to "false"?
alpha="0.0" itself is not enough not make a element really hidden,

the enabled="false" for children elements doesn't work for the visual shape itself,
it disables the element itself but when the visible shape will be part of the parent and still be clickable,

a hint to make children elements not clickable would be to use the "pixelhittest" setting from the 1.0.8.14 version, then only the image/shape of the parent element itself will be checked,

best regards,
Klaus

4

Donnerstag, 28. Juli 2011, 21:22

Hi,
the child takes over all the attributes of the parent. I think when you hide the plugin you should remove the parent attribute.
that's not totally right,
a child element will be placed inside/under a parent element,
the attributes itself don't change in any way,

so when a parent element will be hidden, then also all children elements are hidden automatically because they are located inside the parent,

best regards,
Klaus

jschrader

Fortgeschrittener

  • »jschrader« ist der Autor dieses Themas

Beiträge: 237

Wohnort: Bavaria, Germany

Beruf: Photographer, Producer

  • Nachricht senden

5

Donnerstag, 28. Juli 2011, 21:46

Argh, visible, of course.
I have used that for the same reason in another part of the code and thought I had also used it here.
Obviously I didn't.

But I agree with Zephyr, at least from a certain point of view it could make sense to let the child on demand override the settings inherited from the parent. (But as a non coder I completely understand if that was BS from an insiders point of view, hehe).

Thanks to all for pointing me into the right direction.

6

Freitag, 29. Juli 2011, 15:23

Hi,
But I agree with Zephyr, at least from a certain point of view it could make sense to let the child on demand override the settings inherited from the parent. (But as a non coder I completely understand if that was BS from an insiders point of view, hehe).
I agree too, but here I'm a bit limited by the Flash DisplayList or the HTML DOM, they work in that way.

best regards,
Klaus