[CS3] Pause Flv On Frame 1 Whilst It Buffers?
Hi there,
The site I'm developing at the moment has an FLV at the beginning which is used as an intro animation. I'm streaming it in using netStream but I've run into a problem.
Is it possible to have th flv pause on the first frame of the video and then play once enough has been buffered? At the moment it shows a black screen sometimes.
I thought that a way to combat this would be to have a screenshot of the first frame that I display until it starts playing and then just remove it once the video gets to frame 2. However, I don't know how to track whether the playhead has gone past the first frame in flvs.
Can anyone shed any light?
Cheers
Matt
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-22-2008, 08:16 AM
View Complete Forum Thread with Replies
Sponsored Links:
Is It Possible To "pause" The BG Loop Whilst An Flv Is Playing?
I thought I remembered an "onExitFrame" command, but it doesn't seem to be there anymore.
Essentially, when the button is pushed and the movie progresses to the frame holding the flv player, I'd like it pause the bg loop (or kill it), but to reload or restart it when the user hits a menu button to resume exploring,
Any thoughts? I'm assuming this is a common need...??
Thanks guys!
J
View Replies !
View Related
FLV Buffers Then Pauses
I am progressively downloading video in my flv player and the init buffer is set to 10. Sometimes though it plays for a second then buffers then pauses then buffers even if it looks as enogh info has been buffered. I want to know if it could be cause how I have my function set up. Here is the code. If anyone nows a better more efficient way to do this please let me know.
ActionScript Code:
//Video Code
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(10);
ns.onStatus = function(info) {
trace(info.code)
if (info.code == "NetStream.Play.Start"){
netStreamStopRedundancyCheck = setInterval(stopRedundancyCheck, 10);
}
if (info.code == "NetStream.Buffer.Full") {
//Hide buffering message
bufferClip._visible = false;
}
if (info.code == "NetStream.Buffer.Empty") {
//Show buffering message
if (ns.time<duration) {
bufferClip._visible = true;
bufferClip.gotoAndPlay(2);
}
}
if (info.code == "NetStream.Play.Stop") {
//Action called when video stopes playing (end)
clearInterval(netStreamStopRedundancyCheck);
trace(ns.time+"; duration:"+duration);
if (ns.time>=(duration-0.01)) {
showEndInfo();
preview.gotoAndStop(1);
preview._visible = true;
largePlay.gotoAndStop(6)
largePlay._visible = false;
_global.playStatus = false;
videoEnd = true;
}
}
if (info.code == "NetStream.Play.StreamNotFound"){
_global.badStream=true;
}
};
stopRedundancyCheck = function(){
if ((ns.time > duration-0.39) && (ns.time > 0)){
movieControls.loader.progressbar._width = (duration/duration)*barWidth
showEndInfo();
preview.gotoAndStop(1);
preview._visible = true;
largePlay.gotoAndStop(1);
largePlay._visible = false;
_global.playStatus = false;
clearInterval(netStreamStopRedundancyCheck);
videoEnd = true;
}
}
View Replies !
View Related
[FMX04] Are Back Buffers Possible?
I'm attempting to create an effect system that will allow for motion blurs and a variety of other effects.
My attempt to create this system is by using a series of movie clips that are duplicates of a main movie clip, each a snapshot slightly farther back in time.
This doesn't work, as I think I may be lacking some fundemental understanding of how clip duplication works.
Below is code that should be creating a duplicate clip, 10 frames behind in time. The clip exists but the sub-clip isn't attached.
ActionScript Code:
// The main movie clip.var main_mc : MovieClip;main_mc = this.createEmptyMovieClip("main", this.getNextHighestDepth() );// Dynamic add a child movie clip of a squarevar obj_mc : MovieClip;obj_mc = main_mc.createEmptyMovieClip("obj", this.getNextHighestDepth() );MovieClip = new MovieClip();obj_mc.lineStyle(2, 0x000099);obj_mc.beginFill(0x5050FF); obj_mc.moveTo(0,0); obj_mc.lineTo(30,0); obj_mc.lineTo(30,30); obj_mc.lineTo(0,30); obj_mc.lineTo(0,0);obj_mc.endFill();var i : Number = 0;this.onEnterFrame = function(){ // Move sprite clip, increase amt before frame copy. obj_mc._x += 1; i++; // Wait 20 frames before duplication. if (i > 20) { i = 0; mc1.removeMovieClip(); main_mc.duplicateMovieClip("mc1", this.getNextHighestDepth() ); // ??? - clip is duplicated, but no child clip "mc1.obj_mc"? }}stop();
When duplicating clips, is it possible for dynamically added sub-clips on that clip get duplicated as well?
View Replies !
View Related
Playing Movieclip While Sound Buffers...
Maybe I'm too tired today or just because I'm a woman but can't find out in AS3 how to make a stupid preloader...
Code:
s = new Sound();
buffer = new SoundLoaderContext(4000, true);
s.load(new URLRequest("yeah.mp3"), buffer);
sc = s.play();
This is my code and I have a stupid small clock with two frames, 1st stopped, 2nd working. Just want the user to know that the sound is buffering... MC should stops when sound is playing, not when totally loads.
Any tips??
I feel really frustrated today.
View Replies !
View Related
Separate Buffers For Vid Clips On Same Timeline.
hi,
You'll probably laugh at me for the rookie way I set this up,....but here goes,....
I have a site I'm playing some video clips in. Basically just an ext .swf that has buttons and the following code on fr1.
Code:
stop();
b1.onRelease = function() {
gotoAndStop(5);
}
b2.onRelease = function() {
gotoAndStop(10);
}
b3.onRelease = function() {
gotoAndStop(15);
Then, in fr5, fr10, fr15, etc,.... I'm using separate keyframes to place repetitive code for each video clip, as follows...
(I know this is probably NOT the best way to do this, but it's about my level right now.)
Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
---
ns.setBufferTime(45); // buffer 45s of vid b4 start playing
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible =false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible =true;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}
---
theVideo.attachVideo(ns);
ns.play("domino.flv");
etc....
My problem is that after you load-in any one vid, when you click on another button to watch another clip, onStatus() no longer works properly because the buffer is actually full from the prior video. I guess my question is how do I create a separate buffer for each vid clip?
Thanks in advance, as always. :)
View Replies !
View Related
Uploaded 4mb MP4 Buffers Indefinitely But Works Locally?
I can view my mp4 file locally within a swf but when I upload it to my host it will not play, it buffers indefinitely. This is only a 4mb file. Am I missing something simple here? All of the files are in the same directory, html, swf, player template, js file...
It is set to progressive download and not streaming too.
Thanks for any help.
View Replies !
View Related
Inserting An Advertisement In The Flash Player While The Video Buffers
Hi!,
I have a web site with videos and they will be streamed thru a flash player. Now my requirement is basically a skin with the following feature..
A JPEG advertisement is displayed while the video connects and buffers. Once the video is ready, the JPEG is removed and the video plays. At the completion of the video, the JPEG is replaced. I shall be using a banner ad management software so as to make a geo targeting ad..
Well my requirement is that I need to have static advertisement displayed while the video connects and buffers. JPEG is removed and the video plays. At the completion of the video, the JPEG is replaced.
Can anyone help me as to how it is done OR give me script for the same.
Please feel free to contact me on my email.. sukhmaniaps@rediffmail.com
regards,
Ajeet
Text
View Replies !
View Related
Pause Frame
Hi
I have used a very simple script which would tell a frame to pause for a second or more (depending on the amount of time assigned). I can't remember the script but i know i found it on this site. Have looked and looked but can't find it again. Does anyone know this script. I have found one which seens complicated so i'd like to use one which is very simple and easy to follow. (i don't understand actionscript too well)
thanking you
View Replies !
View Related
Pause At Frame
can anyone tell (or send) me the code I need to pause a movie at a certain frame for X seconds?
I know you can do it director but I haven't been able to find it in my actions references.
Thanx
CobyCo
View Replies !
View Related
Frame Pause
the following code was desinged for flash5
pauseDuration = 25*1000;
framesInLoop = 2;
if (startTime == null) {
startTime = getTimer();
gotoAndPlay(_currentframe-framesInLoop);
} else {
lapsedTime = getTimer()-startTime;
if (lapsedTime<pauseDuration) {
gotoAndPlay(_currentframe-framesInLoop);
} else {
startTime = null;
}
}
will it work in flash mx? or does some of the code need editing?
please help
View Replies !
View Related
Frame Pause
the following code was desinged for flash5
pauseDuration = 25*1000;
framesInLoop = 2;
if (startTime == null) {
startTime = getTimer();
gotoAndPlay(_currentframe-framesInLoop);
} else {
lapsedTime = getTimer()-startTime;
if (lapsedTime<pauseDuration) {
gotoAndPlay(_currentframe-framesInLoop);
} else {
startTime = null;
}
}
will it work in flash mx? or does some of the code need editing?
I did try this AS. it was ment to loop 2 frames for 25seconds and then move on to the next frame but its not working.
i got the script from macromedia.com and it says i can use it in mx please help
View Replies !
View Related
Pause FLV On First Frame
How do you pause an FLV as soon as it loads, so that it freezes on the first frame of the movie?
I can get it to pause 3 or 4 frames after it has loaded by using the following code:
myNetStream.onStatus = function(infoObject)
{
if(infoObject.code == "NetStream.Buffer.Full")
{
myNetStream.pause();
}
}
But with the above approach you can see the first few frames play until the buffer is full (obviously).
Does anyone have any suggestions?
View Replies !
View Related
[F9] Pause At Last Frame Of Flv
Hi there
You've probably had this question hundreds of times but I'm completely stumped about this one... I'm trying to get rid of the black flicker screen at the end of the video on this site:
www.midair.info
The video plays through to the end and then goes to an url which is the main page, however it flickers up a black screen inbetween the first page and the following one. All I want this to do is either replace that black screen with an image or pause the last frame so there is no flicker.
I'm a beginner to all this, and the code I am using right now is:
Code:
var myListener = new Object();
myListener.complete = function():Void
{
getURL("http://www.midair.info/main.htm");
}
// replace video with the instance name you choose for your FLV
MIDAIR.addEventListener("complete",myListener);
MIDAIR is obviously the instance for my flv file. I am using the standard flv player that comes with Adobe Flash CS3. Thanks to anyone that may be able to help me
View Replies !
View Related
Pause Within A Frame
Hello all
I'm creating an eLearning course in Flash. When a user clicks a button I want to run a movie file, pause for 500 ms or so, and then add some text on the screen.
Does anyone know a funky way to do this? I'd really appreciate some help.
Here is the code I have now:on (release) {
this.Beep1._visible = true;
this.Beep1.play();
this.Message._visible = false;
this.Bodytxt.htmlText = "text added here.<br><br>";}Thanks in advance
MMH
View Replies !
View Related
How Do I 'Pause' On A Frame?
How can I pause on a frame for 5 seconds without using a while statement or something similar?
I have a game and when the user finishes the first level I want the movie to pause on the frame for 5 seconds and then run a script. Surely flash is capable of something this simple without messing around with stupid workaround scripts?
Thanks in advance,
Chris.
View Replies !
View Related
Pause FLV On First Frame
How do you pause an FLV as soon as it loads, so that it freezes on the first frame of the movie?
I can get it to pause 3 or 4 frames after it has loaded by using the following code:
myNetStream.onStatus = function(infoObject)
{
if(infoObject.code == "NetStream.Buffer.Full")
{
myNetStream.pause();
}
}
But with the above approach you can see the first few frames play until the buffer is full (obviously).
Does anyone have any suggestions?
View Replies !
View Related
Pause In Frame
Hello Everyone,
I am having an issue with a flash project.
The project is a fairly simple presentation that goes from one movie to the next.
it is divided in 6 main .swfs:
1. container
2. navigation
3. Animation1
4. Animation2
5. Animation3
6. Animation4
The "AnimationN .swfs" have 3 main frames in them.
Here is the issue:
I need the movie to pause in a certain frame wait for a few secs. and continue playing ... find the next frame where it needs to pause again, wait and so on and so forth ...
If the issue is clear (pretty late here and way too tired of dealing with this issue) please hit a reply with a hint!
Thanks in advance!
View Replies !
View Related
Pause FLV On First Frame
How do you pause an FLV as soon as it loads, so that it freezes on the first frame of the movie?
I can get it to pause 3 or 4 frames after it has loaded by using the following code:
myNetStream.onStatus = function(infoObject)
{
if(infoObject.code == "NetStream.Buffer.Full")
{
myNetStream.pause();
}
}
But with the above approach you can see the first few frames play until the buffer is full (obviously).
Does anyone have any suggestions?
View Replies !
View Related
Help, What Else. Have A Frame Pause Until The Next Is Loaded?
I have a simple movie. Five frames with pictures, and before each frame a simple frame that says "image loading".
ex: (frames)
loading, images, loading, images, loading, images...
There will be back and next buttons on each of the image frames.
I'm looking for a real simple script in the loading frame it will wait until the next is loaded before advancing to the next.
I suppose a back button that will go back two frames will be needed too, to skip the loading one.
It's been so long I can't recall how to do anything. I appreciate all help.
If anyone knows of a way to this without having to specify frame #'s it would even be better, so the same code could be used throughout, I don't know how to scecify next frame or two frames back in a relative fashion
View Replies !
View Related
Pause Frame For 10 Seconds
I am sure there is an actionscript for this, I am sorry if this has been covered recently but I would like to have the frame lag for 10 seconds (so they can read) then auto forward to next frame...slide show style. I know I can add more frames to equal the time but I wanted a more efficient method. Thanks for the help!
View Replies !
View Related
How Do I Pause For 1 Second, Fade Out, Then Go To The Next Frame?
I can't get this to work right. It fades out but it gets to a point where it starts flickering for about 10 seconds then it goes to the next frame.
Code:
onEnterFrame = function() {
//Fade in
if (master._alpha < 100) {
if (master._alpha >= 0) {
diff = +5;
}
master._alpha += diff;
}
//after the fade, fade out
nextFr = function () {
//fade out
if (master._alpha > 0) {
if (master._alpha <=100){
diff = 5;
}
master._alpha -= diff;
}
//when its done go to the next frame
if (master._alpha == 0){
delete master.onEnterFrame;
nextFrame();
}
}//end function nextFr
//stop the frame
stop();
//call the function after 3 seconds
myInterval = setInterval(nextFr, 2*1000);
}//end onEnterFrame function
View Replies !
View Related
Code Help - Pause On Each Frame
Hi there,
I'm trying to make a really simple slideshow, 1 image on 1 Keyframe (only 5 images) and I'm trying to have a play button that will show each image for a number of seconds before moving onto the next image.
Code:
stop();
status="BeforeWait"
if (status=="BeforeWait"){
//play button
play_btn.onRelease = function(){
status = "StartWait"
}
//next button
next_btn.onRelease = function() {
gotoAndStop(_currentframe+1)
}
//previous button
prev_btn.onRelease = function(){
gotoAndStop(_currentframe-1)
}
}
if (status=="StartWait"){
counter=0
status="NowWaiting"
}
if (status=="NowWaiting"){
counter+=1
if (counter>12)
{
status="FinishedWaiting"
}
}
if (status=="FinishedWaiting")
{
// All the stuff you want to do after the wait is completed
}
I'm using the code that was mentioned above (which was from another post, but was in the 3D area), but what am I doing wrong.
I'm very new to flash and any help is much appreciated.
S
View Replies !
View Related
[F8] Pause Movie On Last Frame.
Hey guys,
My site is this: http://www.housepaintinglouisvilleky.com/
I'm trying to play a flash movie through then pause it on the last frame forever.
When I place
stop();
on the last frame, it automatically wants to restart the movie.
I want the movie to pause on the last frame then stay there forever.
I tried putting in
pause();
but this didn't work.
I know this is a super newbie question but any input would be greatly appreciated!
Thanks,
Daniel
View Replies !
View Related
Pause Frame Not Working
I have 5 frames. Timeline needs to pause at each frame (for 10sec) from 2 through 5. Then go back to frame 1 and stop. Frame 1 remains stopped until the button is pressed.
Everything works fine until it gets back to frame 1, it should stop but it pauses and runs through the timeline again without completely stopping at frame 1.
Code:
// Frame 1 code is this:
stop();
// Button in Frame 1 contains this code:
on(release) {
gotoAndPlay(2);
}
// Frames 2 through 5 each contain this code:
function unpause(){
play();
}
setInterval(unpause,10000);
View Replies !
View Related
Pause Function In Frame 1, Please Help
Hi,
I've found a few pause function with setInterval to pause a MC for a given seconds. I put the pause function in frame 1 on the main timeline. Could I call this function in the same frame for a MC in another layer?
It doesn't work on my MC. My MC appears at the same time as the other MCs without any delay. I even put a 10000 miliseconds but noting happens. The same problem for other codes I've used for pausing.
For example this code:
PHP Code:
movieclip.prototype.Pause = function(pzeit) {
var go = function(obj) {
obj.play();
clearInterval(id);
}
this.stop();
var id = setInterval(go,pzeit,this);
}
with call:
PHP Code:
onClipEvent (load) {
this.Pause(10000);
}
View Replies !
View Related
Scripting A Variable Frame Pause?
In Flash 5... can you script a variable pause between frames... i.e. if I have a looping movie symbol can I script a variable into which I put a random value which is then used to dictate a pause length between the frames... thus making the movie play at a different speed each time...?
View Replies !
View Related
NoOb - Pause A Frame For A Few Seconds?
Hi Folks - I'm a crappy noober in need of a fast fix! Just trying to do something which I am certain is very simple - I just don't know how!
Basically I have a simple movie that is the typical fade in/out slideshow. I want each image (once faded to 100%) to pause for 5 or 6 seconds before fading out.
Now I know that I can just add frames before the fade out to hold each image, but I'm wondering if there is a simple action script way to just attach a 'pause' or a 'loop for X seconds' or something like this to just one frame.
I tried screwing with a 'do while' with a 'goto' then a 'i++' while i<60 but I couldn't get it working. Any help is much appreciated - THANKS! --bp
View Replies !
View Related
[CS3, Using AS1+2] Pause On Frame For Defined Period
Is there an easy way to do this? I totally misunderstood what setInterval does, thinking it might help.
I need this function to hold on the current frame for defined time in seconds, then goto and play the next frame.
If anyone has a bit of code that does this and doesn't mind sharing it with me that would be great.
View Replies !
View Related
AddChild Unwanted 1st Frame Pause
I have a situation that is driving me a bit nutzy involving addChild() in a flash game im working on, so hopefully someone can give me some pointers.
My problem is that for some reason there is a pause on the first frame of the movieclip that I'm adding with addChild, and I cannot get rid of it. it basicaly looks as if its holding on the first frame for 1 extra frame. this is coming up when i try to load a death animation for one of the baddies in the game when its hit.
when an attack is made by the player, this statement checks to see if the enemy has been hit, and if so, removes the current animation and replaces it with the death animation:
if(char.enemy_anim.hitarea.hitTestObject(chars.pla yer.attackarea)){
char.alive=false;
char.removeChild(char.enemy_anim);
char.enemy_anim = new enemy_death();
char.addChild(char.enemy_anim);
}
It works perfectly except for that strange pause on the first frame making the character hang in the air a second before falling down the rest of the way. I thought it was just the hitTest registering multiple times and reloading the movie but after checking its only geting past the if statement once. Im at a loss on this one.
View Replies !
View Related
Pause In Frame: Timer: OnClipEvent
Hello,
Flash Version I'm Using is 5.0.
This countdown/timer/code works like a charm when attached to a onClipEvent movie clip.
However, I need to get the timer code to execute only when a button "NEXT" is clicked. I'm trying to create a 5 second pause before the player advance to the next frame.
//timer function
onClipEvent(load){
function fTimer(){
//rercord the curent time
var startTimer = getTimer();
//set no seconds to count down
var countdown = 5;
//INT time passed variable
var elasped = 0;//rests to zero!!! when enter a new frame
}
}
onClipEvent (enterFrame) {
function fPause()
{
//check how much time has passed
elasped = getTimer() - startTimer;
trace("elasped = "+Math.Floor(elasped/1000));
//if the time passed is less than the length of our countdown
if(elasped <= countdown*1000){ //read *1000 & registered "elasped".
vTimer = countdown - Math.Floor(elasped/1000);
trace("below elasped time = " +vTimer);
}else{
trace("countdown done!" +vTimer);
vTimer = countdown - Math.Floor(elasped/1000);
}
}
}
View Replies !
View Related
Frame To Pause For A Certain Time Or Frames Before Proceeding To Play
i read somewhere a while back about getting a frame to do a count in before proceeding to play.
It was in flash 5, but now I am in mx, and either ways I dont remember anyway.
How do I make a frame when hit to count for 36 frames ( or 3 second )before proceeding to continue to play on that timeline. Lately all I have been doing is inserting a movie in there. The movie has 36 frames and at the end it stop and tells the root to continue play.
Can you tell me the code for both in frames and in seconds, because sometimes, I need it to sync with another movie and sometimes, just to count for time.
TIA
View Replies !
View Related
How To PAUSE A MC MovieClip In ONE FRAME For X Seconds Without Slowing Main Timeline?
Hello, I am desperately trying to find a cut & paste script that I can use to solve my problem:
I have my main timeline and inside it I have one movieclip with 30 frames. I need to pause each of those 30 frames for X seconds. I only have one frame at disposal so I need a script that doesn't require multiple frames, several gotos etc... I know there is stuff like that and I am hopeing somebody can be kind enough and post it here. Again, a DELAY function that I can paste into ONE FRAME of a MOVIE CLIP. I need the rest of the movie (the main timeline) to keep working so I can't use anything that stops the main time line in a loop...
Also I have been reading that using loop functions bog down the movie a lot so if there is a way not to slow down the entire movie it would be much appreciated. Thanks a lot in advance to anyone who took the time to read this and reply to it...
View Replies !
View Related
|