Control of MC

Source: Internet
Author: User
Control

1. Production of 1-dimensional ball, 1-arrow button and 2 magnifying glass buttons ("+" and "-") components, according to their own preferences design shape and style;
2. Drag the movie you made above into the scene, then copy the three arrow buttons and rotate them up, down, left, and right, respectively. Adjust the position of each component;
3. Take an instance name for the ball, such as: "Qiu";
4. Next, write the buttons as:
Up button:


On (release) {
SetProperty ("/qiu", _y, (GetProperty ("/qiu", _y))-10);
}
Down button:


On (release) {
SetProperty ("/qiu", _y, (GetProperty ("/qiu", _y)) +10);
}
Left button:


On (release) {
SetProperty ("/qiu", _x, (GetProperty ("/qiu", _x))-10);
SetProperty ("/qiu", _rotation, (GetProperty ("/qiu", _rotation))-10);
}
Right button:


On (release) {
SetProperty ("/qiu", _x, (GetProperty ("/qiu", _x)) +10);
SetProperty ("/qiu", _rotation, (GetProperty ("/qiu", _rotation)) +10);
}
Zoom Out button:


On (release) {
SetProperty ("/qiu", _xscale, (GetProperty ("/qiu", _xscale)) *0.9);
SetProperty ("/qiu", _y, "");
SetProperty ("/qiu", _yscale, (GetProperty ("/qiu", _yscale)) *0.9);
}
Zoom button:


On (release) {
SetProperty ("/qiu", _xscale, (GetProperty ("/qiu", _xscale)) *1.1);
SetProperty ("/qiu", _yscale, (GetProperty ("/qiu", _yscale)) *1.1);
}
5.OK, all finished, Ctrl+enter test film.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.