Add a symbol from the library to the scene dynamically


#1

I found this: Dynamically add a symbol from the resource library

A year and a half later: is this now possible?

I have a project were I need to add multiple (20 ish) objects to the stage based on the user input. For mobile-purposses, I don’t want to have them on stage ALL the time.


(Mark Hunte) #2

@oneuppedgames
This should really be tacked on to the end of that discussion and not a new post.

Saying that, the answer is pretty much still the same.

Normally you would just load an image as you needed it into an element.

But if you had an animating element then you could load this though use a widget and change it’s source. The source being the hype exported pages that have a single animated element/image … what ever… with the source document background to transparent

You then change the src for each input. you can put animation on the widget to move the animations across the scene.

wdigetLoad_mhv1.zip (563.4 KB)


#3

Hi Mark,

Thank for your reply, and I’m sorry for not tacking it on the other thread (I wasn’t sure what was better: to kick and 550 day old thread or opening a new one).

Anyway, I’ve taken a look at your example (thank you for that), however, it isn’t exactly matching with what I want to achieve. The idea is that the HTML-widget (or any other object) is dynamic, and not so much the contents of the HTML-widget (or any object).

The idea is that I get a value from the server (based on a ‘draw’). And I have to spawn an # amount of objects based on the server-value. I don’t know how much I have to spawn. In your example this would correlate to an # amount of HTML-widgets (instead of a specific content for the HTML-widget).

Any idea’s?


(Mark Hunte) #4

I think you will be stuck a bit what ever you do.

You may be able to clone some elements but the problem with cloning is you will not be able to clone the animations of the element.


#5

I’ll see what I can do, maybe change the concept a bit.

Should I drop this as a feature request? To be able to instantiate library-objects would be a real valuable addition.


(Mark Hunte) #6

You could do but give it a full usage case scenario to help them understand. Include what you would expect the library file to be like, where it would be store/exported and load and run behaviour.


#7

Cool. I’ll think about it :slight_smile: Thanks.