DevelopPHP
home gear home donate
Search Results For
in:

Libraries book

HTML Library CSS Library JavaScript Library PHP Library

Videosbook

PHP and MySQL JavaScript HTML and CSS Vector and 3D Flash Actionscript Android Dev Miscellaneous

Resourcesbook

Website Hosting Developer Q+A

Download Source Files

<iframe width="560" height="315" src="http://www.youtube.com/embed/05TgFxh97Yg" frameborder="0" allowfullscreen></iframe>
You can embed this video on your blog or web page by copying the video embed code above and pasting it into the source code of your page. Adjust the width and height to specify the size you would like it to display.
Thumb Tweening Image Panels under a Mask
Embed Source - http://www.youtube.com/watch?v=05TgFxh97Yg
Publish Date - May 14, 2008     Author - Adam Khoury
Tweening Image Panels under a Mask
In this Flash AS3 tutorial you learn how to use the ease effect for making things glide and slide. There is also a nice example of animated movieclip buttons.
Lesson Code

import fl.transitions.*;
import fl.transitions.easing.*;
// INITIALIZE START POSITIONS FOR BOTH OF OUR MOVIECLIPS(THESE CHANGE BELOW)
var markerStart:Number = pageMarker_mc.y;
var bodyStart:Number = body_mc.y;
// INITIALIZE THE STOP VARIABLES FOR LATER USE(THESE CHANGE BELOW)
var markerStop:Number = 0;
var bodyStop:Number = 0;
// SET UNCHANGING DURATION SPEEDS FOR THE EASE PROPERTY OF BOTH MOVIECLIPS
var duration:Number = .5;
var duration2:Number = 1.2;

stop();

