Switching between FLVPlayback component at their playheadTime

Hi There,
I hope someone can save me with this.
I am currently on a project (AS3), where I have 2 frames, with videos (using the FLVPlayback component).
and I want to switch from one video to the next video, however the catch is when i switch to the next video I want the new video to play at the previous video time.
example:
Video 1 plays,  10 sec later, you click a button to go and see the next video (in another frame) and that new Video starts 10 sec into it.
This is the codes I been using so far:
import fl.video.VideoEvent;
import fl.video.MetadataEvent;
video1.addEventListener(VideoEvent.PLAYHEAD_UPDATE, timer);
function timer(e:VideoEvent):void {
    var newTime = video1.playheadTime;
nextFrame_btn.addEventListener( MouseEvent.MOUSE_UP, nextFrame);
function nextFrame (MouseEvent):void
            gotoAndStop(2);
      video2.playheadTime = newTime;
This doesn't work and I do not know what I am doing wrong.
many thanks if you can help.

yes there is another layer with codes but that is for the buttons.. that can work throughout the flash (in all frames). Sorry I forgot about that. Those buttons are just basic home, end buttons. In the other layer is the switch code for the button I am trying to make.
This button/code for some reason does not like being in the main code layer. So I added it in another layer, which seem to make it work. (The part where I want it to gotoAndStop in another frame.)
var newTime:int;
switch_btn.addEventListener(MouseEvent.MOUSE_UP, switch1);
function switch1 (MouseEvent):void // Function to turn on 3D mode
                    newTime = video1.playheadTime;     
                    this.addEventListener(Event.RENDER,renderF);
trace("stage:",stage);
                    stage.invalidate();     <= that use to be line 15 before the trace was added.
        gotoAndStop(2);  
                    trace (newTime);
function renderF(e:Event):void{
  video1.seek(newTime);
the other layer has this code:
cha1_btn.addEventListener(MouseEvent.MOUSE_UP, cha1);
chan2_btn.addEventListener(MouseEvent.MOUSE_UP, chan2);
function cha1 (MouseEvent):void
          gotoAndStop(10);
function chan2 (MouseEvent):void
          gotoAndStop(11);
They are on seperate layers because the switch function is used in all the frames, but to gotoAndStop in different frames.
aka this one: is in frame 10, which goes to frame 2
and there will be another one in frame 2 to go to frame 10.
then there is another in frame 11, which goes to frame 3
and then the same for frame 3 to goto frame 11.
so thats why there were in seperate layers, to be able to change that. (sorry if this is getting confusing)

Similar Messages

  • I am aware that many people, like me, have lost the ability to mirror their iPad, iPhone or computer with Apple TV.  Has anyone yet found a solution?  One day it worked, the next day the option to switch between the device and Apple TV had disappeared.

    Has anyone managed to resolve the problems encountered with Apple TV and the loss of ability to mirror iphones, ipads or computers?  One day it was working perfectly, from all the above devices, the next the option to switch between playing on the device or mirroring to apple tv had disappeared.  I have tried all the obvious such as updating iTunes, turning all devices off and then back on, but nothing is working.  Help please!

    Welcome to the Apple Community.
    Your problem is most certainly network related, you might try restarting your devices including your router as a temporary solution, but in the long term would be better correcting the problems with your network.
    Intermittent problems are often a result of interference. Interference can be caused by other networks in the neighbourhood or from household electrical items.
    You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel.
    There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first.

  • Audio Menu MOtion continue play when switching between menus?

    How can encore continue playin the same background music when the user is switching between main menu and submenus? and not having to restart the song when you choose a submenu.

    There is plenty about Encore to be frustrated about, but you should spend a bit of time investigating Scenarist or DVD Lab Pro (authoring programs that provide scripting).  They are also missing some "features" (that are related to limitations of the DVD spec).  And their price tags indicate why Adobe licensed the sonic authorcore only, and not "Scenarist" itself for the Adobe authoring component.

  • A better way to determine the current state of the FLVPlayback component?

    Below is the AS3 code I have used to display images (MCs) over an instance of the FLVPlayback component.  These images (one for loading, one for the title) are to appear – or disappear – according to the current state of the FLVPlayback component. 
    It “works,” but when testing, I have noticed that it can be rather finicky.  The most common issue that arises is that many times the loadPoster movieclip will still be visible even though the video has entered the playing state.
    Also, I wanted a title placeholder image to appear whenever the user stops the video or if the video completes.  However, I had to add the conditional statement to the “stoppedStateEntered” case to make everything appear when expected.  When the video is first viewed (and has completed buffering), it seems that the FLVPlayback component enters the stopped state before entering the playing state.  Thus, the titlePoster would flash on the screen right before it and the loadPoster “should” disappear when the video begins playing.
    Even in my limited testing, these issues were very easily re-created.  I am definitely looking for a more reliable solution.  Is there a better (or more correct) way to go about all this?  If possible, I would like to stick with the FLVPlayback component, just for the simple fact of not having to code my own.
    Where am I going wrong?
    function updateMoviePoster(event:VideoEvent):void
                    switch (event.type)
                                    case "playingStateEntered":
                                                    loadPoster.visible = false;
                                                    titlePoster.visible = false;
                                    break;
                                    case "stoppedStateEntered":
                                                    if (loadPoster.visible == false)
                                                                    titlePoster.visible = true;
                                    break;
                                    case "complete":
                                                    titlePoster.visible = true;
                                    break;
    myFLVPlayback.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, updateMoviePoster);
    myFLVPlayback.addEventListener(VideoEvent.STOPPED_STATE_ENTERED, updateMoviePoster);
    myFLVPlayback.addEventListener(VideoEvent.COMPLETE, updateMoviePoster);

    Any suggestions?  I would truly appreciate the help.

  • Switching between Design and JSP tabs add code?

    I am new to SJSC and I am taking the time to go through all of the little odds & ends of the IDE.
    I was looking at:
    http://blogs.sun.com/roller/page/tor?entry=computing_html_on_the_fly
    And I decided to try this.
    When I add the following in the JSP tab:
    <h:outputText binding="#{Page1.tableHtml}" id="outputText1"/>Save.
    Then click on the Design tab, then go back to the JSP tab, I now have:
    <h:outputText binding="#{Page1.tableHtml}" id="outputText1"/>
    <h:outputText binding="#{Page1.outputText1}" id="outputText1"/>It's late here, but this doesn't make any sense, why would switching between Design and JSP tabs add code?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Girish: I followed these steps:
    1.) Downloaded:
    Sun Java Studio Creator 2, Multilanguage creator-2-windows-ml.exe 254.23 MB
    2.) When I started the install, I received the message:
    Welcome to Sun Java(TM) Studio Creator 2! You are installing: Sun Java Studio Creator 2 development environment Sun Java System Application Server Platform Edition 8.1 2005Q1 Update Release 2 Bundled database
    3.) Installed version:
    Product Version: Java Studio Creator 2 (Build 060120)
    IDE Versioning: IDE/1 spec=5.9.1.1 impl=060120
    Also, Under, the Palette window: Standard component list, there is a component labeled Output Text.
    When placed on a jsp, the following code is produced:
    <h:outputText binding="#{Page1.outputText1}" id="outputText1" style="position: absolute; left: 24px; top: 48px"/>Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Whatever happened to Alt+F6 (to switch between modeless dialogs)?

    In all versions of Windows until Vista (I think that was when it went
    missing) you used to be able to press the standard defined accelerator
    Alt+F6 to switch between an application's main window and any modeless
    dialogs it had.
    It's still documented as such here:
    http://msdn.microsoft.com/en-us/library/windows/desktop/bb246447(v=vs.85).aspx
    "ALT+F6
     Switch to next window within application (between modeless secondary
    windows and their primary window).
    For example, in Notepad, when you have its Find dialog open, under
    XP/Windows 2003 (and all earlier Windows versions) you can press
    Alt+F6 to switch between the main window and the Find dialog.
    This keystroke was particularly useful when an application's modeless
    dialog was positioned off the screen and couldn't be clicked on it
    with the mouse. You could press Alt+F6 to activate the modeless
    dialog, then Alt+Space to popup the modeless dialog's menu, then
    invoke the move operation - and get the modeless dialog back on
    screen.
    On all versions of Windows subsequent to XP/W2K3, as far as I know
    there's no way of activating a modeless dialog with the keyboard.
    Does anyone know if there's a substitute keystroke, and if not, out of
    interest why we lost that keystroke?
    Dave

    Are you using KMS?
    I'm not sure but you could try launching your WM from .xinitrc:
    'exec ck-launch-session WM'
    Instead of WM you can try 'startxfce4' 'xfce' or wait for somebody smarter than me :-)

  • Is there any event that triggers when you switch between components?

    is there any event that triggers when you switch between components?
    like for example... when i switch between components, i need a function to fire everytime i switch...
    ive tried show, hide, and initialize... and none of them work...
    any ideas or help is greately appretiated!!

    Depends on what you are trying to do,
    you have mouseover and mouseout and mouseclick events which you can use on the component and write code to deal with what you want to happen when you change focus. You have keypress event which would allow you to monitor tabbing between components, remember that in most events the currentTarget and target values will give you the information you need to handle component interaction.
    so
    [Bindable] private var CurrentObject: Object; <-------  use this as a pointer to what ever object you are currently focused on or just to indicate things have changed
    addeventListener(MouseEvent.CLICK,myCompponentSwap);
    protected function myComponentSwap(e:event): void
        if (CurrentObject !=e.currentTarget && CurrentObject != null)
             do what you want becuase a component switch just happened
        CurrentObject = e.currentTarget;
    Hope this gets you started.
    David

  • Docked T500 - Switch between headphones and speakers

    Hey guys,
    I am using my T500 with an Advanced Mini Dock at work. I keep the headphones (with microphone) plugged into the docking station. 
    Sometimes I want to listen to the audio on my laptop's speakers rather than inside the headphones. Is there any way I can make this switch without unplugging the jack from the docking station. 
    I know that above the volume bar for some systems you are able to switch between headphones and speakers and also, up until ~1 month ago I was able to do this from the SmartAudio utility, but now I can't. I can just switch between SPDIF and headphones. 
    I am using Windows 7 64-bit and I have all the latest drivers and apps that come using the "System Update" utility.
    Please let me know if you have a solution for this.
    Thank you,
    Ciprian

    I'm pretty sure that the blame for this lies entirely with Microsoft and their stupid hardware-detecting W7 OS. Yes, it actually detects when you unplug the headphones, tells you what you just did, and promptly resets all sorts of things. The most sensible thing you can do (apart from reverting to XP, which doesn't do this) is to plug an external stereo jack to stereo jack socket extension lead, and plug either your headphones or speakers into that instead, whilst leaving the plug end permanently in the laptop. Microsoft can't pull that stupid stunt on an external connector, so you should be okay with that.

  • Adding time to the FLVplayback component

    Hi everyone, Im using the FLVplayback component for a project im doing. I want to add the time elapsed and time left on the controls. I dont really want to create my own controls, as im happy with the flv playback component. The FLVs playing in the component are external and are loaded into it via as3
    Is there a quick and easy way of doing this?
    Cheers
    Dan

    I have managed to find some code for this component, but im getting some errors which im having trouble to de-bug;
    1118: Implicit coercion of a value with static type Object to a possibly unrelated type Function. vidPlayer.addEventListener("metadataReceived", listenerObject);
    1118: Implicit coercion of a value with static type Object to a possibly unrelated type Function. vidPlayer.addEventListener("playheadUpdate", listenerObject);
    Please would someone take a look and let me know what im doing wrong?
    Thanks
    code:
    var listenerObject:Object = new Object();
    var fullDuration = null;
    listenerObject.metadataReceived = function(eventObject:Object):void {
        fullDuration = prettyTime(vidPlayer.metadata.duration);
    listenerObject.playheadUpdate = function(eventObject:Object):void {
        var paTime = vidPlayer.playheadTime;
        if(fullDuration != null){
    //updates the text box with the instance name timeCode_txt on the root timeline.
    //best to use a monospace typeface like calibri for the textbox font.
            time_txt.text = prettyTime(vidPlayer.playheadTime) + " / " + fullDuration;
    vidPlayer.addEventListener("metadataReceived", listenerObject);
    vidPlayer.addEventListener("playheadUpdate", listenerObject);
    function prettyTime(timeinSeconds):String{
        var seconds:Number = Math.floor(timeinSeconds);
        var minutes:Number = Math.floor(seconds / 60);
        var hours:Number = Math.floor(minutes / 60);
        //Storing the remainder of this division problem
        seconds %= 60;
        minutes %= 60;
        hours %= 24;
        //Converting numerical values into strings so that
        //we string all of these numbers together for the display
        var sec:String = seconds.toString();
        var min:String = minutes.toString();
        var hrs:String = hours.toString();
        //Setting up a few restrictions for when the current time reaches a single digit
        if (sec.length < 2) {
            sec = "0" + sec;
        if (min.length < 2) {
            min = "0" + min;
        if (hrs.length < 2) {
            hrs = "0" + hrs;
        //Stringing all of the numbers together for the display
        var time:String = hrs + ":" + min + ":" + sec;
        //Setting the string to the display
        return time;

  • Nested Panels: Switching between

    I'm writing a program that has to switch between two panels that are nested in a parent panel. Is anyone there who has done this before and has a workable solution? Thanks in advance...

    Thanks very much, I tried this and this is the error I got when I clicked on the 'proceedBtn' in this case colorBtn...
    Using the content pane, the program does not know where to add the panel, is there a way of directing it to add the panel to the parent panel directly?.. I couldn't find any method that helps in this direction. Thanks again for the help.
    java.lang.Error: Do not use Talk2Me.ChatRoom.add() use Talk2Me.ChatRoom.getContentPane().add() instead
    at javax.swing.JFrame.createRootPaneException(JFrame.java:458)
    at javax.swing.JFrame.addImpl(JFrame.java:484)
    at java.awt.Container.add(Container.java:307)
    at Talk2Me.ChatRoom.colorBtnMouseClicked(ChatRoom.java:257)
    at Talk2Me.ChatRoom.access$100(ChatRoom.java:12)
    at Talk2Me.ChatRoom$2.mouseClicked(ChatRoom.java:190)
    at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:208)
    at java.awt.Component.processMouseEvent(Component.java:5096)
    at java.awt.Component.processEvent(Component.java:4890)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3174)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
    at java.awt.Container.dispatchEventImpl(Container.java:1609)
    at java.awt.Window.dispatchEventImpl(Window.java:1585)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

  • Opening .mp4 files using flvplayback component 2.5 in Air 3.2

    I've publishing the package using the extended desktop profile and captive runtime.
    When I run the published .exe file from a hard disk (either on my local machine or other test machines) it works fine, so I know that I have my code at least partially correct.
    I'm accessing the .mp4 files from a subdirectory of the applicationDirectory (eg: app:/video), the file names are read in from a .xml file.
    Example structure:
    exampleVideoSource = File.applicationDirectory.url+"video/12-16/attacking when in balance/counterattacking 2.mp4"
    Is this likely to confuse the FLVplayback component, if so what's the best way to get a working path?
    Thanks,
    Dan

    Discovered the issue.
    For mounted drives you need to use the nativePath property.
    For cross platform applications you can simply replace() the delimiter with the .separator property.
    Also for some reason the skin wouldn't load, despite the fact that I had chosen it in the component selector.
    I ended up setting the myFLVplayback.skin property just before I added the component to the stage.
    On  a related note, does anyone know if there's a difference between publishing an app with included folders, and simply publishing the app and adding the folders to the .app directory after the .app folder has been published?
    Dan

  • Unable to switch between txt and Facebook

    After the 8.1 update I can't switch between txt and Facebook anymore. Not sure if its something I'm doing wrong but I used to have a button in each contact that allowed me to txt them or send it to their Facebook inbox. I no longer have that button, yet I have group set to on. Does anyone know if this was removed with the new update or I'm missing something out. Thanks Donna
    Solved!
    Go to Solution.

    I would agree that removing the facebook/social media integration is a definite step back. Microsoft reasons that with the new implementation it will be easier for 3rd part developers to fill this gap, I personally think this was a bad design choice and found that this functionality specifically was great and very useful.
    Click on the blue Star Icon below if my advice has helped you or press the 'Accept As Solution' link if I solved your problem..

  • Unable to switch between viewstack's children

    Hi,
    I have a Viewstack with 2 containers:
    <mx:ViewStack id="preFeatureViewStack" selectedIndex="{model.viewStackIndexPublicAccess}">
    <s:NavigatorContent id="prefNav1" width="100%" height="100%">
    <view:PreferredFeature />
    </s:NavigatorContent>
    <s:NavigatorContent id="prefNav2" width="100%" height="100%">
    <view:UpdateFeatureLabel />
    </s:NavigatorContent>
    </mx:ViewStack>
    The selectedIndex property of Viewstack is bound to a variable, viewStackIndex, in my PresenationModel. I have getters and setters defined for this property.
    In PM :
    [Bindable]
    private var viewStackIndex : int;
    [Bindable(event="viewStackIndexChange")]
    public function get viewStackIndexPublicAccess () : int {
    Alert.show("in getter");
    return viewStackIndex;
    public function set viewStackIndexPublicAccess (viewId : int) : void {
    Alert.show("in setter");
    if(viewStackIndex != viewId) {
    Alert.show("old value = " + viewStackIndex);
    viewStackIndex = viewId;
    Alert.show("new value = " + viewStackIndex);
    dispatcher.dispatchEvent(new Event("viewStackIndexChange"));
    I am not able to switch between the viewstack's containers. Any ideas ?
    Thanks

    I don't know what dispatcher is, but that seems suspicious.  Usually you
    dispatch off the component.

  • Is there a keystroke to switch between screens?

    Is there a quick-key combination to switching between my screen and the other participants screen? I always hate having to "steal" the mouse pointer from the other party so that I can check on the status of something on my end.
    Thanks.
    Craig Elliott

    The issue of cross store purchasing comes up frequently so I'll just quote one of the most complete explanations (courtesy of Dave Sawyer) from the many given:
    In order to buy from any given country's iTunes Music Store you must be able to show some form of residency which would be either:
    a) a credit card with a billing address in that country, or
    b) a mailing address in that country and a gift certificate or a prepaid card that was bought in that country.
    If you cannot fulfill one of these two sets of conditions, you will not be able to purchase from any given country's iTMS.
    .......this is due to restrictions placed on Apple by the record companies and other rights holders (who are often completely different from country to country and so all require their own individual negotiations and contracts), not by Apple's choice. And this also applies to all the legal download stores that carry major-label content, not just the iTMS.

  • Switch between iPad and chromecast on my iPad?

    I joined Hulu Plus and installed their app on my mini. I then saw the choice between watching on mhy iPad or casting it to my TV. I cannot access that choice now. Any help?

    What data would you loose?
    Safari and Firefox are Browsers.  To switch between them all you would need to do is choose the relevant Window. ie. open Safari and then Open Firefox, and simply click on either of them to change.
    You can also use the keyboard:  command + tab to move between open windows.

Maybe you are looking for