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

  • Home
  • SEARCH
  • 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 8962695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:11:16+00:00 2026-06-15T16:11:16+00:00

I have a flash banner with a youtube video embeded within it. When the

  • 0

I have a flash banner with a youtube video embeded within it. When the user presses a button, the banner goes to a specific frame and plays the video. What I need it to do, is after the video is finished, for it to forward to another frame.

The AS3 I am using to pull in the youtube video is below:

stop();

var player:Object;

Security.allowDomain("www.youtube.com");

var vidctn:Loader = new Loader();
vidctn.load(new URLRequest("http://www.youtube.com/apiplayer?version=3"));
vidctn.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);

function onLoaderInit(e:Event):void{
addChild(vidctn);
player = vidctn.content;
player.addEventListener("onReady", onPlayerReady);
}

function onPlayerReady(e:Event):void{
player.destroy();
addChildAt(vidctn,0);
player.setSize(304,173);
player.x = 0;
player.y = 40;
player.mute();
player.loadVideoById("Dzz6lUsF19g",0,"large");
}

I’m thinking I need an eventlistener, possibly Event.COMPLETE, but I can’t seem to come up with one.

  • 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-06-15T16:11:18+00:00Added an answer on June 15, 2026 at 4:11 pm

    these are the states of the youtube api (you only need YT_ENDED, but it is nice to have all):

            public static var YT_UNSTARTED:int = -1;
            public static var YT_ENDED:int = 0;
            public static var YT_PLAYING:int = 1;
            public static var YT_PAUSED:int = 2;
            public static var YT_BUFFERING:int = 3;
            public static var YT_CUED:int = 5;
    

    add a listener:

            vidctn.contentLoaderInfo.addEventListener("onStateChange", onPlayerStateChange);
    

    and here is the function:

            protected function onPlayerStateChange(event:Event):void {
                trace("youtubePlayer: player state:", Object(event).data);
                if(Object(event).data==YT_ENDED) {
                       //here you can do your stuff
                }
           }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a flash file (a simple banner), with all the animations within child
I have one flash file which is embading in another, the embeded one is
I have a flash banner that I want to replace with a static image
My problem is, that i have a flash banner, with a menu above it.
I have just finished making a flash banner in Fl5 and have embedded it
I have a website with a Flash banner. This has worked fine in all
I have a website that has a Flash banner. For devices that do not
I have Flash game at my site. There is a button Download full version
I have flash object(video). And i want to open a page while on click
I need to make a flash banner. A really simple banner. But I don't

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.