Difficulty in finding the way to determine when the video is finished

Here's the url for this project:

http://www.mespinach.com/picNpic/

A video starts playing when project is loaded.  A button to stop the video, then up a little video on the first video.  During this second full video, I would like to delete and the first video is taken.  As it is written currently I use two to accomplish this task.  If someone could show me ho to the determin when the video is finished I will not need to use both.

Here is my code:

Import fl.controls.ComboBox;
Fl.video import. *;
flash.filters import. *;

connection: NetConnection var = new NetConnection();
var connection1:NetConnection = new NetConnection();
var stream: NetStream;
var stream1:NetStream;
var md_obj:Object = new Object();
var md_obj1:Object = new Object();

var dsObject:DropShadowFilter = new DropShadowFilter();
var bvlObject:BevelFilter = new BevelFilter();

var vidContainer:MovieClip = new MovieClip();

var vid:Video = new Video (320,240);
var vid1:Video = new Video (200,150);

var one_btn:One = new One();
var two_btn:Two = new Two();
var three_btn:Three = new Three();

one_btn.addEventListener (MouseEvent.CLICK, onOne);
two_btn.addEventListener (MouseEvent.CLICK, onTwo);
three_btn.addEventListener (MouseEvent.CLICK, onThree);

function onOne(e:MouseEvent):void {}
VID1.x = vid.x + 100;
VID1.y = vid.y + 100;
1. Width = vid.width - 100;
1. Height = vid.height - 100;
vidContainer.addChild (1);
Stream.pause ();
STREAM1. Play ("BnBshortSnd.flv");
STREAM1.addEventListener (Video.Complete, onComplete);
}

function onComplete (): void {}
trace ("I'm here!");
STREAM1. Close();
vidContainer.removeChild (1);
Stream.Resume ();
}

function onTwo(e:MouseEvent):void {}
STREAM1. Close();
vidContainer.removeChild (1);
Stream.Resume ();
}
function onThree(e:MouseEvent):void {}
}
one_btn.x = stage.stageWidth *. 75;
one_btn.y = 50;
two_btn.x = stage.stageWidth *. 75;
two_btn.y = 75;
three_btn.x = stage.stageWidth *. 75;
three_btn.y = 100;

one_btn.filters = [dsObject, bvlObject];
two_btn.filters = [dsObject, bvlObject];
three_btn.filters = [dsObject, bvlObject];

addChild (one_btn);
addChild (two_btn);
addChild (three_btn);

Connection.Connect (null);
Connection1.connect (null);
Stream = new NetStream (connection);
STREAM1 = new NetStream (connection1);
vid.attachNetStream (stream);
VID1.attachNetStream (STREAM1);

md_obj1.onMetaData = metadata;
md_obj.onMetaData = metadata;
Stream.client = md_obj;
STREAM1.client = md_obj1;

stream.play ("http://jimslounge.com/publicDomain/plan9FromOuterSpace.flv" "");


vidContainer.x = 25;
vidContainer.y = 25;
addChild (vidContainer);
vidContainer.addChild (vid);

function metaData(info:Object):void {}

}

Yes, I've tried and it doesn't work.

However, you can use polling to check the current Netstream time against the amount of time you get in the metadata and dispatches an event when it is appropriate. Something like this:

import flash.display.Sprite;
import flash.net.NetConnection;
to import flash.net.NetStream;
import flash.events.NetStatusEvent;
import flash.media.Video;
import flash.utils.setTimeout;

import flash.events. *;
import flash.utils.Timer;

var nc:NetConnection = new NetConnection();
var ns:NetStream;
var duration: number = 0;
var vid:Video = new Video (300,300);
var obj:Object = new Object();
var videoURL:String = "test.flv;

nc.objectEncoding = 0;
nc.addEventListener (NetStatusEvent.NET_STATUS, onNCStatus);
NC. Connect (null);
addChild (vid);

