A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: How do you have an image placeholder in your video before it starts?

  1. #1
    Filmmaker J-Luv's Avatar
    Join Date
    Jan 2002
    Location
    With her.
    Posts
    1,497

    How do you have an image placeholder in your video before it starts?

    anybody know how i can have an image placeholder in my flash video player before the user clicks the play button to load the video?

    right now i have just a blank black screen and you can't see anything until the video starts.
    Never take life too seriously. Nobody makes it out alive anyways. Film Portfolio


  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    put your image in a movieclip
    place your movieclip in a layer above the video player
    remove the movieclip when you start the video.

  3. #3
    Filmmaker J-Luv's Avatar
    Join Date
    Jan 2002
    Location
    With her.
    Posts
    1,497
    makes sense i i have the video embedded on the timeline, but what if i have it set as progressive download? how do i remove the movieclip once the video starts?
    Never take life too seriously. Nobody makes it out alive anyways. Film Portfolio


  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    what if i have it set as progressive download?

    the code depends on which video component you use.

    for the FLVPlayback component, make use of the FLVPlayback.PLAYING property -
    PHP Code:
    var listenerObject:Object = new Object();
    listenerObject.stateChange = function(eventObject:Object):Void {
    if(
    eventObject.state == FLVPlayback.PLAYING)
    trace(my_FLVPlybk.contentPath " is now " FLVPlayback.PLAYING);
    // remove the movieclip
    }
    my_FLVPlybk.addEventListener("stateChange"listenerObject); 
    If you use a NetStream object to stream video through a NetConnection object,
    make use of the NetStream.onStatus handler.
    PHP Code:
    nsStream.onStatus = function (infoObject){ 
    trace (infoObject.code); 
    if (
    infoObject.code == "NetStream.Play.Start"){
    // remove movieclip

    }; 

  5. #5
    Filmmaker J-Luv's Avatar
    Join Date
    Jan 2002
    Location
    With her.
    Posts
    1,497
    oh cool, so i can just drop this in an actions frame? sorry, not good with coding at all.
    Never take life too seriously. Nobody makes it out alive anyways. Film Portfolio


  6. #6
    Filmmaker J-Luv's Avatar
    Join Date
    Jan 2002
    Location
    With her.
    Posts
    1,497
    oops, guess not, because it didnt work.

    where would i put this code at?

    thanks in advance
    Never take life too seriously. Nobody makes it out alive anyways. Film Portfolio


  7. #7
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    as i stated - the code depends on which video component you use.

    so the question still remains - which video component are you using ?

  8. #8
    Filmmaker J-Luv's Avatar
    Join Date
    Jan 2002
    Location
    With her.
    Posts
    1,497
    flv playback component
    Never take life too seriously. Nobody makes it out alive anyways. Film Portfolio


  9. #9
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    flv playback component
    PHP Code:
    /**
    For Flash 8 > ActionScript 2
     Requires:
      - FLVPlayback component on the Stage with an instance name of my_FLVPlybk
    */
    import mx.video.*;
    my_FLVPlybk.contentPath "your.flv";
    var 
    listenerObject:Object = new Object();
    listenerObject.stateChange = function(eventObject:Object):Void {
            if(
    eventObject.state == FLVPlayback.PLAYING)
    // remove the movieclip 
    movieClipInstanceName.swapDepths(10000); // change movieClipInstanceName to the
    movieClipInstanceName.removeMovieClip(); // instance name of your clip
    }
    my_FLVPlybk.addEventListener("stateChange"listenerObject); 
    hth

    also for any other reference to FLVPlayback component, please see -
    Help Files > FLVPlayback Component > FLVPlayback class

  10. #10
    Banned
    Join Date
    Oct 2008
    Posts
    74
    Quote Originally Posted by J-Luv View Post
    anybody know how i can have an image placeholder in my flash video player before the user clicks the play button to load the video?

    right now i have just a blank black screen and you can't see anything until the video starts.
    Hello! If you are using playerdiy.com and SWFObject to embed the flash video player, you can add preloader to your web player with the below code:
    Code:
    so.addParam('flashvars','playerOpts=preLoader*Arrow.swf*s');
    Check this Customize Preloader button page for more information.

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