2010-01-20 85 views

回答

2

我相信你會需要沿東西線(以下未測試的代碼)...

var screen_aspect_ratio = Screen.Width/Screen.Height; 
var outer_aspect_ratio = OuterMovieClip.Width/OuterMovieClip.Height; 
var new_outer_width; 
var new_outer_height; 

if (screen_aspect_ratio > outer_aspect_ratio) { 
    new_outer_height = Screen.Height; 
    new_outer_width = (Screen.Height * OuterMovieClip.Width)/OuterMovieClip.Height; 
} else { 
    new_outer_width = Screen.Width; 
    new_outer_height = (Screen.Width * OuterMovieClip.Height)/OuterMovieClip.Width; 
} 

OuterMovieClip.Width = new_outer_width; 
OuterMovieClip.Height = new_outer_height; 
+0

謝謝。這不完全正常,但我認爲這使我走向了正確的方向。 你可以簡單地解釋一下,通過OuterMovieClip.Width對Screen.Height進行多少操作是完全正確的嗎?謝謝。 – Guest 2010-01-20 22:02:15

+0

看看這篇維基百科文章... http://en.wikipedia.org/wiki/Cross_multiplication#Use – theraccoonbear 2010-01-21 01:39:27

相關問題