A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: CS4/AS3...video problem

  1. #1
    Member
    Join Date
    May 2007
    Posts
    39

    CS4/AS3...video problem

    I have an .fla and an .flv saved in the same folder on my desktop.
    The .fla is called videoPlayer
    The .flv is called theMovie
    The folder that they are both saved in is called myPlayer
    My code looks like this

    var video;
    var nc;
    var ns;

    //********************************
    function playVideo( videoToPlay )
    {
    nc = new NetConnection ( ) ;
    nc.connect( null );
    ns = new NetStream ( nc ) ;
    ns.client = this ;
    video = new Video ( 320 , 240 ) ;
    addChild( video );
    video.attachNetStream( ns );
    ns.play( videoToPlay );
    }

    playVideo("??????????????");

    How do I create a path to my flv to put in my function call?
    Thanks for your help.
    Mango

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    Code:
    function playVideo( videoToPlay )
    {
    nc = new NetConnection ( ) ;
    nc.connect( null );
    ns = new NetStream ( nc ) ;
    ns.client = this ;
    video = new Video ( 320 , 240 ) ;
    addChild( video );
    video.attachNetStream( ns );
    ns.play( videoToPlay );
    }
    
    playVideo("theMovie.flv");
    .: To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Twitter - Linkedin
    bringmadeleinehome.com

  3. #3
    Member
    Join Date
    May 2007
    Posts
    39
    webdreamer
    Thanks for the response.I was driving myself nuts trying every conceivable path to display the video.When yours did not work i went back and I started from the beginning .I discovered that out of habit I was using ".flv" as it turns out ".f4v" was the correct extension. I am on the road again...live and learn
    thanks
    Mango

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