|
|
|
|
![]() ![]() |
Mar 16 2005, 01:32 PM
Post
#1
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 24 Joined: 21-February 05 Member No.: 2,724 |
Creating a button that senses the mouse and then expands.
Requirement: Flash MX Step 1: Open a new document. In the actions for frame 1 of layer name layer 1 type: menutriggerdist=150; menumaxscale=300; menumultiplier=1.5; This control how and when the mouse interacts with button. Once you have completed all the steps, change them around and see how each one changes the effect. Step 2: Cntl+f8 (Insert --> New Symbol) Click on new movie click, call it Ibutton. In the frist frame create your image or whatever you want the mouse to interact with , to make it easy you can just type some text in the center of the frame. Step 3: Go back to the scene 1 Press f11(Window --> library) to bring up your library and then drag Ibutton movie clip onto your page Step 4: Click on Ibutton and then in the actions for Ibutton type the following: on (press) { // Gives your movie a button functions getUrl("http://www.astahost.com"); } on (rollOver) { this._alpha=100; } on (rollOut) { this._alpha=25; } //sets event to mousemove or your button won't operate properly. onClipEvent (mouseMove) { //calculates distance from mouse to movie clip dist=Math.sqrt(Math.pow(Math.abs(_xmouse),2)+Math.pow(Math.abs(_ymouse), 2)); // if within a certain distance, triggerdistance, then start changing the clips scale if (dist<=_root.menutriggerdist) { currscale=(1-(dist/(_root.menumultiplier*_root.menutriggerdist)))*(_root.menumaxscale-100); this._xscale = currscale; this._yscale = currscale; // if outside of triggerdistance, then make the scale equal to 100 } else { this._xscale = 100; this._yscale = 100; } } Step 5: Test your new button |
|
|
|
Aug 13 2005, 11:15 PM
Post
#2
|
|
|
Newbie [ Level 2 ] Group: Banned Posts: 13 Joined: 11-August 05 Member No.: 7,776 |
Thanks alot for the info. Of course since it's obvious what I am trying to do here I would still like to show that your information is appreciated. It's quantity and quality that matters here... anyways, your work hasn't gone out unnoticed.
|
|
|
|
Mar 18 2008, 07:28 PM
Post
#3
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 1 Joined: 18-March 08 Member No.: 29,215 |
yo thanks long but yeh i have made it out and looks awsome haven't but it on my web though lol
check my web out plz : tcpcheats.co.nr thanks |
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|
|
Lo-Fi Version | Time is now: 12th October 2008 - 02:11 AM |