do you speak AS? function prob

  • Started
  • Last post
  • 1 Response
  • goygoygoy

    I wrote this script on frame 1:

    function swapClip(clipToClose, clipToOpen) {
    for (var i = 1; i<=4; i++) {
    if (_parent._parent.clipToClose.ope... == 1) {
    if (this == _parent._parent.clipToOpen["btOp... {
    _parent._parent.clipToClose.goto...
    _parent._parent[clipToOpen+"Go"] = 1;
    }
    }
    }
    }

    and i have this script on a button (frame 1)

    on (release, releaseOutside) {
    swapClip(kinetik, freelance);
    }

    while i'm sure this script works perfectly well on the button:

    for (var i = 1; i<=4; i++) {
    //kinetik open
    if (_parent._parent.kinetik.open == 1) {
    if (this == _parent._parent.freelance["btOpe... {
    _parent._parent.kinetik.gotoAndP...
    _parent._parent.freelanceGo = 1;
    }
    }
    }

    Where am I wrong? I made some trace and I receive a lot of undefined, but can't resolve it.
    buh.

  • tomkat0

    before trying to get too deep into your code there, try absolute addressing instead of relative .. maybe even on calling the function,
    like:

    on(release){
    _root.changeClip();
    }

    could be it..