function onNCStatus(event:NetStatusEvent):void
{
Switch (event.info.code)
{
case "NetConnection.Connect.Success":
NS = new NetStream (nc);
NS. Play (videoURL);
NS.client = this;
startPoll();
vid.attachNetStream (ns);
break;
}
}

Poll: var timer = null;
function startPoll()
{
if(Poll==null) {survey = new Timer (500) ;}}
poll.addEventListener (TimerEvent.TIMER, pollHandler);
Poll.Start ();
}
function stopPoll()
{
if(Poll==null) {return ;}
Poll.Stop ();
}
function pollHandler(event:TimerEvent)
{
trace (ns.time, "of"), duration;
If (ns.time > = length)
{
stopPoll();
dispatchEvent (new Event (Event.COMPLETE));
}
}

function onMetaData(info:Object):void
{
trace ("metadata: duration =" + info.duration + "width =" + info.width + "height =" + info.height + "framerate =" + info.framerate);

set the duration, so we can check the completion status
Duration = info. Duration;
}

Tags: Adobe Animate

Similar Questions

  • Cannot find the video imported to download from a Web site

    I'm new to OSX and cannot find a way to make something simple...

    I have a long 5 minute video that I recorded on my iPhone, I want to send to a friend. Dropbox and iCloud are not options because I maxed out my space in both. So I tried to use one of these free Web sites (such as WeTransfer.com) to download the file and send a link. I have

    But when I click on the ' Browse... '. "to find the video, I can't find in the file system. I know it's in the "library" and I can't find that, but it won't actually let me go no matter what. When I double click Photo library, things seem to be suspended.

    How should I proceed?

    I do not use Photos, but I guess you have to export the video to Photos to a location of your choice, and then load it. I don't think that you can download directly from Photos.

  • Publish Flash can't find the video on the server

    Previously, using Flash CS3 Professional, would incorporate a. M4V file (shared via iMovie) and go through the Import Wizard to give him a reading skin and ultimately publish something HTML, SWF, FLV and SWF/JS files for playback. Download these five files on our servers (or any server) allow anyone to watch these videos by accessing the HTML page.

    Now, using Flash CS4, the import process is a little different and FLV conversion does not occur. There are also no to publish. JS file and instead of the. FLV file, there is the original movie file (.) M4V). In the library pane, there is an article of FLVPlayback. When you access the HTML file as it sits on my desk (or the Office somebody in the folder with all the other items), the SWF file is and play the movie without any problem. Comes right up. However, now that all the files are moved (again, in the same folder) on a server for access via the web, the SWF file cannot find the video file.

    I even created a duplicate of the project with the encoding of the file M4V in a FLV and import this file into the document FLA; that the publication and download to the same exact results.

    That step has been added/deleted that I'm missing to make these files simply, import to convert properly and publish noctilucence so that they can be viewed that they were once on the web?

    Thank you!

    Tolleson, terry

    If it's the name of the video, then rename it to something that contains only the characters for the Web.  That is to say, delete spaces and the dashboard.

  • I have a Compaq Presario V6000 Widescreen and I can't find the video driver just for this computer

    I can find the video driver for my Compaq Presario V6000 Widescreen

    Serial number: {Private Information Removed}

    There are 4 computer V6000 but I don't know which one should I use.

    I use my serial number and the model name and the PIN code and still cannot very well the video driver.  can someone tell me were fined the pilot to be used on window XP

  • Where can I find the videos that I imported from my iPhone?

    I connected my iPhone and used the Import Wizard to import pictures and videos.  Once the completed import Windows Photo Gallery opens and displays all the photos of 418, but I do not see the 46 videos that are in my Camera Roll.  When they are registered or have I just missed a step?  Thanks in advance for the help!

    Hello

    1. have you checked in the libraries of the video section of Windows Explorer?

    You can also search by names of video in Windows Search , made a special right-click on a video file and selecting 'place of the folder', in this way, you know where the video files are.

    You can also check for them in Itunes.

  • Media Player cannot find the videos after renaming

    Media player was grateful and play videos (for the most part taken with flip and camera), but after the files have been renamed it does not find the files to read.  When I play them directly from the folders (my pictures/videos) he plays very well with media player, but I want them organized.  When I try to add files in media player don't notice "no compatible file available" is displayed.

    Hello jutori,

    Thank you for your response.

    To help address the issue, have been manually renamed files or is the update media information in Windows Media Player? This folder are renamed videos located in? Please also relay the exact error message that you receive when you try to play video files.

    You can also view the link below for more information on how to set Windows Media Player to automatically fix media information in your files.

    Information about the media in Windows Media Player: frequently asked questions

    I hope this information is useful.

    Thank you

    Mary
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • How to find the video in the Firefox cache? as chromium

    How can I find video in Firefox cache after the video

    Firefox allows you to browse or search in the cache on that page entries: Subject: cache (type or paste which in the address bar and press enter). The detail shows you where the file is stored on the disc, if it is stored on the disk.

    However, be aware that if you accumulate a lot of files in the cache, it is quite slow and lots of videos is never cached, so if you regularly need to record video, you may need to use an add-on.

  • Where can I find the video player that uses Mozilla?

    Hello. I love the video player on the Mozilla sites.

    Seen here:
    http://rockyourfirefox.com/about/
    And here:
    http://www.Mozilla.com/en-us/Firefox/underthehood/

    Can you tell me where to find it?

    This has happened

    Don't know how many times

    IS S/O

    its already built-in to firefox.
    http://www.html5video.org/

  • BlackBerry smartphones can not find the video I downloaded on my Storm!

    Finally, I thought I had this thing figured out.

    I downloaded my movie on my computer, hooked up to the storm and copied to the card carrier. Then I have medication and dropped the video in the videos folder.

    When I disconeected and went to watch isn't showing the title of the video on my Storm. I'm so aggrivated with this thing, I am seriously considering taking it back. I know that the video file is cause when I look under the heading memory I can see where the file took several evidence GB of space.

    Please help before go me insane here!

    Thanks in advance!

    There are two additional things, you can try (these usually resolve most of these problems).  First, pull the rear support card, wait a minute and reinstall.  It might just not have read since the time of the first media card and loading, be aware that if you have downloaded the movie in full (i.e. several GB worth), it will take some time for the phone to load it (probably on the order of about 5 minutes).

    If this does not work, the next thing to try is a battery pull - while the phone is turned on, remove the battery, wait 15 to 30 seconds, and then reinstall it.  The phone will take a few minutes to start up.

    These things will be hopefully get you operational return!

  • Help to find the video FX specicfic

    Could someone please help me find the plugins used in this clip? Specifically the thick hair and grunge look. As the grunge of color used from the mark of 0-10 sec. Mark how scolds the camera from one side to the other to the second 43-45 and in many other parts. Thank you very much in advance!

    Marv Mack - Paula Deen (Official Video) - YouTube

    Hi skool.

    You can use my looking VHS model if you like, a link to download it, in the description.

    Simple look VHS | Free after effects model - YouTube

    also found this one on AEScripts.com

    http://aescripts.com/bad-TV/

  • Audio backgroung in app does not automatically restart when the video is finished or stopped.

    It was created in indesign CC.

    Audio stops when video plays, to hear the sound on the video. Background sound does not restart automatically.

    Article 3 video and background to play during the entire folio has been placed in Article 1. Suggestions?

    It is the audio/video interaction in DPS. Once the video begins, we will stop the background sound, and we don't no auto restart it.

    Neil

  • I can't find the videos I want to import into Photoshop CS5

    Hi all! I can't seem to import videos in Adobe Photoshop CS5 Extended, all the videos I have on my computer have a wmv format. Whenever I run PSCS5, these are my steps: file > import > video layers images, but when I click on the folder I put my videos in, no videos appear in this folder. I have the latest version of QuickTime installed on my pc. I am using windows vista and my pc is HP. Thank you in advance.

    Silkrooster is correct. WMV is not a QT CoDec / Format is not compatible with the legacy AVI handler. You must convert it into another program first before being able to use it in PS. something VirtualDub for Adobe Media Encoder...

    Mylenium

  • I can't find the video driver for model vgn-aw190c

    video driver

    Hi mortezaa67,

    The video driver is still available for download on the link below.  Just make sure choose the right Windows 7 from the menu drop down.  Click on the link below for your model of the Canada.

    http://eSupport.Sony.com/ca/p/model-home.pl?MDL=VGNAW190C&template_id=1® ion_id = 3 & tab = download #/ download...

    Nick-

  • Automatically, skip to the next page once the video is finished?

    Hi all

    I'm doing a presentation pdf, including video integrated with Indesign.

    When I present to you, the PDF is full-screen, and I use my wireless mouse (I'm not standing near my laptop) to go to the next page.

    However, this method stops working after that embedded video is complete.

    Is there a way to automatically make the page - with integrated video - go to the next time the finished video?

    I hope someone can help me with that.

    Best, Erik

    With standard tools, it is impossible, because there is no event to indicate that a video has finished playing. You will need to use a different videoplayer widget when you create your PDF documents in InDesign, then add some JavaScript to the PDF document in Acrobat. See UVSAR: VideoPlayerX for Adobe Acrobat Pro and examples for the vpx_listener() function.

  • Difficulty in finding the notes for Windows 7 Tablet PC software

    I searched for some solutions that would allow me to get notes and equations with my digital pen, that I could then my conversion of leisure writing text. What I found seems to be for XP and not 7. Any help would be greatly appreciated. I use a HP touchsmart tm2t if that helps in any way.

    http://Office.Microsoft.com/en-us/help/HA102249621033.aspx - extremely interesting and useful, but still refers to XP.
    (http://www.microsoft.com/downloads/details.aspx?familyid=9D346916-B526-487E-919D-0BCE568DEF39&displaylang=en)

    http://www.ZDNet.com/ - has been mentioned here, but has been unable to find anything. It was probably due to my poor search parameters.

    http://www.TabletPc2.com/software.htm - ended by leading me to Inkseine, which unfortunately is still in phase beta (http://research.microsoft.com/en-us/um/redmond/projects/inkseine/index.html)

    Hello

    You can use Microsoft OneNote 2007 with Windows 7 to write notes. OneNote offers a free-form canvas where you can type, write or draw notes in the form of text,
    graphics and images anywhere where and how you want.

    Check this link for more information:

    http://Office.Microsoft.com/en-us/OneNote/HA100325701033.aspx

    Additional information:

    http://www.Microsoft.com/Windows/products/winfamily/mobility/articles/OneNote.mspx

    Kind regards
    Amal-Microsoft Support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for

  • Can I change my default search to google.uk?

    I live in France. I run Ubuntu 14.04 (English version) on a laptop computer in French In Firefox if I get a term search in the search box, use Google.com for results. It is not useful for me - I really want to use Google.uk I tried different ways sug

  • Why can't I install thunderbird?

    In fact, I'm able to download but when I open it, I get a message that says that it is not supported.

  • Apple music and audio books disappeared from the iPhone 6 s

    I was driving to work today listening to an audiobook via Bluetooth to the car, and then suddenly cut book. I opened the iBooks app and my books have disappeared. iBooks are always there, just any audiobooks. So I thought that I was listening to musi

  • Satellite A100-906 does not cool boot

    HelloI'm new here on the forum, so hi to everyone.I have this Toshiba Satellite A100-906, one I'm trying to fix and explain (because up to now, I tried a lot of things) the problem.It has Windows XP Pack 2 and every time that I perfom a Toshiba start

  • HP Compaq 8200 Elite Ultra Ethernet slim problem

    Hello. I have a HP Compaq 8200 Elite Ultra Slim PC running windows 7 Home Premium 64-bit. I did a fresh install of windows with all the drivers and software, everything works very well next to network adapter, when I start my computer, I see a red x