Dynamic FLV contentPath problem

  • yoogie8
  • Newbie
  • Newbie
  • yoogie8
  • Posts: 8
  • Loc: London

Post 3+ Months Ago

I have looked at lots of discussions about assiging a variable as the contentPath for a media component, I am still stuck.

If I hard code the contentPath the video loads fine:

videoName = "http://myserver.com/video/file_example.flv";
videoBox.load(videoName);

However as a variable (from XML) it does not work:

videoBox.load(_root.video_2);

I have tried using setMedia() but with no joy.

Help!
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

u sure that _root.video_2 contains the actual name of the video name?
  • yoogie8
  • Newbie
  • Newbie
  • yoogie8
  • Posts: 8
  • Loc: London

Post 3+ Months Ago

Yes I have. It is the correct name and path and is a string.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

this code works ok for me:
Code: [ Select ]
my_playback.autoPlay = true;
my_playback.setMedia("get_video1.flv", "FLV");
my_playback.totalTime = 430; //seconds -> this have to be changed
my_playback.autoSize = true;
  1. my_playback.autoPlay = true;
  2. my_playback.setMedia("get_video1.flv", "FLV");
  3. my_playback.totalTime = 430; //seconds -> this have to be changed
  4. my_playback.autoSize = true;

and no videoBox.load(_root.video_2); needed
all you need is to change: my_playback.setMedia(_root.video_2, "FLV")
  • yoogie8
  • Newbie
  • Newbie
  • yoogie8
  • Posts: 8
  • Loc: London

Post 3+ Months Ago

I could not get the media component to accept the filename/path to the flv files as a variable.

After reading the following:

http://www.quip.net/blog/2006/flash/how ... rnal-video
http://livedocs.macromedia.com/flash/mx ... whimpl/com

Instead of using the FLVPlayback component I am using the videoPlayer.

Code:

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoBox.attachVideo(ns);
ns.play(_root["video_" + clientNo]);

this enables me to feed the video names in as variables.
  • bigFrog
  • Born
  • Born
  • bigFrog
  • Posts: 1

Post 3+ Months Ago

I got it to work fine for me. I am pulling the url from an XML file also and loading it into an array.

This way I get the benefit of the premade controlers and can set the video on the fly.


videoToPlay = videoListArray[2]

_root.video.load(videoToPlay);

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.