Load FLV into FLVPlayback component?

I have an array of videos coming from an XML doc. I am getting the name of my video in the trace statement okay, but am not sure how to go about loading the FLV video into the player. I have an FLVPlayback component on the interface named "video". The video I'm going to load will be ("videos/" + videoArray[0])). What is the proper way in AS 3 to load this video?

var start:Number = 0;
var videoConnection:NetConnection = new NetConnection();
videoConnection.connect(null);
var aStream:NetStream = new NetStream(videoConnection);
aStream.play("myvideo.flv");
aStream.pause();
I hope this will help you

Similar Messages

  • Problem loading flv into FLVPlayBack

    Hello All,
    I have set up a test site at
    http://www.sinifdizi.com/test.html.
    When the page loads there is an error. When I look at the
    browser activity viewer it says my video
    http://www.sinifdizi.com/videos/sinif-bol-01_01.flv
    not found. BUT!!!! If you click the first button 'bölüm
    1' then the 'indik' button under '1. BÖLÜM - TANITIM 01'
    the file will download from the server.
    I have tried everything. The page works fine during testing
    but not online. Any thoughts.

    Instructions for adding FLV MIME
    type to IIS

  • Load .flv into empty symbol?

    hi
    is it possible to load an .flv file into a symbol? i know it
    is possible with a .swf file. but it does not seem to work with an
    flv. am i doing somethiing wrong or is it not supposed to work?
    basically i am trying to make different movies load into a
    single movie player (symbol) i can get it to work loading swfs i
    made of the individual videos sitting inside their own fla files
    but i am just wondering if it is possible to just load the flv
    files without the extra complication of the extra fla per video.
    i also know that the way i am doing it is the long way round
    but i know absolutely nothing of action script and am doing it the
    way i was taught in the total training videos that i bought.
    cheers !
    angus

    you should be streaming your flv files. that's what they were
    designed to work.
    you can use the flvplayback component to do all the coding
    for you. all you have to do is assign the flv's location/name and
    the component will do the rest.

  • HELP! possible to load images into a component?

    wanna load a help file that has pictures in it and display using a dialog. what component shld i use? the dialog shld have a vertical scroll pane n the user shld be able to read the info from the file. the pictures will be inserted at random in the file(cos its a help file, need pics for illustrations). how shld i go abt doing this?

    that's the answer i'm afraid of getting. I want to LOAD FROM A FILE(the help file, say a word doc) the contents for display in the dialog, i that possible? i know abt jlabels etc but its gona be another big chunk in my source code and it wont be effective when the help file needs changes->will have to find the method n change the contents manually, really not effective...

  • [AS2 CS3/4] Embed external FLV into an MC using AS2 with timeline control

    Hi, Is there anyway to skip the process of manually embedding
    FLVs into SWF files? I want to load FLVs just as I would an
    external SWF.
    I've searched all over and all i can find is how to load FLVs
    into a FLVPlayer component with stop, play and controls to skip in
    time intervals.
    What I need is the ability to load an external FLV and be
    able to control it as if it were in a MC on the timeline, not as a
    streaming video.
    There are SO many questions out there about the FLVPlayer its
    really polluted any and all search results i've tried.
    Shedding some light on this for me would be greately
    appreciated!!!

    For anyone looking for an actual solution to this issue. If
    you're exporting movies out of After Effects, you can export as a
    SWF.
    The only reason I didn't know about this solution is that its
    not included in the render que options, so just select your comp,
    go to File > Export and select the setting for exporting as a
    SWF.
    Thank you kglad for the info

  • Loading a swf with FLVPlayback component, and the flv restarts playing by itself......

    Hi.
    i have an fla file with 5 keyframes. Each keyframe navigates forward to the following keyframe. On the fifth keyframe, a Loader loads an external swf. The external swf has an flv playback component with sound.
    The fifth keyframe, other than having a button to click to load the swf, has a movie clip that navigates you back to the first keyframe.
    The loaded swf, once loaded, may be removed using removeThis function which has removeChild code as well as a  _flv.stop(); which makes the flv stop when the swf is removed. So u're back on keyframe 5, no sound - good!.
    ASo, all is well and the user can navigate back to the first keyframe (from keyframe 5), and from there continue on to the 2nd, 3rd, 4th and 5th keyframes again,  problems start though, when you get to that 5th keyframe again: that keyframe has an FLVPlayback component playing an flv, which at that point becomes very sluggish as all the mc animations on that 5th frame. And worse, i realize, the flv in the external swf that was previously loaded, starts playing by itself, which i know, because i hear its sound track.
    I tried putting a conditional statement to tell the _flv to stop on keyframes 1 and 5, but that causes errors, considering that the flv is an undefined property from the perspective of those keyframes.
    Any help would be very appreciated:)
    thanks.

    var loader:Loader = new Loader();
    loader.load(new URLRequest("_.swf"));
    house.addEventListener(MouseEvent.CLICK, loadswf1);
    function loadswf1(event:MouseEvent):void
        addChild(loader);
    this is how i'm loading the swf. I tried using   Loader.unloadAndStop() inside that loadswf function but get an error -
    Scene 1, Layer 'a', Frame 75, Line 83
    1061: Call to a possibly undefined method unloadAndStop through a reference with static type Class.

  • FLVPlayback Component fails to call FLV source

    I have a progressive download FLV set up using the
    FLVPlayback Component which has cue points embeded. Everything
    plays back correctly locally or over a network. But once the files
    are deployed to the web the link to the FLV is broken. The Activity
    in Safari reports that the FLV file is not found, when it clearly
    is in the directory as it should be.
    Is there any reason to use Netconn and NetStream with this
    setup, or should this work as is? Any ideas how to cure this. I was
    up all night trying to reach a deadline for today (Tuesday) and I
    banging my head on my desk at this point.
    The link can be tested here...
    http://dev.binaryinteractive.com/transcepta/MultimediaTour/demo.html
    cheers
    mm66

    I am sad to say that is one element I could never figure out.
    The FLV is external and it buffers, so I am not sure it actually
    needs to be preloaded (or can be). The workaround is to hide the
    FLVPLayback component by making it invisible. Make sure it is not
    set to autoplay. Set the video content path early and the video
    will load into the hidden component. Then when you want the user to
    see the video you make it visible and start it playing, as it is
    sitting there pre-buffered and ready to go.
    Hope that makes sense.
    Here are some discussions and nobody seems to have it figured
    out:
    http://www.gotoandlearn.com/forum/viewtopic.php?t=4891
    http://www.gotoandlearn.com/forum/viewtopic.php?t=1264
    http://www.gotoandlearn.com/forum/viewtopic.php?t=1376
    You may need to sign up there to view these files. That forum
    is really good for FLV related issues.

  • Is it possible to import YouTube videos into a flash FLVPlayback component...?

    Hi all,
    I'm now working on a flash website, i need to play a youtube video inside my flash movie.
    In this Flash file i have a FLVPlayback component and i tried to link the youtube video into this but did'nt work.
    Please help me...

    You should find what you need here: http://code.google.com/apis/youtube/flash_api_reference.html

  • 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.

  • Adding time to the FLVplayback component

    Hi everyone, Im using the FLVplayback component for a project im doing. I want to add the time elapsed and time left on the controls. I dont really want to create my own controls, as im happy with the flv playback component. The FLVs playing in the component are external and are loaded into it via as3
    Is there a quick and easy way of doing this?
    Cheers
    Dan

    I have managed to find some code for this component, but im getting some errors which im having trouble to de-bug;
    1118: Implicit coercion of a value with static type Object to a possibly unrelated type Function. vidPlayer.addEventListener("metadataReceived", listenerObject);
    1118: Implicit coercion of a value with static type Object to a possibly unrelated type Function. vidPlayer.addEventListener("playheadUpdate", listenerObject);
    Please would someone take a look and let me know what im doing wrong?
    Thanks
    code:
    var listenerObject:Object = new Object();
    var fullDuration = null;
    listenerObject.metadataReceived = function(eventObject:Object):void {
        fullDuration = prettyTime(vidPlayer.metadata.duration);
    listenerObject.playheadUpdate = function(eventObject:Object):void {
        var paTime = vidPlayer.playheadTime;
        if(fullDuration != null){
    //updates the text box with the instance name timeCode_txt on the root timeline.
    //best to use a monospace typeface like calibri for the textbox font.
            time_txt.text = prettyTime(vidPlayer.playheadTime) + " / " + fullDuration;
    vidPlayer.addEventListener("metadataReceived", listenerObject);
    vidPlayer.addEventListener("playheadUpdate", listenerObject);
    function prettyTime(timeinSeconds):String{
        var seconds:Number = Math.floor(timeinSeconds);
        var minutes:Number = Math.floor(seconds / 60);
        var hours:Number = Math.floor(minutes / 60);
        //Storing the remainder of this division problem
        seconds %= 60;
        minutes %= 60;
        hours %= 24;
        //Converting numerical values into strings so that
        //we string all of these numbers together for the display
        var sec:String = seconds.toString();
        var min:String = minutes.toString();
        var hrs:String = hours.toString();
        //Setting up a few restrictions for when the current time reaches a single digit
        if (sec.length < 2) {
            sec = "0" + sec;
        if (min.length < 2) {
            min = "0" + min;
        if (hrs.length < 2) {
            hrs = "0" + hrs;
        //Stringing all of the numbers together for the display
        var time:String = hrs + ":" + min + ":" + sec;
        //Setting the string to the display
        return time;

  • Loading FLV in Flash using PHP

    Hello,
    I am using flash CS3 and am trying to load a flv using PHP.
    I have a PHP webpage with a SWF in it. In that SWF is a
    FLVPlayback component. I would like to be able to set the source
    for the FLV using a php URL e.g.
    http://www.example.com/index.php?v=12345
    I have searched for hours but still have not come up with a
    way of how to do this.
    Does anyone know. Any help would really, really be
    appreciated.
    Thankyou

    Is the problem in the actionscript or in the PHP?
    IE - did you trace out the "video" variable to know that it
    is getting there?
    If the variable is getting into the Flash, then trace out the
    contentPath of myFLVPlayer after it is set to make sure that things
    are working correctly. (To trace out on the server, I usually place
    a dynamic text box in the swf and set its .txt = what I want to
    see)
    If contentPath doesn't work, you can always use the
    myFLVPlayback.load() function - IE myFLVPlayer.load(video);
    If things are getting set correctly, then you are having a
    pathing issue, and need to make sure that the path for the load is
    set correctly.... IE contentPath = "path/to/flv/"+video;

  • Targeting an FLVplayback component within a nested movie element

    I'm trying to get my own buttons to load FLV movies into the FLVplayback component. I've got it to work in a simple test but need help making it work on a more complex level. The test is here http://lawrencejonespromoprince.com/testvideo.html
    I've named the FLVplayback instance 'my_video'
    The simple buttons have this script in the actions:
    on (release) {
          my_video.load("videonamehere.flv");
          my_video.autoPlay=true;
    This all works great as long as the buttons and the FLVplayback component are on the same frame on the same page. But for the actual use, i need it to work where the buttons are on a nested page within another movie element. So the nest looks like this:
    Scene1   Nestmovie1   Nestmovie2   Nestmovie3
    ...where the FLVplayback component is in Nestmovie2 and the buttons are in Nestmovie3.
    The nesting was needed so the buttons are on a separate slider panel so i can scroll through the list of movies.
    See the actual flash site in progress here http://lawrencejonespromoprince.com/index2.html
    and the movie list (not done) will be on the 30 Promos page.
    So now the question is, how can i target the FLVplayback instance within a nested movie.
    Thanks

    You should be able to use _root references to get back to the main timeline to target the flv player
    on (release) {
          _root.nestedMovie1.my_video.load("videonamehere.flv");
          _root.nestedMovie1.my_video.autoPlay=true;

  • Loading FLV via PHP

    Gang,
    I've been unable to find any solution - or even a solid
    explanation - for this problem anywhere.
    I've built a custom FLV player that needs to rely on a PHP
    script to serve it FLV files in order to control access to those
    files. My player uses the FLVPlayback component.
    My actionscript makes a call like this to the PHP script:
    my_player.contentPath = "resource.php?id=12345"
    I've also tried...
    my_player.load("resource.php?id=12345");
    The resource.php code in question looks something like this:
    header('Content-Type: video/x-flv');
    readfile("my_video.flv");
    When tested, the FLVPlayback component simply won't accept
    the FLV served up to it in this way. It WILL work if loading
    directly from the file system, so I know my actionscript works. I
    can load just about any other type of file into Flash this way,
    including JPG and SWF. FLV is the only format that doesn't work.
    I've added the video/x-flv MIME Type to all test servers I've
    tried this on, so the server should recognize the file.
    So here's the question: How can I get my PHP script to serve
    the FLV to my FLVPlayback-based player?
    Thanks,
    J

    Solved!
    The root cause was that the FLV served up by the PHP script
    was being sent to Flash with a .php file extension, which the
    FLVPlayback component doesn't seem to like. The root solution,
    therefore, was to rename the PHP script with a .flv exension, as
    outlined below.
    The files in the "resources/" folder:
    resources/
    -- .htaccess
    -- test.xxx (a renamed FLV file)
    -- resource.flv (a renamed PHP script)
    The .htaccess file:
    AddType application/x-httpd-php .flv
    The PHP script (renamed to "resource.flv"):
    $filename = "test.xxx";
    header('Content-Type: video/x-flv');
    header('Length: ' . filesize($filename));
    header('Content-Disposition: attachment;
    filename="'.$filename.'"');
    $fd = fopen($filename, "r");
    while(!feof($fd)) {
    echo fread($fd, filesize($filename));
    flush();
    fclose ($fd);
    The salient ActionScript:
    //my FLVPlayback compontent instance is named "video"
    video.load("[server]/resources/resource.flv");
    There may be some extraneous headers in the PHP script, but
    at least it works.
    J

  • AS3 - Refresh FLVPlayBack component!

    Hey Guys,
    I am working on AS3 project using Flash CS3. I have to display some videos using FLVPlayBack component. I am using the same component instance to display videos but when a new video is loaded the max duration property does not updates and hence the onComplete event is never fired.
    I somehow wanted to refresh the component when a new video is to be played. Please let me know various ways to do so.
    Thanks in advance for your kind consideration.

    what code are you using to detect flv play completion?

  • FLVPlayback Component + HTML5

    For a HTML5 Canvas project I'm in need to use imported FLV videos (green screen w/ alpha channel), with the goal to publish it highly compatible on the web. As the FLVPlayback Component is not supported in HTML5 projects, is there some possible workaround to achieve what I want with Adobe's software? If not, could I get briefed how this could be done with other programs/techniques?

    While there have been 'workarounds' in the past, the answer is ultimately that codecs that support this are limited and unreliable. You'll need to use a <canvas> trick to really pull this off which involves separating your alpha channel into its own video, then using an invisible canvas to process the video based on the alpha channels (reading pixel by pixel to determine what opacity percentage to draw of every single pixel). Some people use a specific color in the video as the channel (for instance if you just needed red text, then use a different background color as the alpha). You then draw that to a visible canvas after calculated. It's very unideal but there's no "best way" to do this currently, outside Flash.
    A quick search will show you the techniques I'm talking about but none of them are drag and drop approaches to the problem. They require JavaScript, proper types of video and a bunch of processing.

Maybe you are looking for