A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: i´ll get if fired if i don´t get this

  1. #1
    Junior Member
    Join Date
    Apr 2003
    Posts
    11

    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.


  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    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.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Apr 2003
    Posts
    11
    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!!!!!

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You could just make an if statement after i++


    i++;
    if(i==9){
    nextFrame();
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Junior Member
    Join Date
    Apr 2003
    Posts
    11
    Pellepiano...

    I have this in the MC, where the other mc move.
    but it not works

    onClipEvent (mouseUp) {
    cont += 1;
    if (cont == 8) {
    nextFrame();
    }
    }

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    nextFrame of what movie clip? Or are you trying to move the main timeline?

  7. #7
    Junior Member
    Join Date
    Apr 2003
    Posts
    11
    next frame in the timeline...
    I tried with gotoandstop(# frame), but it doesn't work

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    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");

  9. #9
    Junior Member
    Join Date
    Apr 2003
    Posts
    11
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center