Play flv after 10 seconds of inactivity

Hi,
hope someone can put in the right direction...
I have 3 flv videos that I want to play if the user doesn't move the mouse in 10 seconds....
(I don't want all of them to play, I want to select a random flv video to play each time)
at the moment I am just playing the video without any of the above happening:
var video:Video = new Video();
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = {onMetaData:ns_onMetaData, onCuePoint:ns_onCuePoint};
video.attachNetStream(ns);
ns.play("truck-driving.flv");
function ns_onMetaData(item:Object):void {
trace("metaData");
// Resize video instance.
video.width = item.width;
video.height = item.height;
// Center video instance on Stage.
video.x = (stage.stageWidth - video.width) / 2;
video.y = (stage.stageHeight - video.height) / 2;
Would it be best to stream the video or import it into a movieclip? Not sure really the best way to go about it.
Any help/guidance?
Thank you!

var flvA:Array=["truck-driving.flv","whatever.flv","whateverelse.flv"];
var t:Timer=new Timer(10000,1);
t.addEventListener(TimerEvent.TIMER,playF);
this.addEventListner(MouseEvent.MOUSE_MOVE,mousemoveF);
function mousemoveF(e:MouseEvent):void{
t.reset();
t.start();
var video:Video = new Video();
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = {onMetaData:ns_onMetaData, onCuePoint:ns_onCuePoint};
video.attachNetStream(ns);
function playF():void{
this.removeEventListner(MouseEvent.MOUSE_MOVE,mousemoveF);
t.removeEventListener(TimerEvent.TIMER,playF);
ns.play(flvA[Math.floor(Math.random()*3)]);
function ns_onMetaData(item:Object):void {
trace("metaData");
// Resize video instance.
video.width = item.width;
video.height = item.height;
// Center video instance on Stage.
video.x = (stage.stageWidth - video.width) / 2;
video.y = (stage.stageHeight - video.height) / 2;

Similar Messages

  • Play FLV after another without blinking

    Hello, I hope you can help me with this one, please.
    I have a flv player on stage, along with several buttons. Everytime I press a button, I change the flv file played by the flv player.
    I would like to make the transition seamless - since the last frame of the first video is identical to the first frame of the second video, the second flv would start right away. However, the flv player blinks between a video and another, probably because it is loading the local file. Is there a way around that?
    Thank you so much!

    Hi,
    This may be too simple and I am not 100% that it will work for you, but here goes!
    Put all your movies together in a video editing program to create one large(ish) video.
    Then when you are creating the FLV file use the cue points to add actions such as pausing automatically and playing again when a button is pressed.
    I'd guess that you can set different buttons to start playing from different cue points.
    Cheers
    Tim

  • I've installed Flip4Mac WMV in Lion and when I try to listen to audio in some sites, it starts playing and after about 0.5 seconds it starts playing again. So, I have the same thing playing with a delay... What is happening and how to fix it?

    I've installed Flip4Mac WMV in Lion and when I try to listen to audio in some sites, it starts playing and after about 0.5 seconds it starts playing again. So, I have the same thing playing with a delay... What is happening and how to fix it? Is there any other way to play theese kinds of files without using Flip4Mac WMV?

    Use Flash Media Server to stream the files.......set up a timer and have all three of them play at once....and have a button switch the streams depending upon which stream you want to play.....and wallah......
    you can also capture the stream.time from the video playing and resume from that point on the other videos as well....havent done this theoretically so I dont know how smooth the transistion between streams will be....but it can be done....
    plus u may have to use double buffering techniques to make sure it starts up right away......
    thelegendaryghost

  • When using adobe flash player, for example, in the game. Screen will fade after a few seconds of inactivity.

    Hi, i have windows 7 hp, sp1. When using adobe flash player, for example, in the game. Screen will fade after a few seconds of inactivity. But the pixels on are highlighted. This is accomplished by installing the latest update flash.If I move the mouse the screen returns. Screen goes from one second to several, and sometimes not at all. Pleas help me

    To give you any useful advice, I'm going to need to know more about your computer and browser:
    https://forums.adobe.com/thread/1195540

  • Teeniest of a fraction delay in playing tracks after inactive period

    I have an itunes playlist which I'm using for playing tracks during a theatre production. When I select a track and hit enter, it plays at once. But If I select it and wait until the right moment in the play for the cue, which could be 30 secs or 70 secs later, when i hit Enter, there is the slightest delay of a fraction of a second before it plays. It's as if, beyond a minimum number of seconds of inactivity, it dozes off.
    Not a huge deal in a party, but in a play, the delay can make quite a substantial difference.
    Can I do something to fix this?

    I too have noticed a lack of responsiveness in iTunes at times. I am not sure if this is due to a large library, smart playlists, whatever. If you are using a separate hard drive make sure Energy Saver preferences are not set to put it to sleep. If you have a large library consider trimming it down, or make a second library just for the play. Hold down the option key while starting iTunes to make a new library.
    Consider using a different player than iTunes. Cog is free. It doesn't have anywhere near the features of iTunes but maybe you don't need all that many for what you are doing. Consider using iTunes to manage your tracks but then use Cog the day of the play.

  • Quicktime Plugin/Firefox stops playing mp3 after a few seconds

    We've run into a problem with Quicktime Player in Firefox (Win XP) only playing the first few seconds of an mp3. It doesn't happen with all mp3s, but out of the five we've tested four showed this problem... only one of the five played through to the end.
    When accessing the mp3 file, quicktime plugin loads with the big Q, takes a few seconds (i.e. seems to be downloading the full file), displays the controller, then starts playing. The progress bar moves quickly to the right and stops when it reaches the far right. For some of the mp3s it's only a second or two, for one it is about 8 seconds. The ones that only play for a second or two are regular music mp3s of about 3-5 minutes in length. The one that plays 8 seconds, is really 17 minutes, 42 seconds long.
    All of these seem to play fine with the Quicktime plugin in IE. And all the files play fine in iTunes and Quicktime as local files as well as streaming.
    The music files are mp3s generated by iTunes using the "Convert to MP3" function (original files are m4a files from the iTunes store).
    The longer file (a podcast) was generated by a third party, so I'm not sure what tools were used to generate it, however I've tested two versions generated by iTunes that also did not play past 8 seconds:
    - Original encoding with ID3 tags converted to a different version by iTunes
    - New encoding generated by iTunes using the "Convert to MP3" function
    (FWIW, renaming the files doesn't make a difference either.)
    I have confirmed that this is happening for a colleague of mine on his computer as well.
    Reloading the page/mp3 file (F5), force-reload (control-F5), disabling the cache (using Web-Developer Plugin, or Firebug), clearing the cache (through Firefox's Options->Advanced->Network->Offline Storage settings, or through "Clear Recent History") ... none of these seem to make a difference.
    However, I did notice that for the files that weren't working, using Firebug's Net panel, it looks like the plugin starts *and finishes* playing the file before the file is completely downloaded (i.e. the player stops playing and the Net panel still shows the file downloading -- usually for a few seconds more before it is completely downloaded).
    (And now the one mp3 file that was playing fine is no longer playing. It too just plays a second or two then stops...)
    This is with Firefox 3.6.3 and Quicktime Plugin 7.6.6 on Windows XP Pro.
    ---Lawrence
    Message was edited by: lcoffin

    Podcast (original): http://council.cio.com/podcast/temp.mp3
    Podcast (re-encoded by iTunes): http://council.cio.com/podcast/temp3.mp3
    Music MP3s that aren't working for me:
    http://council.cio.com/podcast/findyouregone.mp3
    http://council.cio.com/podcast/findyourehere.mp3
    http://council.cio.com/podcast/youvideoversion.mp3
    Music MP3 that is working:
    http://council.cio.com/podcast/twoareone.mp3
    (Oh, and ignore my comment earlier that this mp3 stopped working. I got confused back there with all the various tests... This file does play fully. The player also waits until the file is fully downloaded before starting to play... As opposed to the others where the player starts and ends playing before they are downloaded completely.)

  • Why must my password must be re-entered after so few seconds of inactivity?

    I find that only a few seconds of contemplation cause me to have to re-enter my password to return to the page I was editing. Sometimes the password retuns me without a complete sign-in. my browser is MozillaFirefox 3.6.** but internet explorer 8 is in my system. 'Crash' may be the wrong term. What I called 'Crash' is a few seconds of inactivity.

    Hi,
    Post in the MacBookPro forum here.
    https://discussions.apple.com/community/notebooks/macbook_pro
    This is the Mac App Store forum. Don't worry..  might take awhile to adjust to the new ASC.
    Carolyn 

  • How do I stop iMac from going to sleep automatically after 15minutes of inactivity

    How do I stop imac from shutting down automatically after 15minutes of inactivity, trying to play music but the imac keeps going to sleep, tried changing power saving preferences to never shut down, never go to sleep, unticked put the hard disks to sleep, automatically reduce brightness, but still goes to sleep.

    Try a PRAM/NVRAM reset.
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    After resetting NVRAM or PRAM, you may need to reconfigure your settings for speaker volume, screen resolution, startup disk selection, and time zone information. If issues persist, your Mac's logic board battery may need to be replaced. The logic board battery helps retain NVRAM/PRAM settings when your computer is shut down. You can take your Mac to a Mac Genius or Apple Authorized Service Provider to replace the battery on the logic board.

  • Can't import songs and ones in library only play for 45 seconds

    I'm in the process of moving my music collection to a new computer with a bigger hard drive. I installed the latest version of iTunes on the new computer, copied all the folders and contents of the itunes folder to the new computer in the same location.
    I bought a couple new songs successfully but now I can't add any of the files from my previous computer to the new library. I was able to import a few songs that iI purchased when on my original machine but now they only play for 45 seconds and jump to the next song in the playlist (if check) And now when I drag and drop songs on the Library to import them absolutely nothing happens.
    And yes, the new computer is authorized and the permissions on the folders are read / write.
    Any one have an idea of how to fix this? If not, I just going to burn all my songs to CD and import them that way and say so long to iTunes... just too much BS to just move a music library!

    Sounds like the PC's authroization file is messed up, or else the iTUnes preferences files.
    Follow the directions in this article, the SC Info file holds the PC authroization for iTMS songs.
    iTunes Does Not Open After Upgrading
    And also deleted these 2 preferecnes files:
    C:\Documents and Settings\username\Application Data\Apple Computer\iTunes\iTunes.pref
    C:\Documents and Settings\username\Local Settings\Application Data\Apple Computer\iTunes\iTunes.pref
    They will all get rebuilt when you open iTunes the next time. It should ask for authorization one last time, is all.
    Message was edited by: Katrina S.

  • Music only plays for 15 seconds and then goes to another song

    I upgraded to ios 6. Since then, my old songs only play for 15 seconds. Anything purchased after the upgrade, plays the whole song.  Anyone ????

    Sure your gone for the day, but no luck. Still get 15 sec and then on to the next song.

  • C7: How to play .FLV files on Nokia C7

    Can I ask how do you play .FLV files on Nokia C7? I searched for FLV player in the Ovi Store and nothing is returned, whereas on Android Market loads of FLV players are available.

    I couldn't find an FLV player either. But you can download freemake video converter from internet. Its really a very good converter and I transfer my vids to C7 only after converting to C7 resolution because it makes the processor to do less work. If you transfer an HD vid directly to phone it will play fine but will cost u battery life. (more processor usage)

  • IPhone music will not respond to Play button after being paused. The same music is on my iPad and MacBook Pro without problems. Any suggestions about cause and solution.

    iPhone music will not respond to Play button after being paused.
    The same music is on my iPad and MacBook Pro without problems. Any suggestions about cause and solution.

    Do a
    Reset: Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Note: You will not lose any data

  • ITunes Store only plays about 10 seconds of a preview before stopping

    I try to preview songs before buying them and it's supposed to play 1:30 of the song but it will only play 4-15 seconds of it then it'll stop. I can drag it to later in the song, but it will still only play for a few seconds. This just started about a week or two ago and we haven't done anything to our computer recently. It doesn't even happen for every song, just most of them. The songs in my library all work fine and they play perfectly after I buy them, but not in the preview. I've been all over different sites looking for an answer, but no one else seems to have the same problem. How do I fix this???

    Larry, try this:
    Close your iTunes,
    Go to command Prompt -
    (Win 7/Vista) - START/ALL PROGRAMS/ACCESSORIES, right mouse click "Command Prompt", choose "Run as Administrator".
    (Win XP SP2 n above) - START/ALL PROGRAMS/ACCESSORIES/Command Prompt
    In the "Command Prompt" screen, type in
    ipconfig /flushdns
    Hit "ENTER" key
    Totally shut down computer.
    Restart your computer.
    Now try your preview music again.

  • MacBook Pro shuts down after periods of inactivity

    I had a 6-year old MacBook Pro.  Besides just being a bit old and tired it would attempt to shut down after periods of inactivity.  I tried setting it to never sleep.  I tried the whole reset thing where you take the battery out and hold the power button for 5 seconds.  I bought new memory for it.  Eventually I used it as an excuse to buy a new machine.
    Of course I copied my image over to the new MacBook.  Now I know its not a hardware issue because it still happens!
    I also have other quirky issues (probably not related, but who knows). 
    I just cannot get my remote (or any apple remote to work).
    I have an empty folder that I can't delete–it crashes the system.
    Aperature hangs up all the time
    VMware hangs up all the time
    Firefox and Chrome both hang up
    Sometimes I have to force quit Mail
    Is this a good time to do a clean install?

    Resetting the SMC doesn't seem to have done anything. The progress bar hasn't reached the end to shut down yet, but so far, it's displaying the same behavior.

  • Can play music after updating to 4.0.2

    My iPhone wont play music after updating. When I try to play a song it jumps back without playing after a few seconds. Any solutions?

    maybe same solution would help as in http://discussions.apple.com/thread.jspa?threadID=2534690&tstart=0

Maybe you are looking for

  • How do I sync Outlook 2010 with my BB-Z10?

    I have downloaded and installed Blackberry Link and successfully ran it. Everything I want has been transferred from my Torch, EXCEPT the calendar. I could get it from Outlook, but I don't see any way of syncing the BB10 with Outlook - which is somet

  • Printing a PDF from a PDF generates a log file

    I have pdfs that get generated from a web site and for whatever reason when I go to print them to pdf I just get a log file. I can print to pdf from any other pdf file. I need to do this so that it basically flattens the pdf and the end user can't se

  • Adobe Reader Keeps Crashing On Mac

    I'm having issues with Adobe Reader on my MacBook Pro Retina.  The MacBook is a 13" late 2013 model running OS X Yosemite 10.10.2 and I have the latest version of Adobe Reader (11.0.10) installed.  Whenever I open multiple PDF's Adobe Reader crashes.

  • Intel Macs: Unable to Connect to Internet on OS X; Works on Windows XP

    Shortly after updating my systems to OS X 10.4.8, both my computers (iMac 20" Intel Core Duo & 1.83 MacBook) failed to connect to the internet when booting to OS X. I see my wireless network, and I can connect to it, but I cannot access the Internet.

  • Enter Button Press Event

    Hi, I want to add one new row in the matrix ,on pressing the enter button in the item event.How can I do that? Regards, Kughan