简体   繁体   中英

How to disable scaling on Images loaded in Flash Movie AS3

I have Flash, in which i load some images dynamically.

But when I am viewing this flash on a large screen monitor, the flash is auto scaling (I can't disable stage auto scaling). And similarly size of images is also increasing. Here the problem arises, On large screen monitors the images are getting blur.

How can I make it good on all size of monitors.

All here i want is to disable scaling on images selectively.

there is no built-in possibility ... but this code will unscale an arbitrary DisplayObject ...

var m:Matrix = target.transform.concatenatedMatrix;
m.invert();
target.transform.matrix = m;                

from here, there are many ways to accomplish, what you want ... the easiest way would be, to disable stage scaling, to listen on resize, and then resize your topmost DisplayObject s, to fit to stage ... the advantage is, that resize event will be triggered ... so for DisplayObject s that you want to stay unscaled, you add a listener to the resize event and unscale them on resize ...

otherwise, put a DisplayObject on stage, and watch it's concatenatedMatrix on enterframe ... if a and d (scaling parameters) change, then you have a resize ... then unscale all objects you want to be unscaled ... this is one extra event handler call and 2 float comparisons on enterframe, so it shouldn't be a performance killer ...

hope that helps ...

greetz

back2dos

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM