|
||||||||||||||||
. . . . . |
Flash MX - Simulate a Video Editor
This tutorial was inspired by Dyno who wanted help to emulate Brendan Dawes'
Flash Emulation of
the Shower Scene from Psycho editing exercise.
Have a look at mine here.. Make the Video Clips
I made all my video clips 2 seconds long. I settled on a frame rate of 5 frames per second. That was good enough
to show some basic movement and would keep the filesize down. In Adobe Premiere, bring a 2 second length of video to the
timeline and Export timeline as frames. I made the video size 176 X 144. And exported at 5 fps.
Flash Tutorials in Video Format -
Watch them now at LearnFlash.com Import the Video Clips into Flash
My technique was to create a movie clip first, call it "vid01" and then click File - Import. stop();Make the rest of the movieclips and name them vid02, vid03 , vid04, vid05. In the linkages window for each of these movieclips , tick the "Export for Actionscript" and name them vid1,vid2,vid3,vide4,vid5. Making the draggable Clip Icons
We have to make 5 draggable movieclips to represent each Video clip.
Make the Preview Windows
The Timeline
Preview and Play Buttons
Coding the Drag and Drop
Main Script - frame 1, code layer
Here is the code for frame 1, "code" layer.
stop();
// declare icon start points
var b1startx, b1starty;
var b2startx, b2starty;
var b3startx, b3starty;
var b4startx, b4starty;
var b5startx, b5starty;
//initialise clip variables for playback
var clip1 = "";
var clip2 = "";
var clip3 = "";
var clip4 = "";
var clip5 = "";
// initialise buttons and timeline mcs
_root.onLoad = function() {
// set start pts for buttons
b1startx = _root.but1_mc._x;
b1starty = _root.but1_mc._y;
b2startx = _root.but2_mc._x;
b2starty = _root.but2_mc._y;
b3startx = _root.but3_mc._x;
b3starty = _root.but3_mc._y;
b4startx = _root.but4_mc._x;
b4starty = _root.but4_mc._y;
b5startx = _root.but5_mc._x;
b5starty = _root.but5_mc._y;
// attach drop zones to time line
_root.line1.attachMovie("dropzone", "dropzone", 100);
_root.line1.dropzone._alpha = 0;
_root.line2.attachMovie("dropzone", "dropzone2", 100);
_root.line2.dropzone2._alpha = 0;
_root.line3.attachMovie("dropzone", "dropzone3", 100);
_root.line3.dropzone3._alpha = 0;
_root.line4.attachMovie("dropzone", "dropzone4", 100);
_root.line4.dropzone4._alpha = 0;
_root.line5.attachMovie("dropzone", "dropzone5", 100);
_root.line5.dropzone5._alpha = 0;
};
// button 1 and preview
//
_root.but1_mc.onPress = function() {
startDrag(this);
};
_root.but1_mc.onRelease = function() {
this.stopDrag();
// drop on the preview window
if (this._droptarget == "/view" || this._droptarget == "/view/view_mc") {
// send button back to start
_root.but1_mc._x = b1startx;
_root.but1_mc._y = b1starty;
// attach movie to preview window
_root.view.attachMovie("vid1", "view_mc", 2);
_root.view.view_mc.gotoAndStop(1);
} else {
_root.but1_mc._x = b1startx;
_root.but1_mc._y = b1starty;
}
// drop on the timeline
if (eval(this._droptarget) == _root.line1.dropzone) {
clip1 = "vid1";
_root.but1_mc._x = _root.line1._x;
_root.but1_mc._y = _root.line1._y;
}
if (eval(this._droptarget) == _root.line2.dropzone2) {
clip2 = "vid1";
_root.but1_mc._x = _root.line2._x;
_root.but1_mc._y = _root.line2._y;
}
if (eval(this._droptarget) == _root.line3.dropzone3) {
clip3 = "vid1";
_root.but1_mc._x = _root.line3._x;
_root.but1_mc._y = _root.line3._y;
}
if (eval(this._droptarget) == _root.line4.dropzone4) {
clip4 = "vid1";
_root.but1_mc._x = _root.line4._x;
_root.but1_mc._y = _root.line4._y;
}
if (eval(this._droptarget) == _root.line5.dropzone5) {
clip5 = "vid1";
_root.but1_mc._x = _root.line5._x;
_root.but1_mc._y = _root.line5._y;
}
};
// button 2 and preview
//
_root.but2_mc.onPress = function() {
startDrag(this);
};
_root.but2_mc.onRelease = function() {
this.stopDrag();
if(this._droptarget == "/view"
|| this._droptarget == "/view/view_mc") {
// send button back to start
_root.but2_mc._x = b2startx;
_root.but2_mc._y = b2starty;
// attach movie to preview window
_root.view.attachMovie("vid2", "view_mc", 2);
_root.view.view_mc.gotoAndStop(1);
} else {
_root.but2_mc._x = b2startx;
_root.but2_mc._y = b2starty;
}
if (eval(this._droptarget) == _root.line1.dropzone) {
clip1 = "vid2";
_root.but2_mc._x = _root.line1._x;
_root.but2_mc._y = _root.line1._y;
}
if (eval(this._droptarget) == _root.line2.dropzone2) {
clip2 = "vid2";
_root.but2_mc._x = _root.line2._x;
_root.but2_mc._y = _root.line2._y;
}
if (eval(this._droptarget) == _root.line3.dropzone3) {
clip3 = "vid2";
_root.but2_mc._x = _root.line3._x;
_root.but2_mc._y = _root.line3._y;
}
if (eval(this._droptarget) == _root.line4.dropzone4) {
clip4 = "vid2";
_root.but2_mc._x = _root.line4._x;
_root.but2_mc._y = _root.line4._y;
}
if (eval(this._droptarget) == _root.line5.dropzone5) {
clip5 = "vid2";
_root.but2_mc._x = _root.line5._x;
_root.but2_mc._y = _root.line5._y;
}
};
// button 3 and preview
//
_root.but3_mc.onPress = function() {
startDrag(this);
};
_root.but3_mc.onRelease = function() {
this.stopDrag();
if (this._droptarget == "/view"
|| this._droptarget == "/view/view_mc") {
// send button back to start
_root.but3_mc._x = b3startx;
_root.but3_mc._y = b3starty;
// attach movie to preview window
_root.view.attachMovie("vid3", "view_mc", 2);
_root.view.view_mc.gotoAndStop(1);
} else {
_root.but3_mc._x = b3startx;
_root.but3_mc._y = b3starty;
}
if (eval(this._droptarget) == _root.line1.dropzone) {
clip1 = "vid3";
_root.but3_mc._x = _root.line1._x;
_root.but3_mc._y = _root.line1._y;
}
if (eval(this._droptarget) == _root.line2.dropzone2) {
clip2 = "vid3";
_root.but3_mc._x = _root.line2._x;
_root.but3_mc._y = _root.line2._y;
}
if (eval(this._droptarget) == _root.line3.dropzone3) {
clip3 = "vid3";
_root.but3_mc._x = _root.line3._x;
_root.but3_mc._y = _root.line3._y;
}
if (eval(this._droptarget) == _root.line4.dropzone4) {
clip4 = "vid3";
_root.but3_mc._x = _root.line4._x;
_root.but3_mc._y = _root.line4._y;
}
if (eval(this._droptarget) == _root.line5.dropzone5) {
clip5 = "vid3";
_root.but3_mc._x = _root.line5._x;
_root.but3_mc._y = _root.line5._y;
}
};
// button 4 and preview
//
_root.but4_mc.onPress = function() {
startDrag(this);
};
_root.but4_mc.onRelease = function() {
this.stopDrag();
if (this._droptarget == "/view"
|| this._droptarget == "/view/view_mc") {
// send button back to start
_root.but4_mc._x = b4startx;
_root.but4_mc._y = b4starty;
// attach movie to preview window
_root.view.attachMovie("vid4", "view_mc", 2);
_root.view.view_mc.gotoAndStop(1);
} else {
_root.but4_mc._x = b4startx;
_root.but4_mc._y = b4starty;
}
if (eval(this._droptarget) == _root.line1.dropzone) {
clip1 = "vid4";
_root.but4_mc._x = _root.line1._x;
_root.but4_mc._y = _root.line1._y;
}
if (eval(this._droptarget) == _root.line2.dropzone2) {
clip2 = "vid4";
_root.but4_mc._x = _root.line2._x;
_root.but4_mc._y = _root.line2._y;
}
if (eval(this._droptarget) == _root.line3.dropzone3) {
clip3 = "vid4";
_root.but4_mc._x = _root.line3._x;
_root.but4_mc._y = _root.line3._y;
}
if (eval(this._droptarget) == _root.line4.dropzone4) {
clip4 = "vid4";
_root.but4_mc._x = _root.line4._x;
_root.but4_mc._y = _root.line4._y;
}
if (eval(this._droptarget) == _root.line5.dropzone5) {
clip5 = "vid4";
_root.but4_mc._x = _root.line5._x;
_root.but4_mc._y = _root.line5._y;
}
};
// button 5
//
_root.but5_mc.onPress = function() {
startDrag(this);
};
_root.but5_mc.onRelease = function() {
this.stopDrag();
if (this._droptarget == "/view"
|| this._droptarget == "/view/view_mc") {
// send button back to start
_root.but5_mc._x = b5startx;
_root.but5_mc._y = b5starty;
// attach movie to preview window
_root.view.attachMovie("vid5", "view_mc", 2);
_root.view.view_mc.gotoAndStop(1);
} else {
_root.but5_mc._x = b5startx;
_root.but5_mc._y = b5starty;
}
if (eval(this._droptarget) == _root.line1.dropzone) {
clip1 = "vid5";
_root.but5_mc._x = _root.line1._x;
_root.but5_mc._y = _root.line1._y;
}
if (eval(this._droptarget) == _root.line2.dropzone2) {
clip2 = "vid5";
_root.but5_mc._x = _root.line2._x;
_root.but5_mc._y = _root.line2._y;
}
if (eval(this._droptarget) == _root.line3.dropzone3) {
clip3 = "vid5";
_root.but5_mc._x = _root.line3._x;
_root.but5_mc._y = _root.line3._y;
}
if (eval(this._droptarget) == _root.line4.dropzone4) {
clip4 = "vid5";
_root.but5_mc._x = _root.line4._x;
_root.but4_mc._y = _root.line4._y;
}
if (eval(this._droptarget) == _root.line5.dropzone5) {
clip5 = "vid5";
_root.but5_mc._x = _root.line5._x;
_root.but5_mc._y = _root.line5._y;
}
};
// ----- PLAY & PREVIEW BUTTONS
//
_root.pre_btn.onRelease = function() {
_root.view.view_mc.play();
};
_root.play_btn.onRelease = function() {
_root.gotoAndPlay(2);
};
There. That is the main part of it. You can make it more beautiful if you like and add some instructions. Make the Preview windows real high-tech and space age. Make it look like a futuristic interface. Or whatever you like. The code probably could be massively simplified. I will leave that up to you. |
|
||||||||||||||
|
| Home | Flash MX | Actionscript 2.0 | Flash 3D | Flash 8 | Flash Database | Flash Mobile | Flash CS3 | Java For Kids | Video Course | General Video | Photoshop | Web Design | Digital Photography | Forum | Games | free backgrounds | Resume | Flash Animations | Streaming Video | Students Work | Links | Contact me | sitemap | reviews | store | advertisers | . . |
||||||||||||||||