A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [RESOLVED] [MX04] help moving a mc through AS

Hybrid View

  1. #1
    Member
    Join Date
    Apr 2007
    Location
    Greece
    Posts
    92

    [RESOLVED] [MX04] help moving a mc through AS

    i wanna put this code in a mc's frame, i need the mc to move 5 pixels each time it hits that frame, i thought of something like

    Code:
    _parent._y -= 10;
    but it didnt work, any help would be apreciated.

  2. #2
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    //rate is the speed it moves, where as end value is it's ending point
    move_mc(mc_1, 120);
    move_mc = function(ins_name, end_val) {
    ins_name.onEnterFrame = function() {
    if(ins_name._y < end_val) {
    ins_name._y += rate;
    } else {
    delete ins_name.onEnterFrame;
    }
    }
    }
    rate = 5;

  3. #3
    Member
    Join Date
    Apr 2007
    Location
    Greece
    Posts
    92
    ill try that thx

  4. #4
    Member
    Join Date
    Apr 2007
    Location
    Greece
    Posts
    92
    dint work (probably coz o my shoody AS skill)

  5. #5
    Member
    Join Date
    Apr 2007
    Location
    Greece
    Posts
    92
    sry, found it, i just used

    this. _x+= 5;

    thx for help

  6. #6
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    LOL, that works too, I tend to use that if I wanna do something like a motion tween without frames. Good luck.

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