[FONT=Times New Roman][SIZE=3]Hello. Can you help me?.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]I have an exercise like a puzzle to learn how to manipulate the x and y buttons and mc position in AS 2. all the code work ok, just only I don’t know how to go to the second frame when the base mc are iquall to alpha 100. [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Exercise: on the left of the stage are 4 mc (base1, base2, base3, base4) with an alpha = 0. in the same place are 4 butons (tor1, tor2, tor3, tor4). And there is a button to scramble and a little code to rotate the pieces and change the counter. When I hit this button all 4 pieces change position. When I click on tor1 I have to drag it on his place marked for his xy position(base1), when I drop it, this Tor1 go to another xy position outside the stage and base1 change to alpha 100, and couter sume +1. but I don’t know how to check if all base mc are in alpha 100 and go to 2 frame. Here is the code.[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]stop();[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]_root.counter = 0;[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]// store base symbols in array[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]var group:Array = new Array(base1, base2, base3, base4);[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]// set the initial _alpha values to 0[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]for (var i = 0; i<group.length; i++) {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] group*._alpha = 0;[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]}[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]//create button functions[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor1.onPress = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] if (Key.isDown(Key.SPACE)) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] tor1._rotation += 90;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] } else {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] startDrag(“tor1”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor2.onPress = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] if (Key.isDown(Key.SPACE)) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] tor2._rotation += 90;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] } else {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] startDrag(“tor2”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor3.onPress = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] if (Key.isDown(Key.SPACE)) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] tor3._rotation += 90;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] } else {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] startDrag(“tor3”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor4.onPress = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] if (Key.isDown(Key.SPACE)) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] tor4._rotation += 90;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] } else {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] startDrag(“tor4”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor1.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] stopDrag();[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] if (tor1._x>74.2 && tor1._x<94 && tor1._y>92.8 && tor1._y<112) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor1”, _x, “-200”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor1”, _y, “92.8”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“base1”, _alpha, “100”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.counter += 1;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor2.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] stopDrag();[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] if (tor2._x>173.3 && tor2._x<193 && tor2._y>92.8 && tor2._y<112) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor2”, _x, “-200”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor2”, _y, “92.8”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“base2”, _alpha, “100”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.counter += 1;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor3.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] stopDrag();[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] if (tor3._x>74.2 && tor3._x<94 && tor3._y>172.7 && tor3._y<192) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor3”, _x, “-200”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor3”, _y, “172.7”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“base3”, _alpha, “100”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.counter += 1;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]tor4.onRelease = function() {[/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman] stopDrag();[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] if (tor4._x>173.3 && tor4._x<193 && tor4._y>172.7 && tor4._y<192) {[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor4”, _x, “-200”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“tor4”, _y, “172.7”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] setProperty(“base4”, _alpha, “100”);[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] _root.counter += 1;[/FONT][/SIZE]
[SIZE=3][FONT=Times New Roman] }[/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]};[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Times New Roman]As you can see the code is very large and tedious, if you know what to do to abbreviate it, or make it shortes using array, please help me to writhe the code. [/FONT][/SIZE]
[FONT=Times New Roman][SIZE=3]santana[/SIZE][/FONT]