dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: loading a FLV file into Flash?

  1. #1

    loading a FLV file into Flash?

    I'm trying to load a FLV file into Flash (swf) file and it is only loading the audio, and not the video.
    This is the code I have entered:

    nc=new NetConnection();
    nc.connect(null);

    ns=new NetStream(nc);
    my_video.attachVideo(ns);
    ns.setBufferTime(0);
    ns.play("sampleFLV.flv");

    And the page can be seen at http://www.winkletwebdesign.com/temp022wt/

    You'll see that only the music starts playing and the video can not be seen. I downloaded a shareware flv player and have verified that there is video on this flv file so I don't think the problem is with the flv file.

    Any help or suggestions you can provide would be appreciated.

    p.s. I'm using Flash MX 2004
    Last edited by winklet; 11-07-2006 at 11:32 AM.

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Did you place a video object on the stage? Does it have an instance name of "my_video"?

  3. #3
    I put an empty movie clip on the stage and named it my_video. Is there something else I should have done?

  4. #4
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Yep. For Flash video you use a video object rather than a movie clip. Open your library and click the little button with a down arrow on the right side. Select New Video and then drag that onto the stage and give it the instance name of my_video. That should do it.

  5. #5
    Yes! Thank you thank you thank you! The video is loading now. The only problem is the size. it looks like I can manually change the dimensions of the video object, but is there any way to dynamically change them based on the actual size of the video?

  6. #6
    Junior Member
    Join Date
    Mar 2007
    Posts
    3

    Creating video symbol at runtime?

    Quote Originally Posted by rdoyle720
    Yep. For Flash video you use a video object rather than a movie clip. Open your library and click the little button with a down arrow on the right side. Select New Video and then drag that onto the stage and give it the instance name of my_video. That should do it.
    Is there a way to do this at runtime?

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