Syncing animation with movie?

  • CE/ Pyrocy
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jul 14, 2006
  • Posts: 374
  • Loc: Santa Barbara, CA
  • Status: Offline

Post February 21st, 2008, 7:03 pm

Hey every1,

I was wondering how to sync an animation or MC load to a certain time in a movie playing on the same frame?

Like if theres an explosion at 1min 23 seconds in a streaming flash video.... is it possible to have a MC start when the streaming video reaches 1min and 23 seconds?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 21st, 2008, 7:03 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post February 22nd, 2008, 6:32 am

Yes, you use action script "listeners". Just do a search for that and you'll find the information and tutorials you need.

Also if you are streaming FLV's you can add cuepoints to the FLV's during encoding. That actually makes the action script much easier because the cuepoints are already embedded in the movie, but you can still use listeners without the embedded cuepoints.

Here's an example of one I made that listens for the end of the movie and then returns to the beginning to replay. The cuepoint "endLoop" is embedded at the end of the FLV. my_FLVPlybk is the instance name of the FLVPlayback component.

Code: [ Select ]
stop();

import mx.video.*;
var listenerObject1:Object = new Object();
listenerObject1.cuePoint = function(eventObject:Object):Void {
    var cuePtName = eventObject.info.name;
    if (cuePtName == "endLoop") {
    my_FLVPlybk.seekToNavCuePoint(0);
    
    //trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
    //trace("Cue point name is: " + eventObject.info.name);
    //trace("Cue point type is: " + eventObject.info.type);
     }
};
my_FLVPlybk.addEventListener("cuePoint", listenerObject1);
  1. stop();
  2. import mx.video.*;
  3. var listenerObject1:Object = new Object();
  4. listenerObject1.cuePoint = function(eventObject:Object):Void {
  5.     var cuePtName = eventObject.info.name;
  6.     if (cuePtName == "endLoop") {
  7.     my_FLVPlybk.seekToNavCuePoint(0);
  8.     
  9.     //trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
  10.     //trace("Cue point name is: " + eventObject.info.name);
  11.     //trace("Cue point type is: " + eventObject.info.type);
  12.      }
  13. };
  14. my_FLVPlybk.addEventListener("cuePoint", listenerObject1);
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • CE/ Pyrocy
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jul 14, 2006
  • Posts: 374
  • Loc: Santa Barbara, CA
  • Status: Offline

Post February 22nd, 2008, 9:44 pm

thanks Atno, exactly wat i was looking for!
  • munni
  • Born
  • Born
  • No Avatar
  • Joined: Mar 28, 2008
  • Posts: 3
  • Status: Offline

Post March 30th, 2008, 11:10 pm

hello sir;

i want dynamic photo gallery with flash using XML.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 29 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.