dcsimg
A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 26 of 26

Thread: How to stop the FLV sound, not playing in all pages?

  1. #21
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    hi, im having the same problem.
    Im doing a uni project and this is the first time using actionscript.
    i have an flv playback on a page, when i use the back button the movie keeps playing.
    Its a flv playback component so doesn't have any actionscript the only action script i have is for the button to go back to the preview page.
    Can anyone please help me and tell me what script need to be put on the button to stop the flv playback?
    Thank you

  2. #22
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Give your videoplayer a name in the properties channel. In your backbuttonscript use the name of the player for example myPlayer
    myPlayer.closeVideoPlayer ();
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #23
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    hey, thanks for the reply. I tried using the piece of code in the back button actionscript but it comes up with an error.

    The code now looks like this:
    backbtn.addEventListener(MouseEvent.CLICK, clickHandler1014);
    function clickHandler1014(event:MouseEvent):void {
    gotoAndStop("movieinfo");
    avatar_flv.closeVideoPlayer ();
    }

    With an error code of:
    1136: Incorrect number of arguments. Expected 1.

    I dont understand why its not working, i've tried moving the new piece of code around but makes no difference. Any idea why?
    Thank you

  4. #24
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Leave it where it was and try 0 as argument in the function

    avatar_flv.closeVideoPlayer (0);
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  5. #25
    Junior Member
    Join Date
    Nov 2010
    Posts
    5
    Thank for the reply, this stops the error message from coming up and the pages work fine but the video still plays. The only thing i can do is turn off the sound but i'd much rather the sound there.

  6. #26
    Senior Member calmchess's Avatar
    Join Date
    Sep 2006
    Location
    Earth
    Posts
    2,588
    I use a custom event it propagates to all frames so if frame 1 starts or stops the sound and i navigate to frame 10 then i can dispatch from frame 10 to frame 1 the stop sound event and stop the sound

    PHP Code:
    dispatchEvent(new Event("TYPE_STOP",false,false);
    ClassNameRefIfNeeded.addEventListener("TYPE_STOP",StopSounds,false,0,true); 
    ~calmchess~

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