[AS2] Controlling loaded FLV sound??

While I haven't any hints in the documentation on how to
control a dynamically loaded FLV's sound(volume), everywhere I read
that you create a Sound object on the parent MovieClip. This isn't
working
var nc = new NetConnection();
nc.connect(null);
var ns = new NetStream(nc);
mc.vid.attachVideo(ns); // MovieClip on stage with Video
instance named "vid"
ns.play('TestVideo.flv'); // this all works, video loads and
plays full volume
function onMouseUp(){
var snd = new Sound(mc);
snd.setVolume(25);
What am I doing wrong?

I seriously spent 2 hours trying to figure this out and got
no where. I posted this question literally a minute ago, and have
just figured it out:
mc.attachAudio(ns);
I should have posted this question two hours ago ;-)

Similar Messages

  • How to load and display the external flv video files in dynamicly and the how to control the flv fil

    How to load and display the external flv video files in dynamicly using AS 3.0
    and  How to control the flv file  add the play paus button and add seekbar.
    I have using to load the flv file following code
    var flvPlaceHolder1:MovieClip = new MovieClip();
    var vid1:Video = new Video(734, 408);
    flvPlaceHolder1.addChild(vid1);
    addChild(flvPlaceHolder1);
    flvPlaceHolder1.x = 1059;
    flvPlaceHolder1.y = 152;
    var nc1:NetConnection = new NetConnection();
    nc1.connect(null);
    var ns1:NetStream = new NetStream(nc1);
    vid1.attachNetStream(ns1);
    var listener1:Object = new Object();
    listener1.onMetaData = function(evt:Object):void {};
    ns1.client = listener1;
    ns1.play("GV-1600 TURNING.flv");
    ns1.addEventListener(NetStatusEvent.NET_STATUS, statusChanged1);
    function statusChanged1(ns1:NetStatusEvent):void
             trace(ns1.info.code);
            if (ns1.info.code == 'NetStream.Buffer.Empty')
                 trace('the video has ended');
                 removeChild(flvPlaceHolder1);
                 //trace('removeChild');
                gotoAndPlay(1786);
    then how to add the play,paus ,full screen button    and   seekbar,volumebar.

    I have to Create the flash presentation for our company product
    In this presentation the left  side the text animation are displayed then right side the our product video is displayed.
    In this presentation i need the following option :
    1, The first product video and animation is finished then the next product is played
    2, then the video displayed  (size width and height 400x300) , I click this video to increase the size(ex:1000x700)
    3, then the playing video i control  it play, stop, paus button and volume bar, seek bar.
    4, then this presentation is displayed on 42 inches LCD TV so this full presentation is run full screen.
    I have finished first two steps 1 and 2
    the following are the screen short and code:-
    code :-
    var count=0;
    var flvPlaceHolder2:MovieClip = new MovieClip();   
    var vid2:Video = new Video(734, 408);
    flvPlaceHolder2.addChild(vid2);
    addChild(flvPlaceHolder2);
    flvPlaceHolder2.x = 1059;
    flvPlaceHolder2.y = 152;
    var nc2:NetConnection = new NetConnection();
    nc2.connect(null);
    var ns2:NetStream = new NetStream(nc2);
    vid2.attachNetStream(ns2);
    var listener2:Object = new Object();
    listener2.onMetaData = function(evt:Object):void {};
    ns2.client = listener2;
    ns2.play("GS-4000.flv");
    this.addEventListener(Event.ENTER_FRAME, BtnFadeIn2);
    function BtnFadeIn2(event:Event):void
        if (this.currentFrame == 387)
            /*flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            trace('Screen size is changed');*/
            if(count==0)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
            count++;
    ns2.addEventListener(NetStatusEvent.NET_STATUS, statusChanged2);
    function statusChanged2(ns2:NetStatusEvent):void
        trace(ns2.info.code);
        if (ns2.info.code == 'NetStream.Buffer.Empty')
                trace('the video has ended');
                 removeChild(flvPlaceHolder2);
                 //trace('removeChild');
                gotoAndPlay(433);
    flvPlaceHolder2.buttonMode=true;
    flvPlaceHolder2.addEventListener(MouseEvent.CLICK,home2);
    function home2(e:MouseEvent):void
        if(vid2.width==734 && vid2.height==408)
            flvPlaceHolder2.x = 30;
            flvPlaceHolder2.y = 140;
            vid2.width=1800;
            vid2.height=800;
        else
            flvPlaceHolder2.x = 1059;
            flvPlaceHolder2.y = 152;
            vid2.width=734;
            vid2.height=408;

  • AS3, 33rd FLV loaded loses sound: with solution

    Loading FLVs into an flvplayback component, the 33rd FLV
    loaded is silent, and no FLVs loaded after this will have sound.
    I had assumed that as the instance was leaving the stage and
    it's parents etc were being deleted, and there were no persistent
    references to the content, the player would deal with garbage
    collection.
    It seems this is not the case.
    I don't know why the 33rd is the one to fail, but I guess 32
    might be the maximum number that work?
    So, if loading multiple FLVs into your movie, remember to
    manually close the FLVs once they are finished, before loading the
    next one.
    I used
    myFlvPlayback.getChildAt(0).close();
    you could also use
    currentVideoPlayerIndex =
    myFlvPlayback.activeVideoPlayerIndex;
    myFlvPlayback.closeVideoPlayer(currentVideoPlayerIndex);
    but I found that this errors when you have only loaded one
    video, as you can't closeVideoPlayer where the current index is 0.
    I can't find anywhere in the documentation that states that
    you can only load a maximum of 32 videos into the player, perhaps
    it's a sound channel limitation? It would have been helpful for
    there to be a note of it in the help files!
    Maybe I should have known to manually clean up anyway, but
    hopefully this will save a few people a few hours of head
    bashing.

    Good question!
    They are all being loaded into a single component. However,
    the component is in a MC being attached dynamically using "new
    VideoPanelClass()" (the name of my specific class for the MC that
    includes the FLVPlayback), and is being removed from the stage in
    between loadings - not just for a split second but for significant
    lengths of time. I had imagined it would count as a new component
    each time, but it seems this is not the case, despite it tracing as
    a new instantiation of the parent MC each time.

  • Loading a sound twice causes error

    I am trying to load a sound in an mp3 player based on the selection of a user who
    has the .swf embedded in a web page. The first time the user makes a selection
    the selection loads with no problem. But if the user stops the sound or lets it play
    to the end and starts it again, I have to be careful not to call sound.load(URLRequest)
    again.
    If the user has chosen another selection to listen to, then load() has to be called again.
    The question is:
    how do I unload the sound Obj so another mp3 file can be loaded into it and played?
    I would think that load(another URLRequest) would overwrite the first and not complain.
    ( a deeper question is where is the sound file stored, by the browser -- in the case of
    html embed-- or does the Flash plugin maintain its own cache?)
    Thank you for time, attention, and advice, info, etc.
    JK
    PS: I realize that load() has more use than for sound objects

    Thank you for the reply.
    So, if there is a changeable play list length, I need to create new
    objects for each
    list item dynamically? And all the necessary objects cannot be hard
    coded. The
    name for each object has to be generated programmatically.
    As it is programmed, my app has server code that opens and reads a play
    list
    directory and creates an html list of the contents. So managing the
    content is
    just a matter of adding or removing files from the play list directory.
    This would mean that for every selection the user loads and plays, an
    object will
    persist. It would be nice to be able to unload selections to reduce the
    memory
    use. Or limit the size of each mp3 file, as well as the list length.
    As it is the only way to load a new selection is to reload the browser
    window.
    That suggests that the browser cache holds the content of the object,
    perhaps
    as a parent of the Flash plugin or activeX control(?).
    I am sorry this is long winded, but these nuances are obscure in
    manuals and
    texts.
    JK

  • Controlling an FLV with a DW behavior

    Is there piece of Javascript, or better yet, an extension out
    there that I can use to control an FLV in a DW page?
    I am developing e-learning pages using Dreamweaver, where
    video #1 plays and the learner has to answer a question about it.
    When they click a "Check My Answer" button, I want video #1 to stop
    so I can play video #2.
    The "Control Flash" behavior doesn't work on FLVs.
    Thanks,
    Mary

    On Fri, 14 Jul 2006 20:41:43 +0000 (UTC), "maryhowe"
    <[email protected]> wrote:
    > I am developing e-learning pages using Dreamweaver,
    where video #1 plays and
    >the learner has to answer a question about it. When they
    click a "Check My
    >Answer" button, I want video #1 to stop so I can play
    video #2.
    >
    > The "Control Flash" behavior doesn't work on FLVs.
    The Control Flash, or any other JavaScript solution, is
    unreliable at
    best. Your best bet would be to put the button in the Flash
    movie, and
    have it load the second movie.
    Gary

  • I lost sound shortly after iOS 6 was down loaded. Sound works headphones.

    I lost sound shortly after iOS 6 was down loaded. Sound works with headphones. When no headphones are plugged in and I try to use the volume control on side sound effects comes up but no sound is made. I get sound over main speaker when i adjust alert volume. I restarted and downloaded iOS 6 update with no results.

    Try this:
    1. Settings>General>Use Side-Switch To>Lock Rotation.
    2. Double-click the Home button and swipe Task Bar to the right.
    3. Make sure the button on the far left of Task Bar is not muted

  • Controlling imported flv's

    Hi.
    I want to have a video imported in flash and controlled
    through action script for pause and resume actions and maybe
    replay.
    I converted a .mov into a .flv and imported the flv in flash.
    I did it that way because i need it to be in a certain spot with a
    mask and only pauseble by click.
    So is there any way to control the flv by click or i have to
    load at runtime the whole thing and trigger it through action
    script?

    I have followed Dean's instructions but the Flash progress
    slider and volume
    slider's that are in Flash don't really work. You can click
    on them and
    drag them about a pixel but it seems as though Director is
    grabbing the
    mouse event before you can finish dragging the slider. The
    play/pause
    button in Flash works fine, I'm guessing because a single
    mouseDown/mouseUp
    gets through.
    "womp" <[email protected]> wrote in message
    news:g2u2gu$btj$[email protected]..
    >I have a project where I'll be given FLV files. Which is
    the best way to
    >implement them.
    >
    > 1) add them to SWF files and use Lingo to control the
    video?
    >
    > 2) create a self contained Flash file with all video
    controls and use it
    > as a sprite in Director?
    >
    > 3) use the FLV's by themselves, imported into Director
    with Lingo
    > controlling them?
    >
    > Thanks for any help
    >
    > Craig
    >
    >

  • FLVplayback Not Loading FLVs

    I'm using a remote hosting service for my FLV storage (
    http://www.blip.tv). When I load
    FLVs remotely into my player, they just seem to load infinitely
    without play control. All except for 1. There is 1 video that
    actually loads and plays just fine, which indicates to me it might
    not be a problem with the host.
    Below are testing-purpose links. (This is a php script which
    passes the flv link to my player). The first one will work and load
    correctly, the second link loads forever.
    http://behindlacrosse.com/videos.php?video=http://blip.tv/file/get/Treschonde-BehindLacros seEp3249.flv
    http://behindlacrosse.com/videos.php?video=http://blip.tv/file/get/Treschonde-BLSummer2006 2549.flv
    I've tried this with several different flv's, and only that
    first one above ever loads. I'm not doing anything complex with my
    code, I use the following actionscript:
    _root.playback.play(vidurl);
    I've traced the vidurl variable to ensure that the urls are
    correct. So I'm really stumped on this one.
    One more interesting note.. in Firefox, on that website
    linked above, if you click on any of the other videos in the list,
    they won't load. It's like the player locked up. But in Internet
    Explorer, you can still click other videos to bypass the currently
    loading one.
    Any help or suggestions at all? I appreciate anything.

    This is the way I work with videos.
    Each video is in a differente frame.
    Name you FLV playback like movie1, movie2, etc.
    You may have a frontpage that links to each video or place a
    button on the keyframe where you want specific video to play. For
    example, on movie1, place a button. On movie2, place another
    button.
    The code below is used assuming you customized your video
    controller.
    // in a MovieClip named Video Controller insert a play, pause
    and stop buttons and a slider//
    stop();
    import mx.video.*;
    movi1.contentPath = "EditedFlash/Text_Edited.flv";
    movi1.playButton = VideoControl.my_playButton;
    movi1.pauseButton = VideoControl.my_pauseButton;
    movi1.stopButton = VideoControl.my_stopButton;
    movi1.seekBar=VideoControl.my_seekButton;
    var cuePt:Object = new Object ();
    cuePt.time =0.5;// title - no voice//
    cuePt.name = "Pt1";
    cuePt.type = "actionscript";
    movi1.addASCuePoint(cuePt);
    movi1.addASCuePoint(3.2, "Pt2");
    var listenerObject:Object = new Object();
    listenerObject.cuePoint = function(eventObject:Object): Void{
    if(eventObject.info.name=="Pt1"){
    _root.Texto.gotoAndStop("uno");
    if(eventObject.info.name=="Pt2"){
    _root.Texto.gotoAndStop("dos");
    movi1.addEventListener("cuePoint", listenerObject);
    //second cue point//
    movi1.addEventListener("cuePoint", listenerObject);
    listenerObject.complete = function(eventObject:Object):Void {
    _root.Texto.gotoAndStop("uno");
    movi1.addEventListener("complete", listenerObject);
    Hope this helps.

  • Load another sound in the same sound object

    Hi,
    I am loading a sound like this:
    public var smallSound:Sound = new Sound();
    public var trans1:SoundTransform = new SoundTransform(1, 0);
    public var channel:SoundChannel = new SoundChannel();
    smallSound.load(new URLRequest("firsttrack.mp3"));
    channel=smallSound.play(0,1,trans1);
    When an event occurs (button click actually) I would like to stop playing the first sound and playing another sound in the same object. So I try doing this:
    smallSound.load(new URLRequest("secondtrack.mp3"));
    channel=smallSound.play(0,1,trans1);
    but it does not work. The first sound keeps playing. I havent understood something probably.. Can someone help me ??

    ok, i solved my problem. It works like:
    channel.stop();
    smallSound = new Sound;
    smallSound.load(new URLRequest("secondtrack.mp3"));
    channel = new SoundChannel;
    channel=smallSound.play(0,1,trans1);

  • AS2 SWF loaded inside a AS3 SWF

    Hi,
    In a recent project I had to load a FlashPaper2 document
    inside a SWF implemented in AS3. I read a couple of articles about
    Darron
    Shcall's article and
    FlashInterface
    but none of them seemed to be useful in my case.
    I needed to load a FlashPaper SWF inside a AS3 and couldn't
    rely on ExternalInterface since they were not two separate SWF's.
    To be more clear, I was using the Loader class via a Sprite to load
    the FlashPaper SWF.
    Anyways, I created FlashPaperLoader.SWF implemented in AS2
    which was used to load the FlashPaper SWF. This loader was able to
    communicate with the FlashPaper APIs (AS2). As you can guess, the
    AS3 SWF was used to load the FlashPaperLoader.swf.
    What I don't understand is how come the FlashPaperLoader the
    FlashPaper document SWFs can communicate with each other thru AS2
    function calls when they are loaded inside a AS3 SWF, I thought
    that due to VM differences, no communication is possible!
    I hope I was clear, if I was, any guru insight is really
    appreciated.
    Cheers.

    Thanks kglad,
    But you still haven't answered my question. I am not looking
    for solutions, my own solution works. I wanted to understand more
    about the VM's.
    AS3
    var request:URLRequest = new
    URLRequest("./FlashPaperLoader.swf");
    var loader:Loader = new Loader();
    loader.load(request);
    AS2
    var loader:MovieClipLoader = new MovieClipLoader();
    loader.loadClip("./FlashPaperDoc.swf", fpContainer);
    // the loader SWF used IFlashPaper APIs to communicate with
    the FlashPaper SWF.
    Now, the first part (AS3), all that code is interpreted by
    VM2. Once an AS2 SWF is loaded a
    AVM1Movie
    is created and no direct communication between AS3 and AS2 is
    possible. I am curious to know how come the two AS2 SWFs can
    communicate with each other while inside the VM2 space.

  • Problem with loading a sound file

    Hello, I am trying to play a sound file (located in same dir as the class files) from a swing app using this line.
    AudioClip clip = Applet.newAudioClip(new URL("sound.au"));When I run the program, I always get a MalformedURL Exception.
    Could someone please tell me the correct way to load a sound file in swing.
    Thanks

    "sound.au" is no valid URL, hence the exception.
    How about "file:///c/myfiles/sound.au" or something?

  • Control 2 flv movies with one button

    Hello,
    I am not even sure this can be done, but I am trying to
    control 2 flv's with one set of controls. The reason; We have
    footage of a talking head as one flv and footage of a microscope.
    Basically, the guy talks and moves the microscope around. These 2
    flv's have to be synched b/c the guy is talking and showing how
    things look under a microscope (the original footage was shot at
    the same time using 2 different methods - I imported both in
    Flash). So, my quandry is that I need one set of controls for both
    these flv's b/c if you pause the talking head, you also have to
    pause the scope. I tried to make both flv's a movie clip and
    control them that way, but got no where with that. I also tried to
    build my own skin with a Play and Pause Button for now, but only
    got as far as the code below. Basically, I can control one flv
    component, but not both at the same time. Any ideas would help - I
    am not sure if this is an AS issue, or a complete design issue, or
    if it can even be done at all - thanks much in advance...
    Jason

    I have discovered that what I wanted to do above is not possible in Livecycle. The only thing that works in the Livecycle script editor is the xfa.host.print from what I found.
    I was able to add a print button to a form that I scanned in that enabled me to print at 2 different printers at the same time. What I did was to first set up a mouse up action to execute a menu item (file>print) and then I added a second mouse up action to run the JavaScript below
    var pp = this.getPrintParams();
    pp.interactive = pp.constants.interactionLevel.automatic;
    pp.printerName = "\\\\DPDSVR\\Xerox WorkCentre 7435 PCL6";
    this.print(pp);
    This resulted in me being able to print to my default printer (HP) and the Xerox with just one click of the button.

  • I have just added sound fonts in my library bank, but everytime i try to load a sound tru DLS my logic crashes... Plz help.

    I have just added sound fonts in my library bank, but everytime i try to load a sound tru DLS my logic crashes... Plz help.
    cassykeys

    Have you tried importing them into the EXS 24 ? Assuming the process is the same if you're on Logic X, its just a matter of putting the soundfont files into the ~/Library/Application Support/Logic/Sampler Instruments folder and the EXS converts them when you try to load them - its explained properly in the Software Instruments manual (EXS24 section), but its very quick and  easy. It might provide a decent alternative.

  • Externally loaded FLV

    In my SWF fie, I have an externally loaded FLV file.
    I now want to add another FLV that will load and play
    automatically when the first one is finished.
    I actually want the SWF to jump to a new scene when the first
    movie is done.
    How can I do that/ what the actionscript?
    Steven

    Hey Steven,
    I am not very sure but just giving a shot answering it...
    You can use FLVPlayback.complete event to detect the
    comepletion of first flv and set the path of other flv on complete.
    Something like this:
    import mx.video.*;
    my_FLVPlybk.contentPath = "
    http://www.helpexamples.com/flash/video/clouds.flv";
    var listenerObject:Object = new Object();
    // listen for complete event; play new FLV
    listenerObject.complete = function(eventObject:Object):Void {
    if (my_FLVPlybk.contentPath == "
    http://www.helpexamples.com/flash/video/clouds.flv")
    my_FLVPlybk.play("
    http://www.helpexamples.com/flash/video/water.flv");
    my_FLVPlybk.addEventListener("complete", listenerObject);
    Hope that works...

  • Unable to load/play sound files using SoundEngine_LoadEffect

    Hi All,
    I am able to load/play sound files using SoundEngine_LoadBackgroundMusicTrack but unable to load/play sound files using SoundEngine_LoadEffect on iPhone Simulator. I am using the SoundEngine.h/cpp from Crash Landing. Oddly enough sound effects load and play succesffully when i start the app with 'Start with Performance Tool'. Does anyone know what is actually going on.
    Also i would like to know what is the difference between playing sound files using these two methods. What are the restrictions on individual sound file types for each method.
    Thanks

    I was able to load/run the sound effects after using Simulator - iPhoneOS 2.1 in the Active Target/Build drop down on Xcode toolbar. Both Active SDK, and Active Executable should be 2.1 in order to play the sound effects.

Maybe you are looking for

  • Portal30 Installation/configuration problems.

    Subject: Portal30 Please share your solution in installing th Oracle Portal 3.0 (included in Oracle 9iAS installation.). I am facing problem in its installation on WINDOWS 2000 server. The first time I installed the Oracle 9iAS 1.0.2, the Portal30 an

  • Mail update and lost inbox messages

    I am new to Macs. When I opened my Macbook today it automatically started an update to Mail. when it was done my settings for my ISP changed (eliminated my account settings and all that's there now is .Mac which I signed up for as a curiosity but don

  • Error in Crystal report when selecting OPOR

    Hi, I'm using Crystal Report 8.5 in formatting reports in SAP and when i select OPOR and POR1 tables i received an error message like this: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQ

  • XML Element of XML Element of XML Element (and so on...)

    Here is my XML data (shorted, in a file myFile): <LiveData> <Voltage> <Total> <VoltageNow>1052</VoltageNow> </Total> </Voltage> <Power> <Total> <PowerNow>345</PowerNow> </Total> </LiveData> I would like to get the VoltageNow and PowerNow values, but

  • Check Spelling Before Send

    It's a trivial thing, but embarrassing if you expect it and it doesn't happen. Sure, turning on spell check puts red lines under misspelled words. However it's not easy to correct them on the Z10; you can't right-click the word, etc. On the 9900 and