We Recommend

Smarty PHP Template Programming And Applications Smarty PHP Template Programming And Applications
Smarty is a templating engine for PHP. Designers who are used to working with HTML files can work with Smarty templates, which are HTML files with simple tags while programmers work with the underlying PHP code. The Smarty engine brings the code and templates together. The result of all this is that designers can concentrate on designing, programmers can concentrate on programming, and they don't need to get in each others way so much.


Posted By

daisuke103 on 02/11/08


Tagged

resize textmate size listener as2 stage mdn


Versions (?)


AS2 MdN リキッドサイズ と50パーセントボックス


Published in: Other 


  1. /*
  2. リキッドサイズ
  3. MdN P035
  4. ステージにfiftyPer.boxを用意 = 50%固定
  5. */
  6. Stage.scaleMode = "noScale";
  7. Stage.align="LT"; // どこを中心に拡大縮小するか
  8.  
  9. //リスナーオブジェクトを作成
  10. var myListener:Object = new Object();
  11.  
  12. //リサイズされた時の処理
  13. myListener.onResize = function () {
  14.  
  15. var SW = Stage.width;
  16. var SH = Stage.height;
  17.  
  18. //X軸
  19. LT._x = L._x = LB._x = 10;
  20. T._x = B._x = fiftyPer._x = SW/2;
  21. RT._x = R._x = RB._x = SW-10;
  22.  
  23. //Y軸
  24. LT._y = T._y = RT._y = 10;
  25. L._y = R._y = fiftyPer._y = SH/2;
  26. LB._y = B._y = RB._y = SH - 10;
  27.  
  28. //拡大縮小
  29. fiftyPer.box._width = SW/2;
  30. fiftyPer.box._height = SH/2;
  31. }
  32. //リスナーオブジェクトをイベントリスナーに登録
  33. Stage.addListener(myListener);

Report this snippet 

You need to login to post a comment.