Create another component (Sprite) using blocks

I don't know if it's possible to use some blocks to duplicate a component (without extensions). Example : duplicate an image every 3 seconds.

As far as I am aware, it is currently not possible to duplicate a component in AI2 without the use of extensions, and even then duplication is not quite the correct word: you can create another component of the same type, with the same properties.

Okay Thanks

I think you can achieve this by using hide and seek of Sprite component. You can have a pool of already created component which is hidden or visibility is false whenever you need you can pick a Sprite from that pool of available Sprites and make them visible.

PS: I have not experimented this, but I think it is doable with some success close to the requirement.

This can also be achieved using dynamic components in which you can create new components dynamically with time(i guess)

Take this for reference

I think it's the only solution. My goal was to simulate meteorites falling in different places and increasing their number over time.

Sorry but I must not use an extension x)

In which case you will need to add as many sprites as you think you will ever require, and manage their visibility/actions accordingly. Consider how you might reuse the same sprite "once it has fallen".

Yes it's a good idea. But I can't do otherwise

Thank you very much to everyone for the relevance of your answers and your response time !

1 Like

Maybe you can draw and erase them in a Canvas or in a WebViewer using SVG graphics?

Sample projects:

I can try. But I don't think I have the skills even with the document...

Not meteors (snowfall) but you can adapt.

App uses 9 Sprites. Hides them all.

SnowStorm.aia (32.9 KB)

Start, then every 15 seconds the app makes another Sprite visible on the Canvas at a random location until all 9 Sprites create a heavy snowfall. Change the image and you have meteorites falling.

Useful information needed to adapt to your requirements.
15 seconds is 7500 ms. The app has 9 sprites, add more until the performance becomes sluggish.

This is what others have recommended as you cannot instantiate Sprites with Blocks. Provide many Sprittes, hide them and display them as required. :slight_smile:

Another sample ...

I'm really sorry I couldn't respond earlier. Thank you so much for this script :slightly_smiling_face: ! I have one last little question. Is it possible to make the ImageSprite start/end outside the canvas?
Thanks again because I had tried to do something that was messing up :sweat_smile:

Don't give me a script :sweat_smile:

Did the SnowStorm.aia solve your original issue Roprilo?

Yes. Thank you so much :slightly_smiling_face:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.