Video class in Actionscript 3

February 10th, 2009

Hi again for all, well think you creating a simple video player in max one minute.  ”Yes, We Can”.  Using  the videoPlayer class from asDataLibs. The videoPlayer is a simple way to make your video player or video gallery using less time than the normal process. Bellow some features:

• Support HD (h.264)
• Play and Pause button together;
• Mute button;
• Seek bar and loaded bar;
• Time played and total time of video.

In final of this post you will see the link to download the sample video player and the source code demonstrated in this article. See the sample of video Bellow.

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)
video by Flasher Magazine

Create the video is so simple like show these actionscript line ahead:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import com.dLibs.video.videoPlayer;
 
	public class main extends MovieClip
	{
		private var videoObject:videoPlayer;
		private var videoURL:String = "http://adobe.edgeboss.net/download/adobe/adobetv/flasher_magazine/issue_1/issue1.mp4";
		private var videoWidth:uint = 700;
		private var videoHeight:uint = 400;
		private var videoStart:Boolean = false;
 
		public function main():void
		{
			videoObject = new videoPlayer(videoURL,700,400,false);
			videoObject.addBuffer 		= newBuffer;
			videoObject.addPlayPause 	= playPause;
			videoObject.addMuteSound 	= muteIcon;
			videoObject.addDuration 	= seekControll.theTime;
			videoObject.addSeek 		= {progress:seekControll.seekProgress, loader:seekControll.seekLoader};
			newVideo.addChild(videoObject);
 
			// @ Change status of playPause Button
 
			playPause.addEventListener(MouseEvent.CLICK, changePlayPause);
		}
 
		private function changePlayPause(m:MouseEvent):void
		{
			if ( m.currentTarget.currentFrame == 1 ) 	{ m.currentTarget.nextFrame(); }
			else 										{ m.currentTarget.prevFrame(); }
		}
	}
}

In resume the videoPlayer object receive three variables:
• URL of video, width and height of video.
By default this video will play when buffer is full, but can change it sending ‘false’ withe the fourth variable that is if the video will start or not on load buffer complete. Other optional variable is buffer time. The complete object is:

new videoPlayer(videoURL:String,videoWidth:uint, videoHeight:uint, videoStart:Boolean = true, videoBuffer:uint = 10)

Now you can put the playpause button, mute button and seek too:

19
20
21
22
23
videoObject.addBuffer 		= newBuffer;
videoObject.addPlayPause 	= playPause;
videoObject.addMuteSound 	= muteIcon;
videoObject.addDuration 	= seekControll.theTime;
videoObject.addSeek 		= {progress:seekControll.seekProgress, loader:seekControll.seekLoader};

After that you need add this object in your stage and now see your video into Flash using Actionscript 3 easy.

Download the sample and source here.

Um site muito, muito legal que encontrei na net que explica e ensina – com videos – coisas muito comuns do dia-a-dia que perdemos tempo. Vale a pena conferir.

Link: Wait Less

Vídeo background with AS3

June 20th, 2008

No blog do Noponies, um dos melhores resources de Flash e Actionscript 3 que conheço, tem um sample muito legal de video no background, assim como era o site antigo do Group94. O único problema é que o source vai ser “Donation Ware”, ou seja, Give me a coffe. Mas com certeza vale a pena, eu ja estou pensando seriamente em passar uns US$ para o infeliz para ter esse source comigo ehehe. Muito bom. abaixo link e preview do danado.

Link: http://www.blog.noponies.com/archives/85

Adobe Flash Player 10

May 15th, 2008

Imagens, videos, aplicativos muito mais smoother que o normal (até hoje), grande suporte a 3D, filtros customizaveis assim como é hoje no After Effects e muito mais coisas fazem parte das novidades que chegaram na versão BETA do novo Flash Player 10 que já está disponível para download no site do Adobe Labs.

Link para download: Windows ou Mac ou se preferir acesse a página de download.

Adobe TV

April 11th, 2008

Já faz alguns dias que foi para o ar o Adobe TV – não estive com muito tempo para postar aqui devido uns trabalhos pendentes – é um site semelhante ao de tutoriais do Adobe DevNet, so que com uma navegabilidade muito mais intuitiva e parecida com a web convencional que o anterior. Essa Tv traz novidades e treinamento das ferramentas da Adobe, sendo dividido em canais como Fotografia, Design, Vídeo e outros.

O uso da banda é bem controlado, com 1Mb por segundo – download equivalente a 100kbps – se consegue ver os video em boa qualidade e sem pausas. Vale a pena dar uma bela olhada, o link segue abaixo.

Link: Adobe TV

WordPress 2.5 released

March 30th, 2008

Depois de alguns meses do WordPress estar na versão 2.5 Beta somente para alguns usuários em desenvolvimento, agora é oficial: WordPress 2.5 aberto ao público e geral – viva. Esta disponível tanto para download quanto para usuários com blog hospedado no domínio do próprio WordPress, com novidades como Media Gallery, área administrativa totalmente renovada e muito mais.

Link: WordPress

Um video feito no Flash on the Beach sobre o Flash CS4, codename Diesel, mostra como deverá funcionar a ferramenta tween dentro da nova versão do Flash do Creative Suite 4.

Link do post original: Flash CS4 Tween Engine Demonstrated