Avatar billede mikkel_breum Nybegynder
14. oktober 2001 - 14:42 Der er 11 kommentarer og
1 løsning

updating animated gifs without enterframe

I have an animated gif as a spite on my stage. as long as the framehead is looping the frame the gif also animates. If I call a function uses fx. 5 seconds before it returns framescript, then the animated gif is frozen for those 5 seconds. How can I call upon the animated gif to advance in its animation from within the timeconsuming function? I already call updatestage in each run the slow-function loop... thats not enough.

Avatar billede mikkel_breum Nybegynder
14. oktober 2001 - 14:42 #1
svar evt på dansk hvis du foretrækker det.
Avatar billede lingoman Nybegynder
14. oktober 2001 - 15:01 #2
Advance the frame. The Playback head needs to move in order for other animations to receive timing events.
In your time consuming function, test the time elapsed in several places and send the framehead to
the frame +1
the frame -1

or issue a

go to the frame
updatestage

when the frame interval has elapsed. When the framehead is allowed to move in this manner, Director will be able to issue and process other events

regards,
geo

Just curious though,.. What is the time consuming operation you are processing ?
Avatar billede mikkel_breum Nybegynder
14. oktober 2001 - 15:27 #3
It is a loop that shuffles sprites around the screen randomly a number of times, to give a graphical impression of the ending location being randomly picked. It is the sprite placement and updatestage that makes the process time consuming, not any heavy calculations.

Do you know of any good sources of informtion in general, where I could learn about programming in a fashion that is more \"mutitasking friendely\" I always have the problem, that one function blocks out the other functions that I might want to process simultaniously. I\'m a bit new to programming, but does both lingo, and java/c++. Is it some sort of interrupt structure I have to learn about? 
Avatar billede mikkel_breum Nybegynder
14. oktober 2001 - 15:30 #4
I tried to put

go to the frame
updatestage

into my shuffleSprites loop, but it does not generate any effect on the gifs that still freezes for the period.
Avatar billede lingoman Nybegynder
14. oktober 2001 - 15:40 #5
I\'m fairly certain that you only need a little appreciation for the built-in event structure in Director.
In this particular case, I would call a function to compute and store the random locs in a list and then position the sprites according to the results in an exitFrame handler. This way, there will be no updateStage commands needed, and Director can continue processing any and all other events normally. There wil be no perceptible interruption as the function wil complete its execution in a fraction of a second.
Avatar billede lingoman Nybegynder
14. oktober 2001 - 15:42 #6
Could you please email the file to me? I\'ll be happy to troubleshoot the code with you :)
Avatar billede lingoman Nybegynder
14. oktober 2001 - 15:42 #7
email geo@lingoman.dk
Avatar billede lingoman Nybegynder
14. oktober 2001 - 16:41 #8
What settings have you used for the animated GIF member in the Property Inspector?
Avatar billede lingoman Nybegynder
19. oktober 2001 - 14:23 #9
Have you solved the problem ? If not, I shall be glad to take a closer look at your file this weekend:)
email geo@lingoman.dk
Avatar billede mikkel_breum Nybegynder
19. oktober 2001 - 14:51 #10
well I have solved the problem in various ways:

first: I found out that I don\'t really need to use animated gifs after all, since the same effect could be achieved using small director movieclips as castmembers. Second I\'m restructuring the entire executionflow, so the frameloop will occur more often. I can\'t send you the source at the moment, as the project is confidential for the moment.
Thank you for your help anyway. At a later time, I might be intersted in sharing the code, and have a talk about alternative ways to do it.
do you want the points then post a reply as an \'answer\'.
Avatar billede lingoman Nybegynder
19. oktober 2001 - 15:02 #11
You seem to have solved the problem on your own, so I have not earned your points!
For now, just post any answer so that you can accept and retrieve your points.
By all means, feel free to contact me if and when I may be of assistance to you in the future :)

regards, geo
Avatar billede mikkel_breum Nybegynder
21. oktober 2001 - 18:20 #12
returning my points then
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester