Animating instance in initializing method
Moderator: MSandro
Animating instance in initializing method
Hi, today I've tried to create a class which should initialize some "instances". The instances should have an animation while they appear.
But this doesn't work. The animation is not visible! The instances are appearing all togather after the inizialisation method is finished.
I think it seems to be a bug, or maybe there is something wrong with my code:
But this doesn't work. The animation is not visible! The instances are appearing all togather after the inizialisation method is finished.
I think it seems to be a bug, or maybe there is something wrong with my code:
Re: Animating instance in initializing method
I had a similar situation in a project.
John explained to me that an instance is not placed on the stage until the initialise method has finished
The way to do it to create the instance and then broadcast a message
Each instance can then respond to broadcast and start doing stuff
Simon
John explained to me that an instance is not placed on the stage until the initialise method has finished
The way to do it to create the instance and then broadcast a message
Each instance can then respond to broadcast and start doing stuff
Simon
Re: Animating instance in initializing method
Thank you for your help. Now I tried this:
It is animating the GP logo, but it shows an "ship" image instead of my defined background ...- Attachments
-
- Inizialisation-Test.gpp
- (14.83 KiB) Downloaded 310 times
Last edited by MSandro on Sep 23rd, '17, 08:52, edited 1 time in total.
Re: Animating instance in initializing method
Hi
I think you've uploaded the old project and not the one in the picture
Simon
I think you've uploaded the old project and not the one in the picture
Simon
Re: Animating instance in initializing method
Sorry, now it should be the latest.
Re: Animating instance in initializing method
I think this is what John suggested to me - make sure all instances are initialised - then do the broadcast
Re: Animating instance in initializing method
PS your method of responding to keypress doesn't work for me - I'm going out but will test more later
Re: Animating instance in initializing method
Thank you very much for your help.
Yes I know.
Edit: while I waited for an reply in this topic, I tried around a bit with "functions".
This is my solution combined with your suggestion:
Yes I know.
Edit: while I waited for an reply in this topic, I tried around a bit with "functions".
This is my solution combined with your suggestion:
Re: Animating instance in initializing method
To fix main class I had to delete it and re-create it - it now works OK
- Attachments
-
- scriptImage.png (2.81 KiB) Viewed 7391 times
Re: Animating instance in initializing method
Ah, now I know, it doesn't work in "helper" classes!