Member Avatar for Member #334542

I need Script for zooming and panning images in a smoother way. - Flash

Dani AI

Generated

For : smooth zoom + pan is more about how scale and translation are animated than about raw FPS. was right to flag tweeners; 's FPS question matters less when transforms are eased instead of snapped.

Recommended AS3 approach (cleanest API in CS3):

  • Put the image inside a container Sprite and define the visible area with scrollRect (faster than vector masks).
  • Turn on bitmap smoothing for the image so scaled pixels interpolate.
  • Animate scale and position together with a tweening engine so the image scales toward a focal point while its x/y are adjusted to keep that point under the cursor.
  • Calculate pan bounds from (imageWidth * scale) minus viewport size and clamp x/y so edges never slip past the viewport.
  • Optionally lower StageQuality during heavy transforms on slow machines, then restore it afterward (use cautiously; it affects rendering appearance).

AS2 notes:

  • No scrollRect; use a masked MovieClip and a tween engine that supports AS2.
  • cacheAsBitmap can help for complex vectors but test it—on some transforms it can hurt performance.
  • If stutter persists, consider swapping in pre-scaled image versions at threshold zoom levels or reducing filters and displayObject count.

For a compact, high-performance tweening tool and examples, see GreenSock (GSAP).

Recommended Answers

All 4 Replies

Member Avatar for Member #46692

In a smoother way? It is pretty much smooth. What version of flash are you using?

There are 3rd party tweener libraries you can use. That might be worth looking at.

Member Avatar for Member #334542

Image should be zoom and able to pan within the specified area. I mean I placed controls for that like zoom in, out, pan up left right down etc. also need without these controls. I am using Flash cs3 with as2.0 even its ok with as3.0

What Frame Rate are you using? Is it between 24-36 FPS?

Member Avatar for Member #334542

Whatever fps within 26 to 30. I need a sample fla or effective tutorial on that with full controls.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.