Need a script to zoom in on mouse click / over in flash mx.
Pls do reply soon.

thanks

Dani AI

Generated

Short answer: both quick approaches shown in the thread will work for a prototype, but the cleaner, more robust result comes from putting the graphic inside its own MovieClip and animating its scale with easing rather than repeatedly nudging pixel width/height. offers the simplest immediate tweak and @GreenDay2001 rightly points out doing the work at the clip level — those approaches teach the idea, but for production you want a single timed tween so transforms do not accumulate, jitter, or badly upscale bitmaps.

Practical workflow you can apply right away:

  • Convert the image into a MovieClip symbol and give the instance a clear name; set the registration point where the zoom should anchor (center for a classic zoom).
  • Animate scale with a single tween/easing call on hover or click, then tween back on release; disable retriggers while the tween runs so repeated events do not stack.
  • If the zoom must follow the pointer, compute the focal offset and move the clip as you scale so the cursor remains over the intended point.

Quick tips and cautions: preload a full-resolution source to avoid pixelation when enlarging raster artwork; avoid scaling live text if you need crisp type (convert to graphics or use higher font sizes); do not rely on bitmap-caching for clips you are actively rescaling (it can make quality worse); temporarily increasing Stage.quality during the animation can improve visual results at the cost of CPU. If you state which Flash MX/AS2 release and whether you want hover or click behavior, a compact AS2 example using the built-in tween class can be posted.

Recommended Answers

All 2 Replies

You can try something like:

on(rollover){
 image.width = image.widht + 10;
 image.height = image.height + 10;
}
on (rollout){
 image.width = image.widht - 10;
 image.height = image.height - 10;
}
Member Avatar for Member #114696

You can try something like:

on(rollover){
 image.width = image.widht + 10;
 image.height = image.height + 10;
}
on (rollout){
 image.width = image.widht - 10;
 image.height = image.height - 10;
}

This would work until you have set noScale property to no. Better would be using MovieClip._height or MovieClip._height where movie clip would be replaced by the clip instance name or _root for whole movie. You could also use _xscale or _yscale properties if you want relative zoom.

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.