I'm stumped.. I've found one t utorial but haven't figured out how to use it in conjunction w/ the media player component.. here is the link for it.. http://www.flashcomguru.com/tutorials/progressive_preview.cfm if anyone could help explain step by step on where to put AS and what to do so it pauses on video so it has a thumbnail image i would appreciate it
create a new layer called "actions" lock the layer, and click the frame. Open the actions panel. paste this in there nc = new NetConnection(); nc.connect(null); ns = new NetStream(my_nc); ns.setBufferTime(0.1); my_video.attachVideo(ns); // my_video is the instance name of the media player on stage( you must click it once and type in this name where it says <instance name>) ns.play(" http://www.yoursite.com/video.flv); ns.onStatus = function (info) { if(info.code == "NetStream.Buffer.Full"){ ns.pause(); } }; then your button will tell, ns (NetStream), to play. EX: my_btn.onRelease = function(){ ns.play(); };
**Error** Scene=Scene 1, layer=Layer 5, frame=1, Line 6: String literal was not properly terminated ns.play("CDDdemo2.flv); **Error** Scene=Scene 1, layer=Layer 5, frame=1, Line 8: ')' or ',' expected ns.onStatus = function (info) { Total ActionScript Errors: 2, Reported Errors: 2
You didn't put end quote on the FLV file name, should be
sorry, just noticed I didn't in my example. My fault.
[b]replace[/b] ns.onStatus = function (info) { if(info.code == "NetStream.Buffer.Full"){ ns.pause(); } }; [b]with[/b] ns.onStatus = function (info) { trace(info.code); if(info.code == "NetStream.Buffer.Full"){ ns.pause(); } }; Tell me what traces out..
NetStream.Play.Start NetStream.Buffer.Full
Okay, I just noticed you are using the Media Component, well the NetConnect and NetStream classes are not made for that. In your library panel, top right corner just below where the close button is, you will see a little symbol with Three lines and an arrow pointing downward. Click that and select New Video. Hit okay, and drag that video to the stage. Give it the instance name my_video. Test.
okay, you have the component on stage. Open the component inspector window, and type the URL to the video. Then down at the bottom click the + symbol. For name, type in, pauseIt. Then enter the time you want it to pause at, it goes, Hours:Minutes:Seconds:Milliseconds. Now, go back to where your previous code was, delete it and paste this in there var myCuePointListener:Object = new Object(); myCuePointListener.cuePoint = function(eventObject:Object){ if(eventObject.cuePointName == "pauseIt"){ my_video.pause(); } }; my_video.addEventListener("cuePoint", myCuePointListener);
ok do yo have a flash source i can just replace w/ my vid? this is getting confusing..
okay.. do i need to replace myCuePointListener w/ the cuepoint name?
put the component back on stage and give it the instance name of, my_video. I told you to do that to get the NetConnect and NetStream to work. http://www.imediapro.com/damonTesting/test/cuePoint.fla.zip. You will need to click the component on stage, open the component inspector and enter the URL to your video. It will pause after 2 seconds.
So you are using the FLVPlayback Component than. Why don't you zip up your file, and post a link to it. I'll fix it from there. You don't know enough for me to grasp what is going on on your side. I've gone through 3 iterations now of different possibilities.
So you are using the FLVPlayback Component than. Why don't you zip up your file, and post a link to it. I'll fix it from there. You don't know enough for me to grasp what is going on on your side. I've gone through 3 iterations now of different possibilities.
var myCuePointListener:Object = new Object(); myCuePointListener.cuePoint = function(eventObject:Object){ if(eventObject.info.name == "pauseIt"){ trace('CDDdemo.flv'); myVideo.pause();
Don't see what you're looking for? Try a search.
|