Skip navigation
Home/Support/

Forums

12422 Views 13 Replies Latest reply: Nov 26, 2011 12:25 AM by gamarai RSS
wurdup User 28 posts since
Apr 15, 2009
Currently Being Moderated

Apr 18, 2009 8:48 AM

how to embed youtube on my flash site?

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.

  • yippmaster User 4 posts since
    Apr 23, 2009
    Currently Being Moderated
    1. Apr 24, 2009 2:07 AM (in response to wurdup)
    Re: how to embed youtube on my flash site?

    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

  • yippmaster User 4 posts since
    Apr 23, 2009
    Currently Being Moderated
    2. Apr 24, 2009 2:09 AM (in response to wurdup)
    Re: how to embed youtube on my flash site?

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

  • User 4 posts since
    Apr 24, 2009
    Currently Being Moderated
    3. Apr 24, 2009 10:56 AM (in response to yippmaster)
    Re: how to embed youtube on my flash site?

    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);

  • yippmaster User 4 posts since
    Apr 23, 2009
    Currently Being Moderated
    4. Apr 24, 2009 11:34 AM (in response to nate22)
    Re: how to embed youtube on my flash site?

    Hi Nate,

     

    if you paste the above code in an AS2 Flash CS3 Programm without any changes onto an empty Frame - > it works.

     

    Regards

    Florian

     

    (Example here:

    Embed Youtube Video in SWF

  • User 4 posts since
    Apr 24, 2009
    Currently Being Moderated
    5. Apr 24, 2009 11:38 AM (in response to yippmaster)
    Re: how to embed youtube on my flash site?

    WOAH MY GOD. Sorry about that, I guess I pasted it wrong. Thank you!

     

    Is it difficult to change the player's look?

     

    I had a perfectly good player working and playing YT vids, but YT went and changed something and now it doesn't work anymore.

  • User 4 posts since
    Apr 24, 2009
    Currently Being Moderated
    6. Apr 24, 2009 1:46 PM (in response to yippmaster)
    Re: how to embed youtube on my flash site?

    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?

  • yippmaster User 4 posts since
    Apr 23, 2009
    Currently Being Moderated
    7. Apr 24, 2009 1:59 PM (in response to nate22)
    Re: how to embed youtube on my flash site?

    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

  • User 4 posts since
    Apr 24, 2009
    Currently Being Moderated
    8. Apr 24, 2009 2:08 PM (in response to yippmaster)
    Re: how to embed youtube on my flash site?

    thank you so much!!

  • Hemmersfield User 3 posts since
    Feb 22, 2010
    Currently Being Moderated
    10. Feb 22, 2010 9:08 AM (in response to nate22)
    Re: how to embed youtube on my flash site?

    Hi Nate.

     

    I've just been playing about with sticking Youtubes into my flash site. I've opted to use the code as outlined in this thread as it works spot on. I was also looking for a way to set the scale (this code seems to load as a basic square, something to do with youtube perhaps?) and found myself working through a long line of suggestions and nothing has worked so far. The colour and boarder options have been pretty good though.

     

    But how about this as an option, dont edit with code, do it the old fashioned way, hands on. I've set up a separate layer for each Vid, on each layer I've drawn out a small square (something to represent the shape of the youtube vid). Convert this shape a movie clip and within this place a second layer with the code on it. then come out and test.

     

    You'll notice the vid plays to the far right of the little box you drew, no problem and now this box is the handle to move the vid about, when it's in place you can go back inside the movie clip and set alpha of this handle to 0%. But while you're working with it it's good to have it pink or something.

     

    The youtube video is now linked with the handle and both are relative, you can now play with the scale of your handle and the scale of your video will do the same. Not the best solution by but it certainly made my day.

     

    Thanks to all in this thread as I'd be truly stuck if you hadn't bothered.

     

    All the best and sorry if this is all too wordy.

  • Hemmersfield User 3 posts since
    Feb 22, 2010
    Currently Being Moderated
    11. Feb 22, 2010 3:24 PM (in response to Hemmersfield)
    Re: how to embed youtube on my flash site?

    P.S.

     

    Does anyone know what the code would be when clicking a button on the same page that holds the youtube vid, that tells flash to put away the youtube movie as it crashes the site when the flash file tries to continue to another page. Too much going on it would appear. You can still hear the video being played even though you skip to a new page in the falsh movie.

     

    Many Thanks,

     

    Dan

  • bwalker09 User 26 posts since
    Nov 2, 2009
    Currently Being Moderated
    12. Mar 2, 2010 5:13 AM (in response to wurdup)
    Re: how to embed youtube on my flash site?

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

     

    Best wishes,

  • gamarai User 2 posts since
    Nov 26, 2011
    Currently Being Moderated
    13. Nov 26, 2011 12:25 AM (in response to wurdup)
    Re: how to embed youtube on my flash site?

    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

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points