Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-29-2011, 07:05 PM   #1
New Member
 
Join Date: Oct 2010
Posts: 12
Default pop up video frame AS 3.0

hi,

I'm making a website with video's (= link to YouTube) and would like to arrange that when you click on the button, containing the URL/link to the video on YouTube, the video opens in a pop up frame with "close X" in the corner, in stead of opening in a new webpage.

As is ex.: video opens in a new entire webage
http://hd-gametrailers.mastercombo.com/

TO BE: video should pop up in a smaller frame, with "close X" in corner.
First video on page with title "Video Weather Forecast"
http://www.accuweather.com/en/us/cle...ecast/18887_pc

The code linking to the video's on YouTube:
Code:
// The player SWF file on www.youtube.com needs to communicate with your host
// SWF file. Your code must call Security.allowDomain() to allow this
// communication.
Security.allowDomain("http://www.youtube.com");
Security.allowDomain("http://s.ytimg.com");
// This will hold the API player instance once it is initialized.
var player:Object;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.INIT, onLoaderInit);
loader.load(new URLRequest("http://www.youtube.com/v/iFcxnkXvaG8?version=3"));
function onLoaderInit(event:Event):void {
	addChild(loader);
	loader.content.addEventListener("onReady", onPlayerReady);
	loader.content.addEventListener("onError", onPlayerError);
	loader.content.addEventListener("onStateChange", onPlayerStateChange);
	loader.content.addEventListener("onPlaybackQualityChange",
	onVideoPlaybackQualityChange);
}
function onPlayerReady(event:Event):void {
	// Event.data contains the event parameter, which is the Player API ID
	trace("player ready:", Object(event).data);
	
	// Once this event has been dispatched by the player, we can use
	// cueVideoById, loadVideoById, cueVideoByUrl and loadVideoByUrl
	// to load a particular YouTube video.
	player = loader.content;
	// Set appropriate player dimensions for your application
	player.setSize(1000,550);
}
function onPlayerError(event:Event):void {
	// Event.data contains the event parameter, which is the error code
	trace("player error:", Object(event).data);
}
function onPlayerStateChange(event:Event):void {
	// Event.data contains the event parameter, which is the new player state
	trace("player state:", Object(event).data);
}
function onVideoPlaybackQualityChange(event:Event):void {
	// Event.data contains the event parameter, which is the new video quality
	trace("video quality:", Object(event).data);
}
Anyone who could help or advice how I can do this? Thanks for your help.

Last edited by Manganix; 11-30-2011 at 07:21 PM.
Manganix is offline   Reply With Quote


Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:10 AM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.