A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Map +mathematics

  1. #1
    Member
    Join Date
    May 2004
    Posts
    47

    Map +mathematics

    Hi,
    Does anyone knows how I can solve this:

    When I do a onRelease on the houses on this map

    http://www.mr-andersen.no/zoom_map.jpg

    I need to zoom in on the map where the house which is choosen is,
    I've tried several things but I have huge problems how to do the math when moving and scaling the map

    Can anyone here please help me out on this one

    thanks in advance,

    best regards
    T

  2. #2
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    Maybe something like this instead of onRelease...

    code:

    _root.onMouseDown = function() {
    if (k>0) {
    return;
    }
    zoom = true;
    dir == 1 ? (dir=-1) : (dir=1);
    if (dir == 1) {
    pt = {x:_root._xmouse, y:_root._ymouse};
    }
    }
    _root.onEnterFrame = function() {
    if (!zoom) {
    return;
    }
    _root._xscale += dir*k*50/8;
    _root._yscale += dir*k*50/8;
    var pt2 = {x:pt.x, y:pt.y};
    _root.localToGlobal(pt2);
    _root._x -= (pt2.x-pt.x);
    _root._y -= (pt2.y-pt.y);
    k++;
    if (k == 8) {
    zoom = false;
    k = 0;
    }
    }


  3. #3
    Member
    Join Date
    May 2004
    Posts
    47

    he he

    Hi NTD
    Thanks for answering
    I found a file here on FlashKit with the exact same code
    Just tweaked it to my needs

    thanks

    T

  4. #4
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Just curious......

    autozoom by T Norman?

  5. #5
    Member
    Join Date
    May 2004
    Posts
    47

    Auto zoom

    Yep!
    Is that you?

  6. #6
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    lol, yea

  7. #7
    Member
    Join Date
    May 2004
    Posts
    47

    Thanks

    Thanks, that one saved me alot of headache.

    Found the link to your movie in one the threads in this forum,

    http://www.flashkit.com/board/showth...highlight=zoom

    Hope I can help you someday

    edit: oh, It was you who posted those URLs

    best regards
    T
    Last edited by spiderLab; 09-25-2004 at 08:25 PM.

  8. #8
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Glad it helps

    Keep on flashin

    Regards
    NTD

  9. #9
    Member
    Join Date
    May 2004
    Posts
    47

    Ooops!

    Hi again NTD

    Thanks for helping me out

    Can you please look at:
    http://www.mr-andersen.no/testzoom.html

    The file size is a bit lengthy right now, but
    can you help me explaining why the map x and y jumps when it is zoomed the first time, I just don't haven't got the registration point thing in Flash yet

    thanks for helping
    T

  10. #10
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    Not sure what is happening, I have not run into that before. Are you using the zoom for the _root or targeting the MC itself?

  11. #11
    Member
    Join Date
    May 2004
    Posts
    47

    MovieClip

    Hi
    I am targeting the movie clip

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