A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: FLV: Adding Controls - that work with text animation

  1. #1
    Bmcc*81 bmcc81's Avatar
    Join Date
    Jul 2007
    Location
    Montreal
    Posts
    299

    FLV: Adding Controls - that work with text animation

    Hi,

    I have this video I made that has an flv with simple play, pause and stop. But I need to add replay.

    The thing is that the buttons that I have already don't stop, and play the text animations.

    How do I get this to stop and play the text animations as well as the video.

    This is my listener for the FLV

    Code:
    var n = 0
    
    var listenerObject:Object = new Object();
    listenerObject.cuePoint = function(eventObject:Object):Void {
            trace("Elapsed time in seconds: " + flv_mc2.my_FLVPlybk2.playheadTime);
    		n = n + 20
    		gotoAndPlay(n)
    }
    flv_mc2.my_FLVPlybk2.addEventListener("cuePoint", listenerObject);
    and these are my controls:
    Code:
    this._parent.flv_mc2.my_FLVPlybk2.muteButton = mutebtn;
    this._parent.flv_mc2.my_FLVPlybk2.playPauseButton = playpausebtn;
    
    
    
    
    function raja()
    {
    	klio();
    	trace("kliotech");
    	}
    Can someone teach or tell me how to add REPLAY and to have my text animations stop and play in sync with the FLV?

    Thanks,
    BMCC81
    Bmcc81
    Flash Designer / Web Developer
    -----------------------------------
    http://www.webinkgraphics.com

  2. #2
    Bmcc*81 bmcc81's Avatar
    Join Date
    Jul 2007
    Location
    Montreal
    Posts
    299
    Anyone know what I'm talking about? Or am I way off?
    Bmcc81
    Flash Designer / Web Developer
    -----------------------------------
    http://www.webinkgraphics.com

  3. #3
    Senior Member
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    348
    you sound like you need to nest your text animation in a movieclip.

    then you can simply add some lines of code to the handler which deals with the "click on button" functionality, eg
    Code:
     mymovieclip.play();
    mymovieclip.stop();
    For the replay function, you need to test if the flv has reached the end of it's duration.

    You can either test this with a timer and use the (i think) currentTime/Time property of the flvplayback, together with the overall duration property of the clip; or you can just listen for the VideoEvent.COMPLETE event that the flvplayback component dispatches when it has finished playing your FLV.

    You don't even really need to do anything with the handler, just seek() to the start of the video, then make sure that the play button is still usable; or just make a replay button, make it seek() to the start of the video, then play().

    Does that help?

    Dan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center