-
i´ll get if fired if i don´t get this
I´m developing a game where i need to drag some items and add to a counter that if it goes further than 8 it should go to the next frame. Later i need load the selectioned items.
i have this code in each MC with a buttom:
on (press) {
startDrag("_root.p1", true);
}
on (release) {
stopDrag();
if (_root.p1.hitTest(_root.p0)) {
_root.p1._x = _root.p0._45;
_root.p1._y = _root.p0._y;
cont++; ---> this is te counter to validate but this not increment never
} else {
_root.p1._x = _root.p1inicioX;
_root.p1._y = _root.p1inicioY;
}
}
Help me please.
-
Senior Member
So how do you check it? Textfield? Where is the button with the code? Inside a movieclip or on main timeline?
The textfield has to be in the same timeline as the button with the code for it to work.
-
Pellepiano, yes, i'm checking this with a TextField, it is in the same timeline.
The Button is inside a MC, in the buttom is the code.
I need that the counter, inc each that the user move the "object", and evaluate that the user only choose 8 objects of 20. Is like a game for kids.
Thanks!!!!!
-
Senior Member
You could just make an if statement after i++
i++;
if(i==9){
nextFrame();
}
-
Pellepiano...
I have this in the MC, where the other mc move.
but it not works
onClipEvent (mouseUp) {
cont += 1;
if (cont == 8) {
nextFrame();
}
}
-
nextFrame of what movie clip? Or are you trying to move the main timeline?
-
next frame in the timeline...
I tried with gotoandstop(# frame), but it doesn't work
-
Main timeline?
Then... _root.nextFrame();
Or, you'd be better off using a frame label than a frame number.
Label the targeted frame with an unique label, and use:
_root.gotoAndStop("frame_label");
-
Thanks!!!!!! The counter works
now i need store the MC selectioned, i dont know how i do this
i think that in array, but how i can identify the MC selectioned? and later show in another timeline?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|