Okay, now things are getting a little complicated.
I need to build a Flash object that can sit over the corner of an image to serve extra content.
It’s way beyond my Flash skill level, my work is usually limited to print work in Photoshop and Illustrator so please excuse me if any of the following isn’t clear. I am trying to learn though, so any pointers in the right direction would be greatly appreciated.
So this is how it’s all supposed to work, along with my issues;
-
When the image & Flash item load a small looping animation will play to draw the eye/show the item as interactive.
When the user rolls over this the corner will peelback. I have a working peelback animation for the rollover, that reacts to mouse over/mouse off, and a looping animation for the initial, but I cannot work out how to make the initial loop until mouseover, then play the peelback when the mouse is over. And go back to the initial animation loop if the user rolls off. (Each of these animations is stored as a movie clip in the Library) -
Then it gets more complicated… if the user stays on the corner until it is fully peeled back I need to make a small countdown (sort of a 3, 2, 1 situation) show, before launching a lightbox (would this have to be jQuery, or could it be done in Flash?) in the browser to serve the content.
Thanks for any help that anyone can offer, with any part of this. Like I say, I am doing my best to learn so any explanation would be greatly appreciated!
UPDATE: Based on the OP’s comments, a new suggested solution is outlined below.
I have written out a revamped (but untested) solution below. Since you are relatively new to Flash I added a few little “detours” that I hope will clarify how parts of ActionScript 3 work, especially with regard to event handling.
Starting over, this is how I would set up your main FLA timeline:
… Lastly, on the last frame of the curl_mc timeline (after your countdown sequence), add this code to a keyframe on that timeline’s actions layer:
There’s more than this one way to code this situation, of course. However with this approach you see how you can create and “dispatch” events from one area of your application and have them handled by functions you wrote in a different place.
HTH!
ORIGINAL ANSWER:
Use the ActionScript functions gotoAndPlay() and gotoAndStop().
You can use these two functions to create loops and control the playback of animations. For example if you create a keyframe, select it, and open the Actions window, you can add this ActionScript:
As soon as the play head reaches this keyframe, the timeline will jump to and play from frame 1. This would create an infinite playback loop from frame 1 to your keyframe. Every time the play head hits this keyframe it will jump back and restart.
You can also use frame labels if they are defined on the timeline, such as:
gotoAndStop() works the same way, except it will jump to the given frame and stop the animation there.
Just to clarify, there are two functions to perform:
When the user hovers the mouse over the corner (the “hot spot”), a secondary animation will begin to play and take an action when it is finished
Flash must raise a lightbox on the web page
Re: function #1, the simplest way I can think of is to add your countdown animation to the end of your rollover animation. This effectively creates one long rollover animation with an action at the end.
Re: function #2, you can use Flash to call Javascript functions, including a function that will show the lightbox. At the end of your countdown animation you can add a keyframe and use this ActionScript 3 code:
If you have a Javascript function in your web page called JS_ShowLightbox(), it will be called when Flash reaches this keyframe.
HTH,
Ross