Senior Member
Dynamic video problem
I have a .flv video loading dynamically in a holder mc. Works great, but when I click on a link to another frame it continues to play..
How do I make it stop playing when it leaves that frame?
thanks..
Unload the .flv. By the way, what do you mean "dynamically"?
Senior Member
sporty
thanks for the reply.. i was in a hurry when i sent that question.. Sorry..
I am not sure what the code would be. I have been looking for the unload action but not able to get it to work..
thanks
Registered User
Are you streaming the flv into a video object using netStream?
on(release){
delete my_ns;
}
Senior Member
Yes I am..
And I have button that when pressed goes to a new frame. the movie needs to stop playing..
i will try that code and see.. thanks..
Registered User
That code will stop the movie, but it won't unload it. If your going to another frame, maybe you should delete any frames in the video object layer, so it's just not there at the other frame.
Senior Member
Ok.. that didnt work.. I put the code on the button that I use to take to the new frame..
I am confused on where to put the code and what to use..
Registered User
Not sure what code your using to load the flv. In my case, my_ns is the name of the new net stream object.
Attached Files
Senior Member
Here is my code I am using..
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.play("intromovie.flv");
rewindButton.onRelease = function() {
ns.seek(0);
}
playButton.onRelease = function() {
ns.pause();
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 222;
}
Thanks for helping me out..
Registered User
Add the delete line to the button that goes to the next frame.
Senior Member
Ok,
I am not sure what you mean.. I am sorry just not that good at AS..
Could you post what you mean..
Registered User
Yours might look like this;
on(release){
delete NetStream;
_root.gotoAndPlay(2);
}
Senior Member
Well that doesnt work either.. Error says
Classes, interfaces, and built-in types may not be deleted.
delete NetStream;
any other ideas.. and I do appreciate all your help..
Registered User
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width