A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Flash 8 FLV Playback/Custom UI Volume Components with Global Volume Control

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    13

    Flash 8 FLV Playback/Custom UI Volume Components with Global Volume Control

    I'm creating a multi-scene swf with several FLV Playback - Player 8 Component videos on different scenes/frames.

    I want to use the FLV Playback Custom UI Volume Bar so that when a user makes a volume adjustment during one FLV Playback viewing that volume adjustment will remain throughout the other FLV Playback video viewings.
    This will prevent the viewer from having to make volume adjustments for each viewing. However, I want to enable the volume change to be made and changed at any time throughout any of the video viewings. Another aspect of this is that the FLV Playback Component has a volume setting that would have to be overridden by the global custom UI volume setting.

    Is this possible? If so, how would this be done?

    Thanks!

    James
    jamesk@pacificmm.com

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I made an example. Here is the actionscript for two frames.
    Frame 1:
    PHP Code:
    stop ();
    import mx.video.*;
    import mx.utils.Delegate;
    //
    try
    {
        if (
    volUpdated != undefined)
        {
            
    my_FLVPlybk.stop ();
            
    my_FLVPlybk.close ();
            
    my_FLVPlybk.load ("http://www.helpexamples.com/flash/video/cuepoints.flv");
            
    my_FLVPlybk.play ();
            
    my_FLVPlybk.volume volUpdated;
        }
        else
        {
            
    my_FLVPlybk.volume 100;
        }
    }
    catch (
    err:Error)
    {
        
    trace ("ERROR! ");
    }
    var 
    volUpdated:Number;
    var 
    listenerObject:Object = new Object ();
    listenerObject.volumeUpdate Delegate.create (thisupdateFunction);
    function 
    updateFunction (eventObject:Object):Void
    {
        
    volUpdated eventObject.volume;
    }
    my_FLVPlybk.addEventListener ("volumeUpdate",listenerObject);
    my_FLVPlybk.contentPath "http://www.helpexamples.com/flash/video/cuepoints.flv"
    frame 2:
    PHP Code:
    stop ();
    //
    try
    {
        
    my_FLVPlybk.stop ();
        
    my_FLVPlybk.close();
        
    my_FLVPlybk.load("http://www.helpexamples.com/flash/video/cuepoints.flv");
        
    my_FLVPlybk.play ();
        if(
    volUpdated != undefined)
        {
            
    my_FLVPlybk.volume volUpdated;
        }
        else
        {
            
    my_FLVPlybk.volume 100;
        }
    }
    catch (
    err:Error)
    {
        
    trace ("ERROR! ");
    }
    //
    listenerObject.volumeUpdate Delegate.create (thisupdateFunction);
    function 
    updateFunction (eventObject:Object):Void
    {
        
    volUpdated eventObject.volume;
    }
    my_FLVPlybk_2.addEventListener ("volumeUpdate",listenerObject); 
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    Thanks for your reply. I am receiving some errors though with this code in Flash 8.

    For frame 1:
    **Error** Scene=Scene 1, layer=Actions, frame=1:Line 7: Syntax error.
    ****if (volUpdated != undefined)

    **Error** Scene=Scene 1, layer=Actions, frame=1:Line 8: 'catch/finally' expected
    ****{

    For frame 2:
    **Error** Scene=Scene 1, layer=Actions, frame=2:Line 5: Syntax error.
    ****my_FLVPlybk.stop ();

    **Error** Scene=Scene 1, layer=Actions, frame=2:Line 6: Syntax error.
    ****my_FLVPlybk.close();

    Please advise.

    Thanks.
    James
    jamesk@pacificmm.com

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You are missing a { somewhere. Check the scripts carefully. They worked for me.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    13
    The code is working fine now with no errors. I'm a little confused how to use the two different frames of code as suggested though. Do the two frames of code just start out at the beginning of the timeline or is the later frame of code associated with an additional instance of a new flv?

    Also, the URLs in the examples are identical. Should they be identical? Or would they more realistically be different to meet the original need of this thread to provide global volume control over multiple flvs in one flash movie?

  6. #6
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Just test it out and if there is a problem, come back. I just made a quick example.
    - The right of the People to create Flash movies shall not be infringed. -

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