I'm working on my final report of my current traineeship, and it has to be a multimedial production (CD Rom) I chose to make it in Director, not as a flash-website as many of my classmates, but as a full screen production.
The main screen consists of a background image, a menu and some minor animations. Or it would have those animations if it weren't for my unexcusable absolute non-talent for Lingo *grrmmmbl*
The animation an sich is very simple. There is a tree on whose branches flowers bloom. It can be translated to the following code:
global counter
on enterFrame me
counter = counter + 1
if counter < 60 * 60 then
go to the Frame
else
if counter >= 60 * 60 then
go to frame2
counter = 0
end if
end if
end
Don;t bother with testing it: this piece of code works just fine.
What happens after this is that the movie starts to play on frame 2 and slowly the flower becomes visible. This takes 500 frames.
After that, when the visibility is 100%, the counter kicks in again in a frame script, and the movie waits another minute (60 * 60 ticks) before the visibility gradually fades to 10%. This also takes 500 frames.
Now, this flower takes about three minutes to complete it's cycle from unvisible to visible to invisible again. But I want flowers that have an even longer cycle and I don't want my score to become 2000 frames or maybe more.
Then I thought: hey, if I take a new movie, make the cycle and then put it all in a movie-loop and then import this loop into my main movie I'm done. But for some reason, the loop doesn't include my scripting, so I lose the 2 delays of 3600 ticks.
Now I see two options: I find a way to link the increase of the opacity of the flower to the ticks and I imagine it would go something like:
if counter > 300 then
if counter = counter + 50 then
sprite (1).opacity = sprite (1).opacity + 10%
end if
end if
(I know this is not the correct syntax but if this is the correct solution, then someone please tell me the right syntax?)
Or another possibility is that I create two loops, one for the increase and one for the decrease of the opacity of the flower and I use the option to change the castmember of the sprite after every x ticks. That would like:
on exitframe me
counter = counter + 1
if counter >= 60 * 60 then
set the member of sprite(1) to loop1
counter = 0
counter = counter + 1
end if
if counter >= 60 * 60 then
set the member of sprite(1) to loop2
counter = 0
counter = counter + 1
end if
end
and then on frame 5 (or whichever following frame) I create a loop of "On exit frame me go to the frame"
Now, is one of these a good solution and if it is, what would be the correct syntax?
Thank you very much for at elast reading my post this far I'd be even more grateful for a sensible reply because I really don't know it anymore.
The summary: what's the best way of taking a long time to change the opacity of a sprite from 0 % to 100 % and back to 0 % again?