Membuat tombol komedi putar (carrousel) pada flash


carrousel

carrousel

Untuk membuat carrousel atau yang sering disebut sebagai komedi putar sangat mudah jika kita menginginkannya pada flash, berikut adalah source codenya :

import mx.utils.Delegate;
var numOfItems:Number;
var radiusX:Number = 250;
var radiusY:Number = 75;
var namaIcon:Array = new Array(“absensi”, “mahasiswa”, “matakuliah”, “pembimbing”, “transaksi_matakuliah”, “report”);
var teksTooltip:Array = new Array(“Absensi”, “Mahasiswa”, “Matakuliah”, “Pembimbing”, “Trans. Matakuliah”, “Laporan”);
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
var perspective:Number = 130;
var home:MovieClip = this;
var tooltip:MovieClip = this.attachMovie(“tooltip”, “tooltip”, 10000);
tooltip._alpha = 0;
numOfItems = teksTooltip.length;
for (var i = 0; i < numOfItems; i++) { trace(namaIcon[i]); var t = home.attachMovie("item", "item" + i, i + 1); t.angle = i * ((Math.PI * 2) / numOfItems); t.onEnterFrame = mover; t.toolText = teksTooltip[i]; t.icon.inner.attachMovie(namaIcon[i], "mov", 0); t.r.inner.attachMovie(namaIcon[i], "mov", 0); t.icon.onRollOver = over; t.icon.onRollOut = out; t.icon.onRelease = released; } function over() { home.tooltip.tipText.text = this._parent.toolText; home.tooltip._x = this._parent._x; home.tooltip._y = this._parent._y - this._parent._height / 2; home.tooltip.onEnterFrame = Delegate.create(this, moveTip); home.tooltip._alpha = 100; } function out() { delete home.tooltip.onEnterFrame; home.tooltip._alpha = 0; } function released() { trace(this._parent.toolText); } function moveTip() { home.tooltip._x = this._parent._x; home.tooltip._y = this._parent._y - this._parent._height / 2; } function mover() { this._x = Math.cos(this.angle) * radiusX + centerX; this._y = Math.sin(this.angle) * radiusY + centerY; var s = (this._y - perspective) / (centerY + radiusY - perspective); this._xscale = this._yscale = s * 100; this.angle += this._parent.speed; this.swapDepths(Math.round(this._xscale) + 100); } this.onMouseMove = function() { speed = (this._xmouse - centerX) / 4500; }; [/sourcecode] downloadnya di sini ajah.. https://www.box.net/shared/cr43vaslls

hmm.. udah segitu ajah gak perlu banyak2…😀

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s