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 6202695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:47:03+00:00 2026-05-24T04:47:03+00:00

New to this one. Have this code for viewing multiple netstream events. Want to

  • 0

New to this one. Have this code for viewing multiple netstream events. Want to use the onPlayStatus to loop the “flv/intro.flv” and for the rest of the videos, I would like them to return to the intro.flv after they are done playing, but I can’t find anything that helps enough. Can anyone offer a link or some help with the function? Here is my code so far :

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);

var metaDataListener:Object = new Object();
metaDataListener.onMetaData = function(meta:Object){
}

ns.client = metaDataListener
var myVideo:Video = new Video(800, 600);
myVideo.x = 0;
myVideo.y = 0;
addChild(myVideo);
setChildIndex(myVideo, 0);
myVideo.attachNetStream(ns);
ns.play("flv/intro.flv");

duetBTN.addEventListener(MouseEvent.CLICK, playVideo1);
vantageBTN.addEventListener(MouseEvent.CLICK, playVideo2);
cabrioBTN.addEventListener(MouseEvent.CLICK, playVideo3);
classicBTN.addEventListener(MouseEvent.CLICK, playVideo4);
laundryBTN.addEventListener(MouseEvent.CLICK, playVideo5);
resourceBTN.addEventListener(MouseEvent.CLICK, playVideo6);
industryBTN.addEventListener(MouseEvent.CLICK, playVideo7);
homeBTN.addEventListener(MouseEvent.CLICK, playVideo8);
function playVideo1(e:MouseEvent):void {
    ns.play ("flv/duet.flv");
}    
function playVideo2(e:MouseEvent):void {
    ns.play("flv/vantage.flv");
}
function playVideo3(e:MouseEvent):void {
    ns.play("flv/cabrio.flv");
}
function playVideo4(e:MouseEvent):void {
    ns.play("flv/classic.flv");
}



function playVideo5(e:MouseEvent):void {
    ns.play("flv/laundry.flv");
}
function playVideo6(e:MouseEvent):void {
    ns.play("flv/resource.flv");
}
function playVideo7(e:MouseEvent):void {
    ns.play("flv/industry.flv");
}
function playVideo8(e:MouseEvent):void {
    ns.play ("flv/intro.flv");
}
  • 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-24T04:47:04+00:00Added an answer on May 24, 2026 at 4:47 am

    You can attach an event listener to the NetStream object that detects when a video has finished playing.

    var introPlayer:NetStream = new NetStream(nc); // nc refers to shared net connection declared earlier
    var introVid:Video = new Video(800, 600);
    ns.addEventListener(NetStatusEvent.NET_STATUS, checkStreamStatus);
    
    function checkStreamStatus(e:NetStatusEvent):void {
            switch (e.info.code) {
                  case "NetStream.Play.Complete":
                  playIntro();
                  break;
            }
    };
    
    function playIntro():void {
           addChild(introVid);
           introVid.attachNetStream(introPlayer);
           introPlayer.play("flv/intro.flv");
    }
    

    Have changed the code completely to match the set-up you were using originally. This is how you’re supposed to do it, apologies for previous answer. This is the correct way of doing it though.

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

Sidebar

Related Questions

I have a follow-up question to this one . I created a new form,
I have a list like this Dim emailList as new List(Of String) emailList.Add(one@domain.com) emailList.Add(two@domain.com)
I have a simple has_one/belongs_to relationship between two models. This is a new association
I am using a route like this one: routes.MapRoute(Invoice-New-NewCustomer, Invoice/New/Customer/New/{*name}, new { controller =
Im still pretty new so bear with me on this one, my question(s) are
What's the difference between these: This one works: char* pEmpty = new char; *pEmpty
This has been one of the biggest obstacles in teaching new people ColdFusion. When
This concept is a new one for me -- I first came across it
This is a new one for me: What does this error indicate? /usr/bin/perl: bad
this query will just one row as a result myDataContext db = new myDataContext();

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.