14. oktober 2001 - 14:42Der 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.
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 ?
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?
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.
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\'.
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 :)
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.