/ Published in: ActionScript
Resizes the item based on the mask. Must be on the same stage.
Expand |
Embed | Plain Text
private function resizeBasedOnMask(pic:Object, masker:Object) { var scaler:Number; if (pic.width > pic.height) { pic.height = masker.height; pic.scaleX = pic.scaleY; } else { pic.width = masker.width; pic.scaleY = pic.scaleX; } pic.x = -((pic.width - masker.width) / 2); pic.y = -((pic.height - masker.height) / 2); pic.mask = masker; }
You need to login to post a comment.
