Script.it .Nam Myoho Renghe Kyo.

Script.it
[AS3.0] VideoScrubber Tutorial

Alot of people have been asking about the videoscrubber class (demo with video). Most of the questions where about how to get the darn thing to work correctly. Well….. after the last mail from Sven ( hi Sven..hehe ) i realized i had to do a very simple lilttle demo / tutorial on how to get videoscrubber to work. Just so that people would understand the how and what. So here it is.

@update: download full demoSource here!



Step 1:
Copy / Paste the videoscrubber source in a class, name it VideoScrubber.as and put it in a folder.

Step 2:
Make a Main.as and put it in the same folder.

?View Code ACTIONSCRIPT
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
package 
{
	import flash.display.Sprite;
	import flash.events.Event;
 
	/**
	 * ...
	 * @author Rackdoll
	 * @link   http://blog.rackdoll.nl
	 */
	public class Main extends Sprite 
	{
 
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
 
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
 
 
		}		
	}	
}

Step 3:
Make a new .fla file and put it in the same folder as you Main.as and you VideoScrubber.as

Step 4:
Create a new MovieClip with a timeline animation in it.
Give the moveclip a name.

Step 5:
Make Main.as the document class of the .fla you just created.

Step 6:
Make a new instance of the VideoScrubber class ( in the init() function of Main.as) and pass it the stage and the name of the MovieClip which have just created.

?View Code ACTIONSCRIPT
1
var vs:VideoScrubber = new VideoScrubber( this.stage, myClip );

Step 7:
Compile the .fla to a .swf.

Step 8:
Test drag and throw.

Result:

This movie requires Flash Player 9




To work with video:
Just import your video into flash. Put the (key)frames on the timeline, just like in your movieclip with timeline animation you did earlier. Put your new movieclip, with video embedded on the timeline, on the stage and give it a name. Now pass that name in the videoScrubber instance next to the stage and Voila. You are ready to rock the world with awesomesauce videoscrubbing \o/

Have fun!
Rackdoll.
:)

Creative Commons License
[AS3.0] VideoScrubber Tutorial by Script.it, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Netherlands License.

Comments are closed.

Categories
Archives
Live Supporters