Detecting the end of an flv in ac 2

I have a custom player i built. How do i detect the end of
the flv so i can prompt an action, like go to another frame for
instance or loop or call another flv. Have been struggling to find
a solution online and keep hitting dead ends..
Thanks in advance if someone can help... need this in
actionscript 2

unsure...
I was just using keyframes on a timeline to play different
flvplayers, brought in through import. I have used netstream
successfully but i lose the player controls...

Similar Messages

  • Detect the end of flvplayback

    i have an flvplayback component on stage, named the instance flvPlayer and added this code to frame 1, so a video loads in it.
    flvPlayer.source = "clip1.flv";
    the videos plays from the local folder perfectly.
    I need a code that when the video ends, it jumps and stop to frame 1 of scene2.
    something like:
    scene 1, Frame 1:
    stop();
    flvPlayer.source = "clip1.flv";
    // code for detecting the end of the video and jumping
    when flvPlayer completed
        MovieClip(this.root).gotoAndStop(1, "Scene 2");

    i have "Scene 1" and "Scene 2".
    i have the flvPlayback component on the stage of scene 1. i chose flvPlayer for the instance name.
    and added this code to frame 1 of scene 1:
    stop();
    flvPlayer.source = "clip1.flv";
    flvPlayer.addEventListener(VideoEvent.COMPLETE, completeHandler);
    function completeHandler(event:VideoEvent):void
        MovieClip(this.root).gotoAndStop(1, "Scene 2");
    and i have scene 2 with a stop action on it's 1st frame.
    when i try to test the file, i get this error message in compile error section:

  • Is there a way to detect the end of a video?

    Is there a way to detect the end of a video.. .mp4 or youtube? I want to be able to detect the end of a video and then have it do something...ie play on timeline or go to and play symbol.

    For youtube the code would be something like this:
    view-source:calkaweb.herobo.com/video.html
    for HTML5 videos for youtube replace &version=3 with &html5=1 in the youtube URL
    I have no idea how to impletent the youtube code into Edge tho other than an iframe but that wouldn't work I've tried :
    http://forums.adobe.com/thread/1285212
    You would need to place all of the youtube codes into edge in order for it to work but I duno how to do that and no1 answered the question in the thread I made about it.
    as for MP4/HTML5 video you can use
    var video = document.getElementsByTagName('video')[0];
        video.onended = function(e) {
          /*Do Something*/

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • How to detect the end of an external swf loaded into a container

    Hi,
    I'm having trouble finding a solution for this problem, can somebody help me?
    I have a main swf that will load external swfs into a container. I need to detect the end of the loaded external swf in order to start to load and play a new one into the same container.
    The problem is that i do not know what the length of the external swfs will be, and will have no control over the development of them, so i cannot place a variable at the end of their animation which would allow me to detect from the main movie its end.
    I also cannot rely on the _totalFrames property because the loaded swf might not have all the animation inside its main timeline.
    Is there any way to achieve this goal?
    Thx

    Ok... Its as i thought... unfortunatly...
    Gonna mark your latest post again as possible solution, just in case someone comes with any sort of out of the box thing...
    Thx for your help Kglad

  • How to detect the end of a movie clip:  what eventListener to use?

    I'm doing a rather fancy button with up,down,rollover,rollout,and static states, something the standard flash button structure isn't capable of as far as I can tell, and believe me, I've tried it.
    Here's the setup:  My main timeline has a series of frames with stop(): scripts, and each frame has a movie clip representing what should happen during that state:  still, rollover, rollout, mousedown, mouseup
    I can't get the mouseup event  to work.
    Here's what I've tried so far that doesn't work:
    1. in the imbedded movieclip, no script at the end.  Result: This just loops the embedded clip.
    2. in the imbedded movieciip, put gotoAndPlay("NextFrame"), where "NextFrame" is the label in the root movie where I want to go. result: loops clip
    3. in the imbedded movieciip, put root.gotoAndPlay("NextFrame"), where "NextFrame" is the label in the root movie where I want to go. result: error
    I think what I need to do is write an eventListener for the root actionscript, but I don't know what event to listen for. 
    What event is thrown when a movieclip finishes playing?
    :<)McFrisco

    You have to create your own mechanism(s) for detecting the end of a movieclip being reached.  You can either build code into the end of the clip itself, possibly dispatching an event that is being listened for by a containing timeline, or you could continuously monitor the currentFrame of the clip to see if it equals the totalFrames value.

  • Detecting the end of an appendBytes NetStream

    Normally to detect the end of a NetStream, you can add a listener like this:
    myNetStream.addEventListener(NetStatusEvent.NET_STATUS, statusHandler);
    and check for NetStatusEvents. If you're using appendBytes on your NetStream, it seems you don't get any useful NetStatusEvents aside from NetStream.Buffer.Full at the very beginning. Is there a way to know when the stream ends then? If you wanted to make something happen when it was over, would you just have to do it based on the duration of the stream?

    unsure...
    I was just using keyframes on a timeline to play different
    flvplayers, brought in through import. I have used netstream
    successfully but i lose the player controls...

  • Detecting the end of a movie clip

    Hi,
    Objective: Display a book that the user can turn the pages to
    view more text. I used a tutorial from the web to create the
    turning page.
    Process: On layer 1, frame 1 of the main time line, I put an
    image of a book. On layer 2, frame 1 and also frame 2 of the main
    time line, I put text for the book. I then created a movie clip
    (MC) called PageTurnMC that looks like a page in the book is being
    turned. On layer 3 of the main time line, I put an instance of the
    MC and called it PageTurn. On layer 4 of the main time line, I put
    a button to play the MC and advance to frame 2 called drawer1cont
    (see code).
    //code on the button used to turn the book's page
    on (release) {
    PageTurn.play(); //plays my PageTurnMC
    gotoAndStop("drawer1cont"); //advance to the next frame of
    text
    Problem: I need to detect when the end of the MC before I
    advance to the next frame. I have to use the PageTurnMC many times,
    so it is not possible for me to put the action in the last frame of
    MC. As of right now, my frame 2 text appears as the PageTurnMC
    plays which is not what I want.
    Thanks for any help.

    I just tested it and got my quick example to work. Here are a
    couple of possible areas to double check:
    In the last frame of PageTurnMC, gotoAndStop must reference
    the main movie clip, e.g. _root.gotoAndStop().
    Also, make sure the parameter _root.frameID isn't in quotes
    because it is a variable, not the actual string.
    As I said, I'm not a Flash expert nor do I know the setup of
    your movie, but this should work as long as you have all of your
    references correct. If you can't get it to work, try to trace
    necessary variables to make sure you are accessing the appropriate
    variable.
    The suggestion by nilu_only will also work, but it will waste
    some cycles because you will have to wait for the movie clip to
    end. Here is what I mean:
    Immediately after playing PageTurn, accessing
    PageTurn._currentFrame will return the currentFrame only once. So
    if PageTurn isn't on its lastFrame, your condition statement
    (PageTurn_currentframe == PageTurn._totalframe) will fail and
    gotoAndStop will never be called.
    Instead, you would need to wait for some time and continually
    check the _currentFrame until the condition statement is true, e.g:
    on (release) {
    PageTurn.play();
    while (PageTurn_currentframe != PageTurn._totalframe) {}
    //wait until reaches the last frame
    gotoAndStop ("drawer1cont")
    This approach is likely to be suboptimal since you are
    wasting cycles checking the current frame instead of just having
    the movie let you know when it has reached the last frame.
    Depending on how Flash handles that while statement, you could have
    serious slowdown from that while statement. And since Flash doesn't
    have a sleep() function, you would have to do some sort of
    setTimeout() to slow down those checks. Either way, I would venture
    to say this approach is better off avoided.

  • Help, How to detect the end of sentence in a plain text

    Hi, Everyboday
    I really don't know how to use ArrayList and endsWith to realize detecting the following question. Could you give me some help? Thank you!
    1. find the end of the sentence. that means that we print it out if you meet "!" or "." .....
    2. calculating the frequency of the key word in the whole text. maybe using IDF..
    import java.io.*;
    class SearchEnd{
         public static void main (String[] args){
              try{
                   File myFile = new File("Test.txt");
                   FileReader fileReader = new FileReader(myFile);
                   BufferedReader reader = new BufferedReader(fileReader);
                   String line = null;
                   while ((line = reader.readLine()) != null){
                        System.out.println(line);
                   reader.close();
                   }catch (FileNotFoundException exception){
                   System.err.println("File not found");
                   }catch(IOException exception){
                   System.err.println("IO Error");
    }

    Checkout this thread about how to use these forums effectively. Particularly with College home type questions, expected to be taught how to find the answer rather than be given it outright.
    http://forum.java.sun.com/thread.jsp?forum=54&thread=190747
    -- Question ---
    There are lots of ways to do this, check out the API documentation http://java.sun.com/j2se/1.4.2/docs/api/
    Your sample shows you can iterate the string so checkout these three classes.
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/StringTokenizer.html

  • Detecting the end of a session

    Hi,
    Is there any way of detecting when a session ends? I'm wanting to carry out an action when the browser gets closed.
    Thanks!

    You probably have some User object that you store in the session. What you can do is you can implement the HttpSessionBindingListener interface on this object. The valueUnbound() method of that interface will be called when the session is dropped.
    http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionBindingListener.html
    Note that a session does not end directly when the browser is closed, the session has to time out first on the server side.

  • Finding the end of a document using Scanner

    I'm reading a file line by line, but cannot figure out how to read the end of a document without finding the number of lines in the document myself. When I have all of the lines printed out, I get an error at the end saying that no line could be found, which makes sense, since it's the end of the document. But how can I detect the end without getting an error?
    Exception in thread "main" java.util.NoSuchElementException: No line found
         at java.util.Scanner.nextLine(Unknown Source)
         at GustavData.main(GustavData.java:29)

    Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

  • Detect mp4 end

    I'm working with adaptive layouts and I have them working.  However, I have an intro video that starts up at the beginning of each layout and I don't want it to repeat each time its resized.  I have a few questions:
    1.)  How do I detect the end of the mp4?  Here is the code that I'm using:
    sym.$("mon900").append(mon);
    mon.attr('autoplay','autoplay');
    mon.attr('preload','auto');
    2.) Can I add preloaders to the mp4's?  They seem to take awhile to load.
    3.) On a different topic, I'm attempting to get my Adobe Edge composition to be centered in the middle of the browser.  I'm currently using this code in completionReady on my stage:
    $("#Stage").css("margin","auto")
    This doesn't seem to work.  Do I need to center the adaptiveContainer?
    Thanks!

    Usually you'd put the ended variable where ever you've placed the video variable (var vid), i.e. where you've instructed the video to appear:
    //video var
    var vid = $("<video width='854' height='480' controls='controls'>" +
       "<source src='video/F2R.mp4' type='video/mp4' />" +
       "<source src='video/F2R.ogv' type='video/ogg' />" +
       "This browser is not compatible with HTML 5" +
    "</video>");
    // get the div called 'vcontainer' and attach the video;
    sym.$("vcontainer").append(vid);
    // additional options for the video object
    vid.attr('autoplay','autoplay');
    vid.attr('preload','auto');
    //function when video ends
    $(vid).bind("ended", function () {
         //function you want
        sym.$("RearImage").show();
    This be on Creation complete or on a click function, have a go and see what happens.

  • Screen Saver when calling and need to use the Keypad, the screen saver doesn't detect the phone has left the ear and blanks out the screen.  Even ending a call is difficult as the screen blanks out within seconds

    I have to use the Keypad a lot when making calls.  Make the call, the Robot then asks to enter a number for a service, pull the phone down from the ear, the screen may light up for a second, but then the screen saver cuts in, blanking the screen out.  Sometimes you hit the Home Key to awaken the sccreen, enter your number and then back to the ear to hear the next set of instructions.  Back and forth just trying to enter the options is a pain.  Sometimes even trying to end the call, the screen blanks out and you fight to try and end a call.
    If I use the Speaker function the keypad works; the speakler phone is not alway appropriate. 
    It appears that the phone gyro, doesn't detect the phone has moved from the ear to the viewing angle.  This wasn't an issue until recently and I can't remeber if it's the iPhone 5 or one of the updates.  It definitly wasn't there earlier on, as I threw away an Windows 6.5 phone for the same problem. 
    I'm not sure if it's a hardware or software (design) issue.

    It is not the gyro. This has everything to do with the iPhone's prioximity sensor.
    Are you using a case that may be blocking or partially blocking the proximity sensor? If you are using the case, remove the case prior to the next call to see if the same occurs without the case.

  • When I publish as an .mp4, the embedded .flv videos clip at the end

    I am using Captivate 6.0.1.240. I have .flv videos that were encoded using Adobe Media Encoder from a .mov file. The videos are embedded on the slide, as multi-slide synchronized video, but only distributed across one slide (as strange as this might seem, it is what was recommended to me because using Event Video resulted in choppy video).
    Now, the videos clip off a second or so before the end of the video. There are no transitions on the video slide or on the slide following it. I have tried extending the length of the slide beyond the length of the video, to no avail.
    What am I missing? How do I get the embedded .flv videos to play fully?

    Hi there,
    As you told you have checked that there is no transition on the Slide on which you have the video.
    Have you checked the transition effect on that video, whether Fade out only or fade in and fade out is selected. Select that multi slide video and click on the properties panel and check the transition on it.
    Also, if this video is on the last slide, check the fade in and fade out on the project. (edit > Preferences > Project > start and end)
    Thanks.

  • .flv with command at the end

    Hey there,
    I have created a SWF file that streams an FLV file.
    What I would like to do, is have an actionscript command activate AFTER the FLV has played to the end of the movie.
    Is there a code for something like this?

    you can use:
    var lo:Object = new Object();
    lo.complete = function(eventObject:Object):Void {
    //your as command
    yourFLVPBC.addEventListener("complete", lo);

Maybe you are looking for

  • Extract the new , changed , deleted  vendor  master data -urgent pls

    Hi all, I have require ment like i need to extract all new, changed and deleted data from SAP TO MAXIMO i need to send to a windows environment which both systems share, i am using LFA1 ,CDHDR , CDPOS Tables , i will get the reuired information , can

  • I can't get my wi-fi to work

    I cannot seem to get my wi-fi to work. Every time I go to connect it shows the check mark saying it's connected, but it doesn't show the wi-fi symbol at the top next to the at&t.I don't know what to do.

  • Select-Options search help with where

    Hi Experts, I need to have a search help in my selection screen with a Where clause. I've tried to search it but I cant find answers. The logic is like this, wherein the search help for my selection screen should just have the value PM001 and ZMIS. S

  • Working with Heavily Compressed, Long Clips (ie DVD, h264)

    Hi all. One of the main reasons I switched to Premiere back with CS5 was the mercury playback engine. I often have to make edits from many different sources and premiere allows me to just edit and not worry too much about it. I've done a good amount

  • Converting excel formulas to javascripts

    Hello, I am not experience in Excel formulas and creating "if" statements in Adobe Acrobat, so I'm hoping someone can help me with this. I have two problems. 1.  Here is an excel formula that I need to convert over to javascripts. Can someone help wi