Welcome To VertexTemplates.com Flash MX 2004 Tutorials Area - Movie Functions |
![]() |
|||
tellTarget ("box") {
..:x = _x;
..:rotation = _rotation;
..:y = _y;
..:alpha = _alpha;
..:xscale = _xscale;
..:yscale = _yscale;
}
![]() 3. The next thing you want to do is make the funky buttons for the up and down arrows. Mine are really basic ones, but you can get intricate and make them neat looking =p. After you're done making them, select the up arrow, and go to Insert>Convert to Symbol. Name it "up" and make behavior as a button. Go back and select the down arrow and again go to Insert>Convert to Symbol, name it "down" with behavior as a button. ![]() 4. Now, right click the "up" button and select "Actions". Write in or copy-paste the following code:
on (release) {
tellTarget ("box") {
_x+=10;
..:x = _x;
}
}
Go back, and right click on the "down"button and select "Actions". Write in or copy-paste the following code:
on (release) {
tellTarget ("box")
_x-=10;
..:x = _x;
}
} ![]() 5. The last step sets up moving the box to the left and to the right. If you want to do other effects like move it up and down, rotate, etc, repeat step 3 to make the button, and then plug in the following codes for each respective effect: Moving up and down: Up Arrow Code:
on (release) {
tellTarget ("box") {
_y-=10;
..:y = _y;
}
}
Down Arrow Code:
on (release) {
tellTarget ("box") {
_y+=10;
..:y = _y;
}
}
Rotating clockwise and counterclockwise:
Up Arrow Code:
on (release) {
tellTarget ("box") {
_rotation+=10;
..:rotation = _rotation;
}
}
Down Arrow Code:
on (release) {
tellTarget ("box") {
_rotation-=10;
..:rotation = _rotation;
}
}
Increase and Decrease the Width:
Up Arrow Code:
on (release) {
tellTarget ("box") {
_xscale+=10;
..:xscale = _xscale;
}
}
Down Arrow Code:
on (release) {
tellTarget ("box") {
_xscale-=10;
..:xscale = _xscale;
}
}
Increase and Decrease the Height:
Up Arrow Code:
on (release) {
tellTarget ("box") {
_yscale+=10;
..:yscale = _yscale;
}
}
Down Arrow Code:
on (release) {
tellTarget ("box") {
_yscale-=10;
..:yscale = _yscale;
}
}
Increase and Decrease the Alpha/Opacity:
Up Arrow Code:
on (release) {
tellTarget ("box") {
if (_alpha+10<100) {
_alpha+=10;
..:alpha = _alpha;
}
}
}
Down Arrow Code:
on (release) {
tellTarget ("box") {
if (_alpha-10>0) {
_alpha-=10;
..:alpha = _alpha;
}
}
}
Whew, that was tiresome but your "box" should be fully functional and ready to go now. If you want to display the values like I did on the bottom right, just make a dynamic text box, and define the variables as: x, y, rotation, xscale, yscale, and alpha respectively. Hope this tutorial helps in explaining the vast functions of movies and if you need any help, just drop us an e-mail in the contact section. |
||||
| Home Web Templates Affiliate Program Template Tour Custom Website Design Tutorials Articles Contact Us FAQ's All Rights Reserved © 2005 VertexTemplates.com Read our Terms Of Use and Privacy Policy Flash Templates by Metamorphosis Design |
||||