Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> A Button That Senses The Mouse, FLASH TUTORIAL : MOUSE ROLLOVER EFFECTS
Josh_Jpn
post Mar 16 2005, 01:32 PM
Post #1


Newbie [ Level 2 ]
Group Icon

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
Go to the top of the page
 
+Quote Post
Ray
post Aug 13 2005, 11:15 PM
Post #2


Newbie [ Level 2 ]
Group Icon

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.
Go to the top of the page
 
+Quote Post
badmax
post Mar 18 2008, 07:28 PM
Post #3


Newbie [ Level 1 ]
Group Icon

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 cool.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Introduction To Mask Layers In Flash(0)
  2. Using Symbol Effects In Flash(0)
  3. Using Sprites In Flash(2)
  4. Matching Sound To Animations In Flash(2)
  5. Flash Webcam Room(8)
  6. Vaile's Flash Mx 2004 Tutorial!(5)
  7. Pre Loader Tutorial For Flash(6)
  8. How To Make A Scene Select Button(0)
  9. How To Make A Simple Flash Button(1)


 



- Lo-Fi Version Time is now: 11th October 2008 - 07:12 AM