PDA

View Full Version : Problem with Video Playback



cytech
March 4th, 2007, 02:10 PM
Hey all,

Quick question... I am placing an "PLAY" arrow on my movie so that the user has to click it before the movie plays, similar to what YouTube might do.

On the root frame I have this code:


var myConnection = new NetConnection();
myConnection.connect(null);
var myStream = new NetStream(myConnection);
_root.mcVideo.attachVideo(_root.myStream);


Very basic and simple... nothing fancy just want to make it work.


Now, I placed an on(release) command within the Arrow that is placed ontop of the playback.

It holds:



on(release){
this._alpha=0;
trace(_root.movie);
_root.myStream.play(_root.movie);
}


Now when I trace the _root.movie (which was previously loaded) it displays "j.flv" which is the test movie I have in there. The myStream DOES NOT PLAY though.

Now it gets interesting when I remove _root.movie and replace it with just
_root.myStream.play("j.flv");

It then plays. It seems like it will not take the movie variable. Which is a bit odd, maybe I have a wrong variable type not sure...

ANY ADVICE is great apprecaited!! :)

cytech
March 4th, 2007, 05:47 PM
Figured it out - I was right haha (scary I know)...

When I was loading the string "j.flv" from an XML document the video playback was looking at it as a whole string, not as a .flv file - so instead what I did was just give the name in the XML file "j", and then concated the .flv as the file extension within the program and bam it works. :jailbreak