header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Bujji1
Points:160
Posts:0

5/7/2010 4:34:11 PM

Title: Popup Windows and Youtube player


Hi All,

I am playing youtube in my TitleWindow. The problem is even if I close the popu Window still the youtube player is playing , I can not see the video but the sound is coming . Here is the code.

Thanks for your help




<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="485" height="408" title="About" showCloseButton="true" 
	close=" youtubevid=null;	PopUpManager.removePopUp(this) " initialize="init()" >
	<mx:Script>
		<![CDATA[
			import mx.managers.PopUpManager;
			
			
			 private function init():void
            {
                var url:String = "http://www.youtube.com/v/zlfKdbWwruY&hl=en&fs=1";    
                Security.allowDomain(url);                                             
                youtubevid.load(url);     
                youtubevid.                                           
            }   
			
		]]>
	</mx:Script>
	
        <mx:SWFLoader id="youtubevid" verticalAlign="top" horizontalAlign="center" width="100%" height="80%" />

</mx:TitleWindow>





1
Otis
Points: 0
Posts:0
5/8/2010 12:01:08 AM



if you need full control on youtube videos you can use the google's youtube API for flash , here is an example to use it :
http://code.google.com/p/gdata-samples/source/browse/trunk/ytplayer/actionscript3/com/google/youtube/example/AS3Player.as

2
HMS
Points: 280
Posts:0
5/8/2010 2:30:26 AM



you can try using this actionscript code to stop youtube player audio after unloading

youtubevid.unloadAndStop(true);
SoundMixer.stopAll();

3
Bujji1
Points: 160
Posts:0
5/8/2010 7:00:58 AM



Thanks Otis for the link . I have to check that.
HMS Ji , Thanks for your response . There is no function unloadAndStop in SWFLoader . and the soundmixed alone not helped me .I am using flex 3

Regards
Bujji

4
Rayan
Points: 690
Posts:0
5/8/2010 7:11:25 AM



unloadAndStop(true); this function is available if you compile your application for flash player 10 and above. else you can try removeChild(youtubevid);

5
Bujji1
Points: 160
Posts:0
5/8/2010 10:11:37 AM



Even If I use removechild , It didn't work . Still the back ground song is coming up. Here is the code I am using




<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="485" height="408" title="About" showCloseButton="true" 
	close=" removeChild(youtubevid);
			 SoundMixer.stopAll(); 	
			 PopUpManager.removePopUp(this) " initialize="init()" >
	<mx:Script>
		<![CDATA[
			import mx.managers.PopUpManager;
			
			
			 private function init():void
            {
                var url:String = "http://www.youtube.com/v/zlfKdbWwruY&hl=en&fs=1";    
                Security.allowDomain(url);                                             
                youtubevid.load(url);     
            }   
			
		]]>
	</mx:Script>
	
        <mx:SWFLoader id="youtubevid" verticalAlign="top" horizontalAlign="center" width="100%" height="80%" />

</mx:TitleWindow>




Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 7+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions