Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events for loading external resources #9

Closed
ghost opened this issue Jun 17, 2013 · 4 comments
Closed

Events for loading external resources #9

ghost opened this issue Jun 17, 2013 · 4 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jun 17, 2013

I am looking for a way to attach an event handler to an externally referenced resource such as a mesh or rather to its parent group.

Currently whenever I try to access information of dynamically added external resources I get an error (in my case calling getBoundingBox on the group containing an external mesh).

Is there a way to bind an event handler to a group containing external resources that gets called as soon as all external resources are loaded and available?

@lachsen
Copy link
Contributor

lachsen commented Jun 17, 2013

Hi there.

What we plan to implement is at least an onload event handler for <data> elements as well as all sink elements (such as <mesh> and <shader>, combined with a loaded property to check the current loading state.
This matches the interface of <img>.

An onload event for <group>, while convenient, will probably not be implemented, as the same behavior can be rather easily simulated with JavaScript. So you can implement a small tool library in JavaScript sending a notification if a group has been loaded.

In any way, we will make sure that onload events for <data> and sink nodes will be properly implemented for the next release.

@ksons
Copy link

ksons commented Nov 13, 2014

Fixed by 9f81973

@ksons ksons added this to the 4.8 Release milestone Dec 5, 2014
@ksons
Copy link

ksons commented Dec 5, 2014

Feature requires documentation

@lachsen
Copy link
Contributor

lachsen commented Dec 8, 2014

Add documentation:
https://github.com/xml3d/xml3d.js/wiki/Events

@ksons ksons closed this as completed Dec 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants