!--[endif]--> Convert méi thumb thanh Movie clip bang cách click vào từng cái và nhấn F8 Double click l@n rectangle tool trén toolbar va set gia trị như hình... Corner radius: | 10] po
Trang 1TAO MOT GALLERY BANG FLASH
(Thứ Năm, 18/10/2007-2:29 PM)
Đầu tiên tạo một document và màu sắc như hình dưới:
Đầu tiên tạo một document và màu sắc như hình dưới:
Title: |
Dimensions: [750 px (width) x [500 px (height) Match: ( Printer © Contents Default
Background color: ry
: | [#eFc?ce
Ruler units:
Make Default |
Tiép theo tao 2 folder trong library : “images” va “thumbs”, import 8 image va 8 thumb vào trong 2 folder d library
Frame rate
Thumb có kích thước là: 64x56 và image :320x280
=7
te
<! [if !vml] > <! [endif] >
<! [if !vml] >
Trang 2
<! [endif] >
<! [if !vml] >
ữ images
(4l image-0
(4l image-1
(4l image-2
3 image-3
(4l inage-4
(| image-5 (4l image-6
(4l image-7
ữ thumbs
(| thumb-0
(#| thumb-1 (#| thumh-2
(| thumb-3
(| thumb-4 (| thumb-5
(| thumb-6
(#| thumb-7
Folder
Bitmap Bitmap Bitmap Bitmap Bitmap Bitmap Bitmap Bitmap
Folder
Bitmap Bitmap Bitmap Bitmap Bitrnan Bitrnan Bitrnan
Bitmap <1_-[endif] >
Tạo 2 layer: thumb-0, thumb-1 layer đặt tên là "thumbs", image lớn thì nằm trên lớp đặt tên là gallery như hình dưới:
Trang 3
! [endif] >
Convert méi thumb thanh Movie clip bang cách click vào từng cái và nhấn F8
<! [endif] > <! [if !vml] >
Double click l@n rectangle tool trén toolbar va set gia trị như hình
Trang 4<! [if !vml] >
Corner radius: | 10] points OK
<! [endif] >
Tạo tiếp một rectangle màu trắng nằm ở layer dưới, thêm 1 rectangle nifa mau xanh nhưng nhỏ hơn 1 tí nằm trên như hình :
<! [if !vml] >
<! [endif] >
Click lên ảnh lớn hoa dao, convert thanh MC dat tén la imageO, ké tiép ta phai viét action cript cho cai image dynamically nay
<! [if !vml] >
Trang 51 Convert to Symbol
Name: | imaged
Type: f®S Movie clip Registration: Fae
© Graphic
~ Linkage
Identifier:
AS 2.0 class: |
Linkage: JV Export For ActionScript
[— Export for runtime sharing
JV Export in First frame
J | Import For runtime sharing
URL:
<! [endif] >
Làm tiếp với các image còn lại
Tiếp theo: convert cái thumb đầu tiên thành MC với tên thumb0:
<! [if !vml] >
iow Properties ` Fil ters | Parameters: OO
|Movie Clip || Instance of: H
<! [endif] >
Làm tiếp tục cho các thumb còn lại:
Trang 6<! [if !vml] >
<! [endif] >
Tiếp theo tạo một cái rectangle để làm mặt nạ như hình dưới:
<! [if !vml] >
' ¥% Properties Filters | Parameters
| hes |Movie Clip xị Instance of: mask
«Instance Name> Swap |
w:| 320.0 x; | 305.0
H:| 280.0 vị 96.0
Trang 7
<! [endif] >
Xong convert né thanh MC vdi tén “Mask”
Dan doan code sau:
mask x = images x =305;
mask y = target = 96;
images setMask (mask) ; images y = -1000;
speed = 5;
for (var i = O; i<8; i++) {
img y = img height*i;
thumb alpha = 60;
target = this.pos;
}
[endif] >
Các bạn có thể download file nguồn tại đây : Download FLA
this attachMovie ("mask”, “mask”,
var thumb = this["thumb"+i];
this.onEnterFrame = function{) {
this createEmptyMovieClip("“images", 100);
101):
var imgq = imaqges.attachlowie("iuadqe”"+i, "“iuaqe”+i,
thumb.pos = target+(i*-img height);
thumb.onPress = function() {
he
thumb.onRollOver = function{) {
this alpha = 100;
he
thumb.onRollOut = function{) {
this alpha = 60;
}¿
images y += (target-images y)/speed;