A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: How to update actionscript to version 7.0???

  1. #1
    Junior Member
    Join Date
    Nov 2005
    Posts
    7

    How to update actionscript to version 7.0???

    Hi there!

    I found the following script somewhere and it only works when published as flash player version 6. Is there any way to make it version 7 compatible?
    Any help would be highly appreciated!!

    Thanx

    onClipEvent (mouseDown) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    if (i>0) {
    return;
    }
    zoom = true;
    dir == 1 ? (dir=-1) : (dir=1);
    if (dir == 1) {
    pt = {x:_root.zoom_this._xmouse, y:_root.zoom_this._ymouse};
    }
    }
    }
    onClipEvent (enterFrame) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    if (!zoom) {
    return;
    }
    _root.zoom_this._xscale += dir*i*100/50;
    _root.zoom_this._yscale += dir*i*100/50;
    var pt2 = {x:t.x, y:t.y};
    _root.zoom_this.localToGlobal(pt2);
    _root.zoom_this._x -= (pt2.x-pt.x);
    _root.zoom_this._y -= (pt2.y-pt.y);
    i++;
    if (i == 10) {
    zoom = false;
    i = 0;
    }
    }
    }
    onClipEvent (keyDown) {
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    if (Key.getCode()==Key.Right) {
    this._x +=15;}
    else if (Key.getCode() == Key.Left) {
    this._x -=15;}
    else if (Key.getCode() == Key.Up) {
    this._y -=15;}
    else if (Key.getCode() == Key.Down) {
    this._y +=15;}
    }
    }

  2. #2
    Senile member! :)
    Join Date
    Dec 2001
    Location
    Saunaswamp (transl)
    Posts
    2,296
    Key.Right, Key.Left, Key.Up and Key.Down has incorrect casing. Thoose constants should be all in uppercase: Key.RIGHT, Key.LEFT, Key.UP and Key.DOWN.

    Also you don't seem to have given a numeric value to variable "i" prior to using "++" on it. Using that operator on such a variable will generate "NaN" in player 7 rather than player 6 which assumes the value 0.

    /Mirandir
    Last edited by Mirandir; 11-10-2005 at 09:56 AM.

  3. #3
    Senior Member Shotsy247's Avatar
    Join Date
    Apr 2001
    Location
    Be there in a minute!
    Posts
    1,386
    One major difference between Flash 6 and 7 is that Flash 7 is case sensitive.

    Key.Right is actually not a property of the Key object, although Key.RIGHT is.

    Same applies for left up and down.

    _t


    oopps beaten to it...They should bring back the ability to delete a post, or am I just missing it?
    I don't feel tardy.

  4. #4
    Junior Member
    Join Date
    Nov 2005
    Posts
    7
    Thanks a lot!
    Still one problem, I'm a newbie...
    How do I give a numeric value to the variable "i"??

  5. #5

  6. #6
    Junior Member
    Join Date
    Nov 2005
    Posts
    7
    Thank you, thank you, thank you!!!
    That did the trick. After severel days of twisting my brain. Should have posted right away.

  7. #7

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