让MC保持4:3比例的CODE
来源: BlogBus 原始链接: http://www.blogbus.com:80/blogbus/blog/diary.php?diaryid=6832 存档链接: https://web.archive.org/web/20041220040027id_/http://www.blogbus.com:80/blogbus/blog/diary.php?diaryid=6832
<<<Mike Chambers等人的工作流程(work flow) / 首页 / 永隔一江水---许巍>>> 让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(); Posted by 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 回锅肉 回来了 棉花