////////////////////////////////////////////////////////////////////////// BUTTON 1 //////////////////////////////////////////////////////////////////////////////
function btn1Down(event:MouseEvent):void {
// SET [BODYSTART] POSITION ON BUTTON DOWN (WHERE IT IS CURRENTLY)
bodyStart = body_mc.y;
// SET [BODYSTOP] POSITION ON BUTTON DOWN(WHERE YOU WANT IT TO WIND UP)
bodyStop = 96;
var btn1body:Tween = new Tween(body_mc, "y", Strong.easeInOut, bodyStart, bodyStop, duration2, true);
}
//////////
function btn1Over(event:MouseEvent):void {
// PLAY THE [OVER] LABEL SET INSIDE THE MOVIECLIP NAMED [BTN1]
btn1.gotoAndPlay("over");
// SET [MARKERSTART] POSITION ON BUTTON DOWN (WHERE IT IS CURRENTLY)
markerStart = pageMarker_mc.y;
// SET [MARKERSTOP] POSITION ON BUTTON DOWN(WHERE YOU WANT IT TO WIND UP)
markerStop = 107;
///////////////////////////////////////////////TWEEN(MOVIECLIP, "AXIS", HOWEASE.EASETYPE, STARTPOSITION, ENDPOSITION, SPEED, BOOLEAN);
var btn1Marker:Tween = new Tween(pageMarker_mc, "y", Back.easeInOut, markerStart, markerStop, duration, true);
}
/////////
function btn1Out(event:MouseEvent):void {
// PLAY THE [OUT] LABEL SET INSIDE THE MOVIECLIP NAMED [BTN1]
btn1.gotoAndPlay("out");
}
///////// SET LISTENERS FOR BUTTONS
btn1.addEventListener(MouseEvent.ROLL_OVER, btn1Over);
btn1.addEventListener(MouseEvent.ROLL_OUT, btn1Out);
btn1.addEventListener(MouseEvent.CLICK, btn1Down);
//////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////// BUTTON 2 //////////////////////////////////////////////////////////////////////////////
function btn2Down(event:MouseEvent):void {
bodyStart = body_mc.y;
bodyStop = -114;
var btn2body:Tween = new Tween(body_mc, "y", Strong.easeInOut, bodyStart, bodyStop, duration2, true);
}
//////////
function btn2Over(event:MouseEvent):void {
btn2.gotoAndPlay("over");
markerStart = pageMarker_mc.y;
markerStop = 150;
var btn2Marker:Tween = new Tween(pageMarker_mc, "y", Back.easeInOut, markerStart, markerStop, duration, true);
}
/////////
function btn2Out(event:MouseEvent):void {
btn2.gotoAndPlay("out");
}
/////////
btn2.addEventListener(MouseEvent.ROLL_OVER, btn2Over);
btn2.addEventListener(MouseEvent.ROLL_OUT, btn2Out);
btn2.addEventListener(MouseEvent.CLICK, btn2Down);
//////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////// BUTTON 3 //////////////////////////////////////////////////////////////////////////////
function btn3Down(event:MouseEvent):void {
bodyStart = body_mc.y;
bodyStop = -320;
var btn3body:Tween = new Tween(body_mc, "y", Strong.easeInOut, bodyStart, bodyStop, duration2, true);
}
//////////
function btn3Over(event:MouseEvent):void {
btn3.gotoAndPlay("over");
markerStart = pageMarker_mc.y;
markerStop = 193;
var btn3Marker:Tween = new Tween(pageMarker_mc, "y", Back.easeInOut, markerStart, markerStop, duration, true);
}
/////////
function btn3Out(event:MouseEvent):void {
btn3.gotoAndPlay("out");
}
/////////
btn3.addEventListener(MouseEvent.ROLL_OVER, btn3Over);
btn3.addEventListener(MouseEvent.ROLL_OUT, btn3Out);
btn3.addEventListener(MouseEvent.CLICK, btn3Down);
//////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////// BUTTON 4 //////////////////////////////////////////////////////////////////////////////
function btn4Down(event:MouseEvent):void {
bodyStart = body_mc.y;
bodyStop = -532;
var btn4body:Tween = new Tween(body_mc, "y", Strong.easeInOut, bodyStart, bodyStop, duration2, true);
}
//////////
function btn4Over(event:MouseEvent):void {
btn4.gotoAndPlay("over");
markerStart = pageMarker_mc.y;
markerStop = 239;
var btn4Marker:Tween = new Tween(pageMarker_mc, "y", Back.easeInOut, markerStart, markerStop, duration, true);
}
/////////
function btn4Out(event:MouseEvent):void {
btn4.gotoAndPlay("out");
}
/////////
btn4.addEventListener(MouseEvent.ROLL_OVER, btn4Over);
btn4.addEventListener(MouseEvent.ROLL_OUT, btn4Out);
btn4.addEventListener(MouseEvent.CLICK, btn4Down);
//////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////// BUTTON 5 //////////////////////////////////////////////////////////////////////////////
function btn5Down(event:MouseEvent):void {
bodyStart = body_mc.y;
bodyStop = -742;
var btn5body:Tween = new Tween(body_mc, "y", Strong.easeInOut, bodyStart, bodyStop, duration2, true);
}
//////////
function btn5Over(event:MouseEvent):void {
btn5.gotoAndPlay("over");
markerStart = pageMarker_mc.y;
markerStop = 282;
var btn5Marker:Tween = new Tween(pageMarker_mc, "y", Back.easeInOut, markerStart, markerStop, duration, true);
}
/////////
function btn5Out(event:MouseEvent):void {
btn5.gotoAndPlay("out");
}
/////////
btn5.addEventListener(MouseEvent.ROLL_OVER, btn5Over);
btn5.addEventListener(MouseEvent.ROLL_OUT, btn5Out);
btn5.addEventListener(MouseEvent.CLICK, btn5Down);
//////////////////////////////////////////////////////////////////////////////////////////////////


Home   •   Terms of Use   •   T-Shirts   •   RSS   •   Testimonials   •   Subscribe   •   Classroom Chalkboard   •   Developer Q+A   •   Donate   •   Top ↑
Popular In PHP / MySQL E-Commerce Store Production
Social Network Website Building
Image Upload / Photo Processing
CMS Software Programming
Mass Email Systems
Magic XML Data
Search Programming
Popular In JavaScript JSON Programming
Ajax Programming
Animating Elements
WYSIWYG Programming
Date/Time Programming
DOM Scripting
Object Reference
Popular In HTML Canvas Element
New Form Elements
Audio Element
Video Element
Drag and Drop
Event Handling
Element Grouping
Popular In CSS Custom Font Embedding
Dynamic Fit Backgrounds
Theatre Mode
Box Overlays
CSS Level 1 Properties
CSS Level 2 Properties
CSS Level 3 Properties
DevelopPHP.com is a growing educational system packed with video and written material that you can access 24/7 100% free. The focus here in 2013 is spread between five technologies: HTML, CSS, JavaScript, PHP and MySQL. Learn programming theory, database interaction, web design, animation, graphics editing, vector art, 3D modeling, and much more. The educational experience here is a hybrid one offering both high quality video tutorials and code libraries that grow more robust every day. The code libraries are being assembled so that developers can discover all of the building blocks of their favorite languages. The libraries coupled with high quality video tutorials will take you deep down the rabbit hole very quickly. You can also ask questions and get free advice at WebIntersect.com.
©2014 DevelopPHP.com HTML5