Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3442768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:42:34+00:00 2026-05-18T08:42:34+00:00

I want to add the following script in my action script for redirecting to

  • 0

I want to add the following script in my action script for redirecting to first frame after the external video finish,

But I’m not sure how to customize the code that suitable for my sction script.

This is the code I want to add with my AS :

ns.onStatus = function(info:Object)
{
if(info.code == 'NetStream.Play.Stop')
{
gotoAndPlay(2);
}
}

The following one is the original code now I’m using to play external video files. I need to customize the above code that should be usable for the below one.

function checkTime(flv)
{
    var _loc2 = flv.playheadTime;
    var _loc3 = Math.floor(_loc2 / 60);
    var _loc1 = Math.floor(_loc2 % 60);
    if (_loc1 < 10)
    {

        _loc1 = "0" + _loc1;
    } // end if

    current_time.text = _loc3 + ":" + _loc1;
} // End of the function
flv.pauseButton = pause_btn;
flv.playButton = play_btn;
flv.FLVPlayback.align = center;
var time_interval = setInterval(checkTime, 500, flv);

ffwd_btn.onRelease = function ()
{
    flv.seek(flv.playheadTime + 2);
};
rewind_btn.onRelease = function ()
{
    flv.seek(flv.playheadTime - 5);
};
mute_btn.onRelease = function ()
{
    if (videoSound.getVolume() == 0)
    {
        videoSound.start();
        videoSound.setVolume(volLevel);
    }
    else
    {
        volLevel = _root.videoSound.getVolume();
        videoSound.setVolume(0);
        videoSound.stop();
    } // end else if
};
var videoSound = new Sound(this);
videoSound.setVolume(100);
flv.contentPath = flvurl;
fl.video.FLVPlayback.align = center;

Can anyone help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:42:34+00:00Added an answer on May 18, 2026 at 8:42 am

    since you are using AS2, and the complete event firing is inconsistent with the FLVPlayback component in AS2 AND you are already polling with setInterval, just compare the video duration to the playheadTime in you checkTime() function like so:

    function checkTime()
    {
        // you other stuff here....
    
        if( flv.metadata && flv.metadata.duration > 0)
        {
            var prog:Number = Math.round((flv.playheadTime/flv.metadata.duration)*100);
    
            if( prog == 100 )
            {
                //clean up your interval
                clearInterval(time_interval);
    
                // do 'end of video' stuff
                gotoAndPlay(2);
            }
        }
    }
    

    note that the duration is nested inside the metadata property of the FLVPlayback instance. It’s not available until enough of the flv file has loaded, but since you are polling with your interval, it will be there when you need it.

    should get ya what ya want…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add a variable ${date} in the following bash script: ffmpeg -i
i want to add a data indicator line similar to the following image in
I have the following barchart to which I want to add error bars. library(lattice)
I want to add some html in an email. I've tried the following. vFromName
I have written the following code choice /m Do you want to add another
I have the following sting xxxxx, I want to add a hyphen like x-xxxx,
I've following Grid to display data, now when I want to add new record
I want to do the following: 1: Add two dropdown list in the register.aspx
I want to achieve something like the following: UrlBuilder ub = new UrlBuilder(http://www.google.com/search); ub.Parameters.Add(q,request);
I want to create a greasymonkey script, which will add a shortcut key for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.