OnMouseDown « Actionscript Programming « Flash Tutorials

Home
Flash Tutorials
1.Actionscript Programming
2.Animals
3.Animation
4.Colors
5.Design
6.Effects
7.Game Cartoon
8.Humans
9.Models
10.Nature
11.Operations
12.Shapes
Photoshop Tutorials
Maya Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
Flash Tutorials » Actionscript Programming » OnMouseDown 
onLoad () { /*on (OnMouseDown) { swishmax Work-a-round Code By Craig Lowe http://www.swish-designs.co.uk for more help or tuorials visit www.swish-designs.co.uk/forums this credit must stay in place. } */ scrollSpeed=5; //sets up to false when the movie starts up=false; //hides system cursor mouse.hide(); //hides custom cursor at runtime cursor._visible=false; //sets friction } on (press) { //sets up to true when mouse button is down if (_root.up==false) { _root.up=true; } } on (release) { //sets up to false when mouse button is up(released) if (_root.up==true) { _root.up = false; } } onEnterFrame() { //checks every frame (looping) if (up==true) { //moves object up helicopter._y = helicopter._y -4; //rotates the object by 10 pixels helicopter._rotation = -10; } else if (up==false) { //moves object down helicopter._y=helicopter._y + 4; ////rotates the object by 10 pixels helicopter._rotation = 10; } } onEnterFrame() { //sets boundaries if (helicopter._y<26) { helicopter._y=26; helicopter._rotation = 0; } if (helicopter._y>208) { helicopter._y=208; helicopter._rotation = 0; } } on (rollOver,dragOver) { cursor._visible=true; } on (rollOut,dragOut,dragOver) { cursor._visible=false; }

To export Flash file choose "File" > "Export SWF File". Type the file name and click OK. To insert Flash in your web page choose "File" > "View HTML Code". Select entire HTML code, right click mouse button and choose "Copy" from the popup menu. Click Close. Paste the code to your HTML page.

w__w__w_.__j___ava__2___s__.___c___o___m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.