A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Zoom from center of stage

  1. #1
    FK Romeo martiansam's Avatar
    Join Date
    Oct 2001
    Location
    Bombay, India
    Posts
    223

    Zoom from center of stage

    Hi guys,

    I know this question has been asked a million times now but even after searching through scores of pages, I have not been able to get an answer for my problem.

    I have a big movieClip which the user can zoom by click on a 'zoom-in' button. Once zoomed the user can click on that movieclip and pan it. Now the center of that movieClip is displaced and no longer where it was before. However, if the user click on 'zoom-in' now again, the movieClip should zoom from the center of the stage and not from the movieClip's center.

    To put it simply, I want a formula which will zoom a movieClip from the center of the stage and not from its registration point, no matter where the registration point is.

    Please help!!

    Thanks.
    sameer rao

    there...you see!!

  2. #2
    Junior Member
    Join Date
    Jan 2010
    Posts
    1
    8 years later, I'd still like to see an answer to this. Anyone got one?

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    1
    This is exactly what I was looking to do too! And I just figured it out...this isn't a scripting issue, but how you build it. I placed a map movie clip inside another movie clip called map container. If you use the map mc for dragging/navigation and the map container mc for zooming, the map always stays centered. It zooms off the "camera" (map container mc) and not the map's registration point (map mc).

    I hope this is what you were asking. I'd demonstrate, but it's not completely finished yet. But the zoom does work like it's supposed to!

  4. #4
    Registered User
    Join Date
    Jul 2010
    Posts
    1

    Yahoo! Dynamic Registration Class

    Code:
    var p:Point = new Point();
    p.x = 100;
    p.y = 10;
    DynamicRegistration.move(map, p, 0, 0);
    DynamicRegistration.scale(map, p, 2, 2)
    ;

    http://code.google.com/p/flexwires/s...egistration.as

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