让MC保持4:3比例的CODE
未识别博客 · mojaves · 2004-12-20(近似)
/
首页
/
让MC保持4:3比例的CODE
其方法是建立3个MC(large,small,为保持拉伸过高的mc“grabber"),具体怎么做,请看:
Stage.align = "TL";
Stage.scaleMode = "noScale";
this.onResize = function()
{
// maintain 800:600 ratio (4:3)
var ratio = 4/3;
var StageRatio = (Stage.width - grabber._x) / Stage.height;
if (StageRatio > ratio)
{
goHorizontal = true;
} else {
goHorizontal = false;
}
large._x = grabber._x;
large._width = Stage.width - grabber._x;
large._height = Stage.height;
var wide = (Stage.width - large._x)-20;
var hi = (wide * (3/4));
if (hi >= Stage.height - 20)
{
small._y = 10;
var hi = Stage.height - 20;
var wide = (hi * (4/3)-20);
// slide it over the necessary amount...
small._x = ((large._width / 2) - (wide/2))+grabber._x;
} else {
small._x = large._x + 10;
}
small._width = wide;
small._height = hi;
if (!goHorizontal)
{
small._y = (Stage.height/2) - (small._height/2);
}
grabber._height = Stage.height;
};
Stage.addListener(this);
grabber.onPress = function()
{
this.startDrag(true, 40, 0, 150, 0);
};
grabber.onRelease = grabber.onReleaseOutside = function()
{
this.stopDrag();
onResize();
};
onResize();
mojaves
at
|
Trackback(
0
)
so help me to get where i belong......i love u Y tou....forever.hehehaha………………
评论
想说的啥?
最后更新
春天来时 When.Spring.Comes
试听:许巍新专辑第一推荐曲《曾经的你》
3日晚,看了部电影
HAPPY TOGETHER
青春后遗症
FREE THE DEPT.
Thank You for Hearing Me
KFC vs 回锅肉
回来了
棉花
原始快照:web.archive.org