Difference between revisions of "SWF e-book.as"
m |
m |
||
| Line 1: | Line 1: | ||
margin = 20; | margin = 20; | ||
| + | // bg defines the hitArea which raises mouse events | ||
| + | // - this is used so that the book symbol doesn't need to have a filled background | ||
createEmptyMovieClip("bg",1); | createEmptyMovieClip("bg",1); | ||
bg._visible = false; | bg._visible = false; | ||
| Line 11: | Line 13: | ||
bg.endFill(); | bg.endFill(); | ||
| + | // This initialises the book page lines | ||
createEmptyMovieClip("book",2); | createEmptyMovieClip("book",2); | ||
book.hitArea = bg; | book.hitArea = bg; | ||
| Line 22: | Line 25: | ||
book.lineTo(width/2,height-margin); | book.lineTo(width/2,height-margin); | ||
| + | // Draws page lines and folde line based on mouse position | ||
book.onDragOver = function() { | book.onDragOver = function() { | ||
| − | + | clear(); | |
| − | + | lineStyle(3,0); | |
| − | + | moveTo(margin,margin); | |
| − | + | lineTo(width-margin,margin); | |
| − | + | lineTo(width-margin,height-margin); | |
| − | + | lineTo(margin,height-margin); | |
| − | + | lineTo(margin,margin); | |
| − | + | moveTo(width/2,margin); | |
| − | + | lineTo(width/2,height-margin); | |
| − | + | moveTo(_xmouse,_ymouse); | |
| − | + | lineTo(width-margin,margin); | |
}; | }; | ||
Revision as of 06:00, 21 November 2006
margin = 20;
// bg defines the hitArea which raises mouse events // - this is used so that the book symbol doesn't need to have a filled background createEmptyMovieClip("bg",1); bg._visible = false; bg.beginFill(0,100); bg.moveTo(margin,margin); bg.lineTo(width-margin,margin); bg.lineTo(width-margin,height-margin); bg.lineTo(margin,height-margin); bg.lineTo(margin,margin); bg.endFill();
// This initialises the book page lines createEmptyMovieClip("book",2); book.hitArea = bg; book.lineStyle(3,0); book.moveTo(margin,margin); book.lineTo(width-margin,margin); book.lineTo(width-margin,height-margin); book.lineTo(margin,height-margin); book.lineTo(margin,margin); book.moveTo(width/2,margin); book.lineTo(width/2,height-margin);
// Draws page lines and folde line based on mouse position book.onDragOver = function() { clear(); lineStyle(3,0); moveTo(margin,margin); lineTo(width-margin,margin); lineTo(width-margin,height-margin); lineTo(margin,height-margin); lineTo(margin,margin); moveTo(width/2,margin); lineTo(width/2,height-margin); moveTo(_xmouse,_ymouse); lineTo(width-margin,margin); };



