Skip to main content
Participant
April 18, 2009
Question

how to embed youtube on my flash site?

  • April 18, 2009
  • 5 replies
  • 25474 views

How do I embed a youtube video on my flash website (using flash cs3 AS2). I have tried importing video but after entering the url it keeps saying falied to load FLV:

I'm not sure thats is the right way to do it. All tutorials on the web seem to be about HTML.

    This topic has been closed for replies.

    5 replies

    gamarai
    Participant
    November 26, 2011

    Good Day

    Does anyone know How do I embed a youtube video on my flash website, i'm using flash CS5 and ActionScript 2???!!

    I've seen several video tutorials on youtube and other websites about this, but they only work with a window of 480px for 385px (4:3),

    which doesn't allow the fullscreen option on the lower bar of the video, because the player still had a silver bar not a black one !!!!

    This is the one i've been using!!!  http://www.youtube.com/watch?v=wfU5Hj3uKZ4

    I would like to use a widescreen window (16:9; 16:10), like the ones youtube curently uses, 360p; 480p;720p.

    I would very much appreciate any help you can give me!!!

    Thank you

    March 2, 2010

    Does anyone know how this would work in action script 3?

    Best wishes,

    wurdupAuthor
    Participant
    April 24, 2009

    thanks for your help. I'll try to get the code running at the weekend

    Participant
    April 23, 2009

    Sorry for pastin twice (well erased now so not anymore)

    Participant
    April 23, 2009

    This works with a tiny little snippet:

    function containYoutube(youtubevar, depthLevel) {

         this.createEmptyMovieClip("youtubecontainer",depthLevel);

         this.youtubecontainer.loadMovie("http://www.youtube.com/v/"+youtubevar);

    }

    containYoutube("PXu6AKePXkQ",this.getNextHighestDepth());

    You can now just enter the Youtube internal ID and chose your depth.

    Much fun

    Florian

    Participant
    April 24, 2009

    Yippmaster, would it be possible for you to paste in some actual working sample code? I see here you have put it generic instructional variables but that does not help someone like me who needs to see an ACTUAL EXAMPLE of what the correct code should look like.

    I pasted your code exactly and got syntax errors on lines 2 and 3, which are these lines:

         this.createEmptyMovieClip("youtubecontainer",depthLevel);

         this.youtubecontainer.loadMovie("http://www.youtube.com/v/"+youtubevar);

    Participant
    April 24, 2009

    My old player was Toobplayer, but the author of that component has recently accidentally destroyed his own player. I guess he's working on it now.

    So, this is a good solution. Thanks again.

    Is there a way to SCALE THE MOVIE PLAYER?


    Hi Nate,

    the full exmplanation is available at google

    http://code.google.com/apis/youtube/player_parameters.html

    So the example line

    http://www.youtube.com/v/VIDEO_ID&color1=0x2b405b&color2=0x6b8ab6&fs=1

    shows you exactly what to do

    To go back to my example simply change the youtubevar which calls the function to the whole expression:

    containYoutube("PXu6AKePXkQ&color1=0x2b405b&color2=0x6b8ab6&fs=1",this.getNextHighestDepth());

    And happy experimenting!

    About scaling:

    I couldn't find a paramter to receive a scaled version directly.

    So I think not - only with more complex stuff.

    Florian waves