22/11/2007, 03:24
|
| | | Fecha de Ingreso: noviembre-2006 Ubicación: Madrid (España)
Mensajes: 266
Antigüedad: 18 años Puntos: 0 | |
Re: mover fotogramas clave en la linea de tiempo Éste es el código que se utiliza en el clip de película FFlipPage,(Creo que es lo que da la sombra al centro del libro)
Código:
#initclip 1
if (FFlipPage.version < 3.0) {
with (Component("FFlipPage")) {
version = 3.0;
buildDate = "2003.9.8";
copyright = "Fictiony Chen, 2003-2006, [email protected]";
//PARAMETERS
parameter.pageWidth = 120; //the width of the page
parameter.pageHeight = 160; //the height of the page
parameter.pageId = ""; //the linkage id of the page content movie clip
parameter.adjustEvenPage = true; //if adjust even page's content position
parameter.autoPage = true; //automatically go to the definite frame when the page movie clip is created
parameter.firstPage = 0; //first page's index (even pages are on the left, odd pages are on the right)
parameter.lastPage = 1; //last page's index
parameter.curPage = 0; //index of the current page
parameter.visiblePages = 1; //max count of the visible pages on one side
parameter.showRearPage = false; //if the rear page is shown (used in transparent pages)
parameter.shade = {show:true, color:0x000000, sizeMin:10, sizeMax:30, alphaMin:60, alphaMax:50};
//the settings of the boundary shade, id is the linkage id of the shade movie
//clip, min and max are (in percentage of the page width) its size range
parameter.pageShadow = {show:true, color:0x000000, sizeMin:20, sizeMax:120, alphaMin:60, alphaMax:80};
//the settings of the page shadow
parameter.flipArea = {leftTop:true, rightTop:true, leftBottom:true, rightBottom:true,
leftTopInner:true, rightTopInner:true, leftBottomInner:true, rightBottomInner:true};
//the button areas that can respond to the flip action
parameter.flipSize = {width:40, height:30, innerWidth:80, innerHeight:50};
//the size (in percentage of the page width) of the flip areas
parameter.dragAccRatio = 0.5; //the dragging accelerate ratio (0~1)
parameter.moveAccRatio = 0.2; //the moving accelerate ratio (0~1)
parameter.multiFlip = false; //if multiple flipping is allowed
parameter.active = true; //if the pages can response to mouse actions
//EVENTS
event.onCreatePage = ""; //function(pageMC, isRear), handled after a page movie clip is created
event.onRemovePage = ""; //function(pageMC, isRear), handled before a page movie clip is removed
event.onAdjustPage = ""; //function(pageObj, range), handled when a page is adjusted
event.onResizePage = ""; //function(pageObj, width,height), handled when a page is resized
event.onSetFlipArea = ""; //function(pageObj), handled when a page's flip areas are set
event.onStartFlip = ""; //function(pageObj), handled when a page starts to flip
event.onStopFlip = ""; //function(pageObj), handled when a page stops flipping
event.onFinishFlip = ""; //function(pageObj), handled when a page finishes slipping
event.onDragPage = ""; //function(pageObj, x, y, trackMouse), handled when a page is dragging
event.onMovePage = ""; //function(pageObj, x, y), handled when a page is moving
//PRIVATE PROPERTIES
private._pageWidth = 0; //pageWidth
private._pageHeight = 0; //pageHeight
private._pageId = ""; //pageId
private._adjustEvenPage = true; //adjustEvenPage
private._autoPage = true; //autoPage
private._firstPage = 0; //firstPage
private._lastPage = 0; //lastPage
private._curPage = 0; //curPage
private._visiblePages = 1; //visiblePages
private._showRearPage = false; //showRearPage
private._shade = {show:true, color:0x000000, sizeMin:10, sizeMax:30, alphaMin:60, alphaMax:50};
//shade
private._pageShadow = {show:true, color:0x000000, sizeMin:20, sizeMax:120, alphaMin:60, alphaMax:80};
//pageShadow
private._flipArea = {leftTop:true, rightTop:true, leftBottom:true, rightBottom:true,
leftTopInner:true, rightTopInner:true, leftBottomInner:true, rightBottomInner:true};
//flipArea
private._flipSize = {width:40, height:30, innerWidth:80, innerHeight:50};
//flipAreaSize
private._dragAccRatio = 0; //dragAccRatio
private._moveAccRatio = 0; //moveAccRatio
private._multiFlip = false; //multiFlip
private._active = true; //active
private._pages = {}; //list of the visible page objects
private._flipPages = {}; //list of the flipped page objects
private._flipCount = 0; //count of the flipped pages (<0 means the flipped pages are on the left)
private._topPageDepth = 10000; //depth of the topmost static page
private._shadowDepth = 10; //depth of the page shadow movie clip
private._shadowMaskDepth = 20; //depth of the shadow mask movie clip
private._faceDepth = 30; //depth of the page face movie clip
private._pageMaskDepth = 40; //depth of the page mask movie clip
private._rearPageDepth = 20; //depth of the rear page movie clip
private._pageDepth = 30; //depth of the page content movie clip
private._shadeDepth = 40; //depth of the shade movie clip
private._flipAreaDepth = 10; //depth of the flip area movie clip
private._pretreating = true; //if it is pretreating
//PUBLIC PROPERTIES
public.posPrecision = 0.5; //the position precision
//PRIVATE METHODS
//pretreating
private.onPretreat = function (para) {
if (para.pageWidth == null) para.pageWidth = this._xscale * 1.2;
if (para.pageHeight == null) para.pageHeight = this._yscale * 1.6;
this._xscale = 100;
this._yscale = 100;
};
//initialization
private.onInit = function () {
this._pretreating = false;
this.gotoPage(this._curPage, true);
};
//create a page movie clip and its rear page movie clip
private._createPageMC = function (page) {
if (page.page != null) {
this.handleEvent("onRemovePage", page.page);
page.page.removeMovieClip();
}
page.page = this._pageId == "" ? page.face.createEmptyMovieClip("PageMC", this._pageDepth)
: page.face.attachMovie(this._pageId, "PageMC", this._pageDepth);
page.page.index = page.index;
page.page._x = !this._adjustEvenPage ? this._pageWidth * -page.side : page.side<0 ? 0 : -this._pageWidth;
if (this._autoPage) page.page.gotoAndStop(page.index - this._firstPage + 1);
this.handleEvent("onCreatePage", page.page);
if (this._showRearPage) {
if (page.rearPage != null) this.handleEvent("onRemovePage", page.rearPage, true);
var index = page.index + page.side;
if (index < this._firstPage || index > this._lastPage) return;
page.rearPage = this._pageId == "" ? page.face.createEmptyMovieClip("RearPageMC", this._rearPageDepth)
: page.face.attachMovie(this._pageId, "RearPageMC", this._rearPageDepth);
page.rearPage.index = index;
page.rearPage._xscale = -100;
page.rearPage._x = !this._adjustEvenPage ? page.page._x : page.side<0 ? this._pageWidth : 0;
if (this._autoPage) page.rearPage.gotoAndStop(index - this._firstPage + 1);
this.handleEvent("onCreatePage", page.rearPage, true);
}
};
//create a page object
private._createPage = function (index, depth, position) {
if (index < this._firstPage || index > this._lastPage) return;
var page = this.createEmptyMovieClip("Page" + index, depth);
page.main = this;
page.index = index;
page.side = index % 2 == 0 ? -1 : 1;
page.face = page.createEmptyMovieClip("FaceMC", this._faceDepth);
page.pageMask = page.createEmptyMovieClip("PageMaskMC", this._pageMaskDepth);
page.pageMask._xscale = -page.side * 100;
page.face.setMask(page.pageMask);
this._createPageMC(page);
if (this._shade.show) {
page.shade = page.face.attachMovie("PageShade", "ShadeMC", this._shadeDepth);
(new Color(page.shade)).setRGB(this._shade.color);
}
if (this._pageShadow.show) {
page.shadow = page.attachMovie("PageShade", "ShadowMC", this._shadowDepth);
(new Color(page.shadow)).setRGB(this._pageShadow.color);
page.shadowMask = page.createEmptyMovieClip("ShadowMask", this._shadowMaskDepth);
page.shadowMask._xscale = -page.side * 100;
page.shadow.setMask(page.shadowMask);
}
page.position = position;
this._adjustPage(page);
this._setFlipArea(page);
this._pages[index] = page;
return page;
};
sigue:
__________________ -- Cuando sientas miedo y no tengas un hombro dónde apoyarte, no te hundas en la soledad, pues si lo haces fracasarás -- |