Link to home
Start Free TrialLog in
Avatar of hzrdc2
hzrdc2

asked on

Controlling animations from video cuepoints actionscript 3

I'm pondering something and looking for advice...

I am building this proof of concept animation that is based off an FLV talking head. The FLV has cue points so the user can jump to different sections. The interface has moving elements as well (gauges/dials/counters) and I would like to add additional cue points to trigger these animations.

Is this a valid thing to do, or am I asking for problems? Meaning, that at cue point one, jump to frame label X, which plays the animation that resides on the called frame.

I want the video and the various animations to stay in snyc, so I thought this would be a good idea.

Any suggestions would be appreciated.
Avatar of Korsa
Korsa
Flag of Sweden image

Let's say you have 3 cuepoints (question, answer, grade).

cuePointListener = new Object();
cuePointListener.cuePoint = function(eventObject){
        callFunction(eventObject.target.name);
};

function callFunction(cueName){
        switch (cueName) {
                case "question":
                trace("Ask your question");
                break;
                case "answer":
                trace("Get the answer");
                break;
                case "grade":
                trace("Grade the answer");
                break;
                default:
                //
        }
};

Is this what you ment?
Avatar of hzrdc2
hzrdc2

ASKER

Hmmm... that looks intriguing...

I have been using the attached snippet... it works, but I now need to have the video pause at each cue point.
function cuePointHandler(event:MetadataEvent):void
{
   trace("name = "+event.info.name);
   
   // Go to a frame label with the cue point name
   gotoAndStop(event.info.name);
}
 
flvControl.addEventListener(MetadataEvent.CUE_POINT, cuePointHandler);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Korsa
Korsa
Flag of Sweden image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hzrdc2

ASKER

I just did and it works perfect, thanks!
Cool. Happy coding :)