make sure to double check your as code after copying and pasting from you tube since copying and pasting from you tube adds dashes and spaces where they dont belong.
for any newbies out there this code will make the you tube movie and sound stop when you press a button to navigate to another screen or scene (scene in my case). As you can see I put it on my back button as well:bannerback_btn.addEventListener(MouseEvent.CLICK,fl_ClickToGoToScene_4);function fl_ClickToGoToScene_4(event:MouseEvent):void{MovieClip(this.root).gotoAndPlay(1, "intro");player.destroy();this.removeChild(loader);}
i can't find the code, i don't understand, :( can u give us a link where to copy this code?, i went to your site but it looks like a vet's site and anything make sense =(
Thank you mate. really great tut, but i was frustrated as i seen that site is down.. but it takes some seconds to find this. great job. thanks again ;-)
I can embed you tube video in my flash, but there is a problem is that how can I position the video? It doesn't go to the place where my movie clip is.
Since people using this code are running AS3, just use the code snippet Click To Stop All Sounds to stop the audio from playing after you navigate away from the video.
Slight problem so far - the clip is coming up, just not in the bounding box of the movie clip. It is stuck in the lefthand corner of the stage - any help would be gratefully received, thanks :)
i pasted the exact code down to space and lines...I had finally got the right part of the code to turn green and just when I though it was gonna work ERRORS!!!!
@kousoulides does with with CS3 - Literally have to just replace any " in the actionscript. So, where there's an " just select and retype " - it works though! Great video!!!
I keep getting the syntax error "statement must appear within on/on ClipEventHandler" on lines 7, 15, 17 etc. I have changed the quote symbols but I dont know how to solve this problem to get the video to work. All I see now when I Test the scene or publish it is just a grey box. How do I solve this problem?
superb tutorial & its very powerful and its work perfect but sir there is problem with this button code when i'm navigatting to enother page the sound still surrounding in the background i need idea how this mcBackBut funcationing with the movieclip bec i used this code but still showing error plz make tutorial in your website thankz in advance //mcBackButton.addEventListener(MouseEvent.CLICK, videoStop);
function videoStop(evt:MouseEvent):void{ VIDEO INSTANCE.stop();SoundMixer.stopAll();
Hi All! If you're having a problem while making a flash site where the sound of the video keeps playing after navigating away from it, you can add this line of code to any button that navigates away from the clip and it will fix the problem.
@abercrombizombie is this code AS3 compatible? I get these two errors
Symbol 'menu_mc', Layer 'Actions', Frame 21, Line 18 1071: Syntax error: expected a definition keyword (such as function) after attribute VIDEO, not INSTANCE.
Symbol 'menu_mc', Layer 'Actions', Frame 21, Line 18 1084: Syntax error: expecting rightbrace before semicolon.
@abercrombizombie I didn't find this very useful because it stops all the sounds in the flash piece.I made this workaround, hopefully it'll help someone:
// Call when you want video to go away
function stopYTPlayer():void{ this.removeChild(loader);
}
// Call when you want video to appear
function enableYTPlayer():void{ loader.load(new URLRequest("[YT_video_address]"));
}
After the loader is initiated, it'll add a new instance as a child, and the process will repeat itself.
I'm using this tutorial to play Youtube files on my Flash-website. But I have a problem:
When you play the Youtube movie and don't turn it off, then click on something else so the site opens an other frame, the movie is still playing. So you still hear the music of the video..
When I test my website in a browser, Adobe Flash Players blocks the Youtube movie. I have to change the settings for Adobe Player to make the browser allow the Youtube movie. Will this be the same when the site is online?
Hi Aaron, I am Having a problem... Everything checks out fine, there are no errors on the script. I'm inside the layer of the movie clip (thats where I put the code) and everything looks good.
but when I try the scene, or publish out, the only thing showing is the grey box I created, no video or player!
and it stays like that... LOL...
Do you know whats going on? I'm using flash CS4 AS3.0
Thanks for the tut. its really helpfull. just need to get this working
@eufonicos Same problem for me. Got it in there, put the AS in the youtube clip on frame 1, and when I'm inside the youtube clip, I can click test scene and it puts the vid up in the top left corner. So then I back out and go to my Scene 1 and click test and it doesn't show up at all. I'm totally stumped here.
Hi Aaron... Loved the video... just wondering if you have a revised version of this code for AS2? I'm upgrading next week, but I need this to work in AS2 at the moment.
hy! i`m romanian and my writing is not good. I whant to put youtub video in my flsh site ,i copy your code, replace where you told as and not whork. I have errors.... can you resolv this problem???
hi, great video, having few problems with the code from your site... Line 7, 17 and 19, all syntax errors... very puzzeled, do you have any ideas as im not the best with code...
Thanks you for your helpful video Aaron! It was very nice, an i haven't found something else about this here! Your blog is also helpful, we waitting more... ;)
@constantinet08 Thank you for your kind words! It is because of people like you that I make these videos. I am recording some in depth videos today! I look forward to your feedback!
If you get a chance can you do a tutorial on making drop down menu buttons.. (ie (you scroll over a menu button and it drops a list of more buttons down...) if that makes sense sorry im new and its hard to explain lol... Thanks!!
@scareddogdotcom after pressing f8 & converting to symbol..i double click the video box upon that i'm given a new layer1..i noticed that you do not get a seperate layer to paste in the code...does this make any difference?
@scareddogdotcom I double clicked the box and pasted the code in the layer..I was feeling the same way and have been trying to see if their are other locations associated with the videobox..there isnt..i will try again though as we speak
i dont know if this means anything but it appears to be sitting on top of the box..of course if it sized correctly then it would seem to appear inside the videobox
@scareddogdotcom i started over on a blank stage and made the rectangle from there..it was the only layer in my document...still the size line does not work for me...
cant get the player.setSize(w, h) to work. upon testing the video shows but in regular size...i need the size to be 240x200 or close. any suggestions?
@scareddogdotcom Got it! bad user syntax on "trace("player ready:", Object(event).data); i had a period behind trace...yes i typed all the code because your site was down...thru typing it myself though i feel i have a decent understanding of what a lot of the code does....thanks
ye these films are awesome could you make like a tutorial bout the very basics of flash souch as making lines not sticking together you know boring stuff but very very useful for beginners =) i think this channel really ha a future in this stuff =D
There is no code on the website...Stupid!
illerhag1 1 day ago
thanx alot
i was just wondering if i use this would it still count as a view for the user who uploaded the video.
440598 1 month ago
Hey, this is just great, thanks a lot! It's guys like you that keep things going! Thanks!
evanbetter 1 month ago
YOUR WEBSITE IS JUST DOG STUFF!!!
GrowlingSauce 1 month ago 2
@GrowlingSauce maybe you read before you shout. This guy is just great and helps others. Maybe you rethink your postings before you press "Post".
evanbetter 1 month ago
make sure to double check your as code after copying and pasting from you tube since copying and pasting from you tube adds dashes and spaces where they dont belong.
dillonculp1 1 month ago
for any newbies out there this code will make the you tube movie and sound stop when you press a button to navigate to another screen or scene (scene in my case). As you can see I put it on my back button as well:bannerback_btn.addEventListener(MouseEvent.CLICK,fl_ClickToGoToScene_4);function fl_ClickToGoToScene_4(event:MouseEvent):void{MovieClip(this.root).gotoAndPlay(1, "intro");player.destroy();this.removeChild(loader);}
dillonculp1 1 month ago
is there any way i can embed a youtube video in fireworks?Cause i make a website only using fireworks and i am not sure if i can.
Thanks in advance!
sandypet1995 1 month ago
i can't find the code, i don't understand, :( can u give us a link where to copy this code?, i went to your site but it looks like a vet's site and anything make sense =(
4kaWander 2 months ago
This has been flagged as spam show
i am trying to follow your video to upload a youtube video to my flash website. I am unable to find the code to paste into my actions layer.
kizzadawg22 2 months ago in playlist Favorite videos
hey thanks for the tut ....
This isnt what im looking for, im looking to embed a soundcloud music player.
would anyone know how to to?
djreaperent 3 months ago
Hi! Thanks for your help!
Is there a way to allow fullscreen in the embeded youtube player?
tarekmoneimsaid 3 months ago
Hi where can I find this flash file?
christiewittful 3 months ago
Hi, this video is exactly what I've been looking for :( but the scareddog site isn't working. Can you paste the code please.
cylentnoyz 4 months ago 2
The website is not working can u inbox me the code please, thank you
JesusKnowsU 4 months ago in playlist JesusKnowsU's favourites
thanks. very helpful. anyone know how for vimeo?
thepeanutpixel 4 months ago
The video is loading but flickers once every two seconds.
pvollman 4 months ago
Comment removed
pvollman 4 months ago
This has been flagged as spam show
HEY THE WEBSITE IS DOWN I CAN NOT COPY THE CODE - I NEED THIS PLEASE
alearso 4 months ago
HEY THE WEBSITE IS DOWN I CAN NOT COPY THE CODE - I NEED THIS PLEASE
alearso 4 months ago
If his website is still down, I have typed up the code and made an example .fla you can download.
mediafire fullstop com/?qfy5sks2ar5y23r
(replace the 'fullstop' with a full stop and remove spaces)
Hope it helps!
stewze 5 months ago 13
@stewze That really helped Thank you for sharing that one!
Also a big thank to Scareddog!
Xaiaq 4 months ago
@stewze thanks
hepzelcastro 4 months ago
@stewze
Thank you mate. really great tut, but i was frustrated as i seen that site is down.. but it takes some seconds to find this. great job. thanks again ;-)
aravisionDE 3 months ago
@stewze Hi where can I find this flash file?
christiewittful 3 months ago
@christiewittful It's in the link I posted. Replace the full stop with a '.'
stewze 3 months ago
@stewze Thank you!
christiewittful 3 months ago
Can't seem to find the code, and your site appears to be down. Can you help me out? Thank's and nice tutorial.
BlackMathVP 6 months ago
This has been flagged as spam show
website is not working can you help us and copy the code into the description?
Thank you !
STCFootwear 6 months ago
website is not working
davelugo 6 months ago
Your site is inaccessible! Can you put that code here on the description area?
ksbsts 6 months ago
thank you so much
ROJAN2121 6 months ago
thank you
ROJAN2121 6 months ago
or you can just paste
SoundMixer.stopAll();
on any page/frame so that when it navigates to that page/frame all sounds stop :-D
motep999 6 months ago
where can i get the code?your website is not available.
b4september 6 months ago
where can i get the code?your website is not available.
b4september 6 months ago
hi your site seems to be down, where can i find the script please?
1106090 7 months ago
Comment removed
sweetdulcelush 7 months ago
it's ActionScript 3.0!!!!!!
Can see at "0.11" in proporties panel !!!
Burhoveckis 7 months ago
hi why am i getting this error all the time?
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
wesKokigen 8 months ago
Anyone know how to add a fullscreen option?
Phobs87 9 months ago
I can embed you tube video in my flash, but there is a problem is that how can I position the video? It doesn't go to the place where my movie clip is.
yinlin20 9 months ago
Since people using this code are running AS3, just use the code snippet Click To Stop All Sounds to stop the audio from playing after you navigate away from the video.
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds);
function fl_ClickToStopAllSounds(event:MouseEvent):void
{ SoundMixer.stopAll();
}
Using the snippet will automatically replace the "button_1" with whatever you named your back button.
AriaKelmanos 9 months ago
does this work with actionscript 2?
EdwinBobo 9 months ago
I'm getting numerous errors..
Scene 2, Layer 'Video box', Frame 2, Line 7 1093: Syntax error.
Scene 2, Layer 'Video box', Frame 2, Line 7 1093: Syntax error.
Scene 2, Layer 'Video box', Frame 2, Line 17 1093: Syntax error.
Scene 2, Layer 'Video box', Frame 2, Line 17 1084: Syntax error: expecting rightparen before colon.
Scene 2, Layer 'Video box', Frame 2, Line 19 1084: Syntax error: expecting rightparen before colon.
BurgessGaming 9 months ago
Hi, i cant seem to find the code in your site. any help linking me to it?
TwistedMusikPuntoCom 9 months ago
Slight problem so far - the clip is coming up, just not in the bounding box of the movie clip. It is stuck in the lefthand corner of the stage - any help would be gratefully received, thanks :)
kittynation 9 months ago
@kittynation is this something to do with me using CS3 rather than 5???
kittynation 9 months ago
@kittynation ignore my query! Stupid me was putting the AS in the 1st frame of the scene rather than the movie clip... great tutorial! :)
kittynation 9 months ago
i pasted the exact code down to space and lines...I had finally got the right part of the code to turn green and just when I though it was gonna work ERRORS!!!!
nstylephotographix 10 months ago
easy as pie! Thanks !!!!
AndroidPhone1 10 months ago
wow.. it worked.. You need to replace all the brackets though " "
kousoulides 11 months ago
It doesn't work with CS3? right?
kousoulides 11 months ago
@kousoulides does with with CS3 - Literally have to just replace any " in the actionscript. So, where there's an " just select and retype " - it works though! Great video!!!
kittynation 9 months ago
dfgdfg
videomanico13 11 months ago
I keep getting the syntax error "statement must appear within on/on ClipEventHandler" on lines 7, 15, 17 etc. I have changed the quote symbols but I dont know how to solve this problem to get the video to work. All I see now when I Test the scene or publish it is just a grey box. How do I solve this problem?
mjhjww830 11 months ago
Oops! I found it!
mjhjww830 11 months ago
I cannot find the code for this on the website. Am I looking in the wrong place? Where is the code?
mjhjww830 11 months ago
superb tutorial & its very powerful and its work perfect but sir there is problem with this button code when i'm navigatting to enother page the sound still surrounding in the background i need idea how this mcBackBut funcationing with the movieclip bec i used this code but still showing error plz make tutorial in your website thankz in advance //mcBackButton.addEventListener(MouseEvent.CLICK, videoStop);
function videoStop(evt:MouseEvent):void{ VIDEO INSTANCE.stop();SoundMixer.stopAll();
}
DJSalim1o1 11 months ago
Hi! I also tried this code and I get this error:
Error opening Hi! I also tried this code and I get this error:
Error opening youtube video something (Youtube won't allow me to post the complete syntax)
Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.
charlesgwapo23 11 months ago
Hi! I also tried this code and I get this error:
Error opening
Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.
charlesgwapo23 11 months ago
Hi,
Thanks for sharing this.
I have got everything working except one thing.
How can I change the location of the video on the stage?
I have a TV type of background that I would like to mask a video inside.
Thanks,
ramtinworld 11 months ago
@ramtinworld
Hi again,
I figured this out... I just needed to adjust the location of the clip manually.
That being said, I have another issue and thats the sound of the video... It doesnt sync with the picture.
Have ever had this issue?
Cheers,
ramtinworld 11 months ago
You are a genius, I can't believe how easy you made something that seems so complicated. One question, how do I get it to autoplay?
jemsdaily 11 months ago
good tutorial, where can I get the scrip, is hard to read it on the screen
davelugo 1 year ago
Hi All! If you're having a problem while making a flash site where the sound of the video keeps playing after navigating away from it, you can add this line of code to any button that navigates away from the clip and it will fix the problem.
mcBackButton.addEventListener(MouseEvent.CLICK, videoStop);
function videoStop(evt:MouseEvent):void{ VIDEO INSTANCE.stop();SoundMixer.stopAll();
}
abercrombizombie 1 year ago 8
@abercrombizombie Thanks for this! I am sure many people will find it useful!
scareddogdotcom 1 year ago
Hi scareddog!
this line of code works in the swf file, but doesn't work when I publish the site.
any suggestionns please?
thank you very much
fabriziospucches 8 months ago
hi aberscrombizombie
this line of code works in the swf file, but doesn't work when I publish the site.
any suggestionns please?
thank you very much
fabriziospucches 8 months ago
@abercrombizombie is this code AS3 compatible? I get these two errors
Symbol 'menu_mc', Layer 'Actions', Frame 21, Line 18 1071: Syntax error: expected a definition keyword (such as function) after attribute VIDEO, not INSTANCE.
Symbol 'menu_mc', Layer 'Actions', Frame 21, Line 18 1084: Syntax error: expecting rightbrace before semicolon.
davelugo 6 months ago
@abercrombizombie I didn't find this very useful because it stops all the sounds in the flash piece.I made this workaround, hopefully it'll help someone:
// Call when you want video to go away
function stopYTPlayer():void{ this.removeChild(loader);
}
// Call when you want video to appear
function enableYTPlayer():void{ loader.load(new URLRequest("[YT_video_address]"));
}
After the loader is initiated, it'll add a new instance as a child, and the process will repeat itself.
marquizzo 3 months ago
@marquizzo thanks! i put that function on my back button. It takes away the video but not the sound. Do you know how to take the sound away?
dillonculp1 1 month ago
@abercrombizombie do you have an action script 2.0 version of this code?
motep999 2 months ago
@abercrombizombie i'm having trouble with this code since flash give me an error having to do with VIDEO INSTANCE. Any help?
dillonculp1 1 month ago
Hi,will this work with action script 2.0?I'm using Flash pro8 and really need to put a youtube vid on my site.Thanks
SPFXsynthesisers 1 year ago
Hey man,
I'm using this tutorial to play Youtube files on my Flash-website. But I have a problem:
When you play the Youtube movie and don't turn it off, then click on something else so the site opens an other frame, the movie is still playing. So you still hear the music of the video..
Do you have a solution?
FootballClipsLive 1 year ago
@FootballClipsLive
I am also having the same problem, I've been searching everywhere for a solution but haven't found one yet
abercrombizombie 1 year ago
Thank you soooooo much! You have just solved all my problems!!
Arekkz 1 year ago
When I test my website in a browser, Adobe Flash Players blocks the Youtube movie. I have to change the settings for Adobe Player to make the browser allow the Youtube movie. Will this be the same when the site is online?
SoccerSummary 1 year ago
can you give me the code???
PLEASE :)
LuisBeast 1 year ago
Hi Aaron, I am Having a problem... Everything checks out fine, there are no errors on the script. I'm inside the layer of the movie clip (thats where I put the code) and everything looks good.
but when I try the scene, or publish out, the only thing showing is the grey box I created, no video or player!
and it stays like that... LOL...
Do you know whats going on? I'm using flash CS4 AS3.0
Thanks for the tut. its really helpfull. just need to get this working
and I'll be very happy!!!
eufonicos 1 year ago
@eufonicos Same problem for me. Got it in there, put the AS in the youtube clip on frame 1, and when I'm inside the youtube clip, I can click test scene and it puts the vid up in the top left corner. So then I back out and go to my Scene 1 and click test and it doesn't show up at all. I'm totally stumped here.
unoillnino 3 months ago
@unoillnino Nevermind. I got it working. Not sure what I did different, but I started over from the begining and it worked.
unoillnino 3 months ago
Hi Aaron... Loved the video... just wondering if you have a revised version of this code for AS2? I'm upgrading next week, but I need this to work in AS2 at the moment.
Thanks so much.
jessicang714 1 year ago
@jessicang714 Hi, no I am sorry I only have the AS3 at this time.
scareddogdotcom 1 year ago
@scareddogdotcom
I did everything was mentioned in the video and it works in Flash CS4.
But the Youtube video doesn't play in any browser (I tried Chrome, Firefox and IE).. How can I solve that?
SoccerSummary 1 year ago
@SoccerSummary I haven't had any issues in those browsers are you sure you are applying the code correctly?
scareddogdotcom 1 year ago
@scareddogdotcom
It works now. Thx for you video! :D
SoccerSummary 1 year ago
@SoccerSummary
I am getting the same error, how did you fix it?
abercrombizombie 1 year ago
Comment removed
abercrombizombie 1 year ago
Comment removed
abercrombizombie 1 year ago
Does this also work with sites like vimeo?
MKKP972 1 year ago
@MKKP972 It only works for YouTube, sorry.
scareddogdotcom 1 year ago
hy! i`m romanian and my writing is not good. I whant to put youtub video in my flsh site ,i copy your code, replace where you told as and not whork. I have errors.... can you resolv this problem???
hdfilmari 1 year ago
@hdfilmari Some people have stated that the " (quotes) in the code need to be replaced when the copy and paste.
scareddogdotcom 1 year ago
hi, great video, having few problems with the code from your site... Line 7, 17 and 19, all syntax errors... very puzzeled, do you have any ideas as im not the best with code...
Murgy91 1 year ago
@Murgy91 Try doing a copy and replace on all of the quotes.
scareddogdotcom 1 year ago
Comment removed
jordana8899 1 year ago
Comment removed
jordana8899 1 year ago
Comment removed
jordana8899 1 year ago
Hi Aaron, have you look about my question, how to do embed youtube video stop (or its sound stop) when we push a button?
constantinet08 1 year ago
This is exactly what I need, thank you very much... I'm going to your website right now...
cortes2k 1 year ago
Aaron how i can rate the videos? is the like button enough?
constantinet08 1 year ago
@constantinet08 Yes the like button is great! thank you!
scareddogdotcom 1 year ago
Thanks you for your helpful video Aaron! It was very nice, an i haven't found something else about this here! Your blog is also helpful, we waitting more... ;)
constantinet08 1 year ago
@constantinet08 Thank you for your kind words! It is because of people like you that I make these videos. I am recording some in depth videos today! I look forward to your feedback!
scareddogdotcom 1 year ago
I am planning to make a few different tutorials. If you have any suggestions for a tutorial you would like please let me know.
scareddogdotcom 1 year ago
@scareddogdotcom
Aaron, your videos are very helpful!
Thank You so much!!
If you get a chance can you do a tutorial on making drop down menu buttons.. (ie (you scroll over a menu button and it drops a list of more buttons down...) if that makes sense sorry im new and its hard to explain lol... Thanks!!
dmx1151 1 year ago
@scareddogdotcom after pressing f8 & converting to symbol..i double click the video box upon that i'm given a new layer1..i noticed that you do not get a seperate layer to paste in the code...does this make any difference?
CHILLENEUM 1 year ago
@scareddogdotcom I double clicked the box and pasted the code in the layer..I was feeling the same way and have been trying to see if their are other locations associated with the videobox..there isnt..i will try again though as we speak
CHILLENEUM 1 year ago
i dont know if this means anything but it appears to be sitting on top of the box..of course if it sized correctly then it would seem to appear inside the videobox
CHILLENEUM 1 year ago
@CHILLENEUM It sounds like your not inside the youtubeClip symbol. Did you double click the box then paste the actions inside of the clip?
scareddogdotcom 1 year ago
@scareddogdotcom i started over on a blank stage and made the rectangle from there..it was the only layer in my document...still the size line does not work for me...
CHILLENEUM 1 year ago
i haven't posted it yet because of this im still working on it on the cs5 stage
CHILLENEUM 1 year ago
The website is back online!
scareddogdotcom 1 year ago
cant get the player.setSize(w, h) to work. upon testing the video shows but in regular size...i need the size to be 240x200 or close. any suggestions?
CHILLENEUM 1 year ago
@CHILLENEUM - When you set the size of the video box that should change the video size. Do you have it posted online for me to look at?
scareddogdotcom 1 year ago
@scareddogdotcom Got it! bad user syntax on "trace("player ready:", Object(event).data); i had a period behind trace...yes i typed all the code because your site was down...thru typing it myself though i feel i have a decent understanding of what a lot of the code does....thanks
CHILLENEUM 1 year ago
@CHILLENEUM The website is back online. Sorry you had to type in all of the code.
scareddogdotcom 1 year ago
Please post an working link to the code ;-)
gonglicoop 1 year ago
hello the URL link for the code is not opening?
sajjadalifanclub 1 year ago 5
ye these films are awesome could you make like a tutorial bout the very basics of flash souch as making lines not sticking together you know boring stuff but very very useful for beginners =) i think this channel really ha a future in this stuff =D
MrCoopcoke 1 year ago
calm and nice voice you have. keep up the good tutorials with flash cs5.
Can you make a "text glowing and scrooling movieclip" tut?
fastwrite123 1 year ago