"Rene Frederiksen" <rof@stofanetfjerndette.dk> skrev i en meddelelse
news:46269801$0$4158$ba624c82@nntp02.dk.telia.net...
> Hej.
> Min datter leder efter noget til at lave hjemmesider med.
> Men hun vil gerne have nogle sider der virker lige som en bog...Altså
> "krøller" hjørnerne op og blader en side.
>
> Kender i et sådan program?
>
> // Rene
Hej Rene.
Du kan bruge Adobe Flash, men der er flere ting i det,
først skal du lære Flash programmet at kende, det gør du måske?
samt de script du skal bruge til det du vil lave, altså en bog
Her er et script til en bog 2 sider.
***********************************************************
function curlPage() {
// This function curls the bottom
// left hand corner of the rightmost page.
line._x += (PAGE_CURL-line._x)/TURN_RATE;
movePages();
if ((line._x-PAGE_CURL)<1) {
delete this.onEnterFrame;
}
}
function pageTurn() {
// This function performs the page turning
// animation that occurs when the user is
// dragging the page.
var oldMousePos = _xmouse;
line.onMouseMove = function() {
line._x += _xmouse-oldMousePos;
oldMousePos = _xmouse;
if (line._x>PAGE_CURL) {
line._x = PAGE_CURL;
} else if (line._x<PAGE_SPINE) {
line._x = PAGE_SPINE;
}
movePages();
updateAfterEvent();
};
}
function movePages() {
backPage._x = line._x;
backPage.back._x = -(PAGE_EDGE-line._x);
backPage._rotation = 90*(line._x-PAGE_SPINE)/page._width;
line._rotation = 45*(line._x-PAGE_SPINE)/page._width;
}
function pageRelease() {
// This function runs when the user
// lets go of the page. It decides
// on whether the page should be opened
// or closed depending on where in the
// page turn the page was released, and
// uses either openPage() or closePage()
// to open/close the page respectively.
delete line.onMouseMove;
if (line._x<HALF_PAGE_TURN) {
turnInterval = setInterval(openPage, 10);
} else {
turnInterval = setInterval(closePage, 10);
}
}
function openPage() {
// This function opens the page (i.e. turns
// the current page to the left) if the user
// lets go of the page when it is almost open.
line._x += (PAGE_SPINE-line._x)/TURN_RATE;
if ((line._x-PAGE_SPINE)<1) {
line._x = PAGE_SPINE;
clearInterval(turnInterval);
}
movePages();
updateAfterEvent();
}
function closePage() {
// This function closes the page (i.e. turns
// the current page to the right) if the user
// lets go of the page when it is almost closed.
line._x += (PAGE_CURL-line._x)/TURN_RATE;
if ((PAGE_CURL-line._x)<1) {
line._x = PAGE_CURL;
clearInterval(turnInterval);
}
movePages();
updateAfterEvent();
}
// Set up constants
var PAGE_SPINE = page._x;
var PAGE_EDGE = page._x+page._width;
var PAGE_CURL = PAGE_EDGE-20;
var HALF_PAGE_TURN = PAGE_SPINE+(PAGE_EDGE-PAGE_SPINE)/3;
var TURN_RATE = 3;
//
// Set up variables
var lineAngle = 45;
var pageNumber = 1;
var turnInterval = 0;
//
// Set up position objects for the
// parts of the book that will be
// attached to the stage dynamically
var pagePos = {_x:page._x, _y:page._y};
var backPos = {_x:PAGE_EDGE, _y:page._y+page._height, _rotation:90};
var linePos = {_x:PAGE_EDGE, _y:page._y+page._height, _rotation:lineAngle};
var hideShadowPos = {_x:PAGE_EDGE, _y:page._y};
//
// Attach the book parts
var topPage = this.attachMovie("topPage", "topPage", 0, pagePos);
var bottomPage = this.attachMovie("bottomPage", "bottomPage", 1, pagePos);
var backPage = this.attachMovie("backPage", "backPage", 2, backPos);
var line = this.attachMovie("line", "line", 3, linePos);
var hideShadow = this.attachMovie("hideShadow", "hideShadow", 1000,
hideShadowPos);
//
// Set up the interaction events
// (NB - the 'turn page' button is
// the back of the turning page).
backPage.onPress = pageTurn;
backPage.onRelease = pageRelease;
backPage.onReleaseOutside = pageRelease;
//
// Define the masks.
line.pageShadow.setMask(backPage.back.shadowMask);
bottomPage.setMask(line.rightMask);
backPage.setMask(line.leftMask);
//
// Create the initial curled page.
line.onEnterFrame = curlPage;
************************************************************
God fornøjelse, giv aldrig op.
|