Advertisement
Guest User

Untitled

a guest
May 27th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. com.greensock importação .*;
  2. com.greensock.easing importação .*;
  3.  
  4. / Ajustar / o Fundo
  5. flash.display.Stage de importação;
  6. flash.display.StageScaleMode de importação;
  7. flash.display.StageAlign de importação;
  8. flash.system.Capabilities de importação;
  9.  
  10. velocidadeX var: Number = 2;
  11.  
  12. / / CRIA OS X com constante Valores e Y da Resolução da Tela do Sistema.
  13. const TelaX = Capabilities.screenResolutionX;
  14. const TelaY = Capabilities.screenResolutionY;
  15.  
  16. Stage.scaleMode = StageScaleMode.NO_SCALE;
  17. stage.align = StageAlign.TOP_LEFT;
  18.  
  19. / / Inicializa Valores parágrafo Tamanho dos Objetos sem palco Baseado nd Resolução da Tela
  20. flores.width TelaX *. = 8;
  21. flores.height TelaY *. = 4;
  22. logo_mc.width TelaX *. = 3;
  23. logo_mc.height TelaY *. = 1;
  24. menu_mc.width TelaX *. = 3;
  25.  
  26.  
  27. stage.addEventListener ("resize" arrumaLayout);
  28.  
  29.  
  30.  
  31. arrumaLayout função (e: Event = null): void (
  32. stage.stageWidth fundo_mc.width =;
  33. stage.stageHeight fundo_mc.height =;
  34.  
  35.  
  36. / / Posicionando como flores
  37. TweenLite.to (Flores, 2, (x: stage.stageWidth / 2, y: * TelaY 0.1, a facilidade: Elastic.easeOut));
  38.  
  39. / / Posicionar escalonar e um logotipo
  40. TweenLite.to (logo_mc, 2, (x: stage.stageWidth / 2, y: TelaY *. 02, facilidade: Bounce.easeOut));
  41.  
  42. / Posicionar / e escalonar o menu
  43. TweenLite.to (menu_mc, 3, (x: stage.stageWidth / 2, y: * TelaY 0.2, a facilidade: Bounce.easeOut));
  44.  
  45. / / Posicionando barra um
  46. stage.stageWidth barra_mc.width =;
  47. TweenLite.to (barra_mc, 1, (y: stage.stageHeight, facilidade: Elastic.easeOut));
  48.  
  49. / Posicionar / e animar o Endereço
  50. TweenLite.to (endereco_mc, 2, (y: stage.stageHeight, facilidade: Bounce.easeOut));
  51.  
  52. / / Chama funcao ajusta parágrafo arrumar uma galeria
  53. ajusta ();
  54. )
  55.  
  56.  
  57. var container: MovieClip = new MovieClip ();
  58. addChild (container);
  59.  
  60. / / Criei esse mês quadradro tão parágrafo teste simulando uma galeria
  61. / Quad / var: Quadrado Quadrado = new ();
  62. / / Container.addChild (quad);
  63. / FIM / do quadrado
  64.  
  65. var loader: Loader;
  66.  
  67.  
  68. menu_mc.home.addEventListener (MouseEvent.CLICK, chama);
  69. / Menu_mc.empresa.addEventListener / (MouseEvent.CLICK, chama);
  70. / Menu_mc.colecao.addEventListener / (MouseEvent.CLICK, chama);
  71. / Menu_mc.contato.addEventListener / (MouseEvent.CLICK, chama);
  72.  
  73. chama de função (e: MouseEvent): void (
  74. e.target.name switch () (
  75. casa "caso":
  76. if (carregador! = null) (
  77. container.removeChild (carregador);
  78. loader = null;
  79. )
  80. loader = novo Loader ();
  81. loader.load (novo URLRequest ("galeria_3D.swf"));
  82. break;
  83. )
  84.  
  85. loader.contentLoaderInfo.addEventListener (Event.COMPLETE, carregou);
  86. )
  87.  
  88. carregou função (e: Event): void (
  89. container.addChild (carregador);
  90. ajusta ();
  91. )
  92.  
  93. ajusta a função (): void (
  94.  
  95. / / Para a POSIÇÃO variáveis X e Y da galeria
  96. contX var: Number;
  97. Conty var: Number;
  98.  
  99. / / Tamanho da galeria vai Ser uma altura do palco - POSIÇÃO do menu - Um Pouco Maior Que Tamanho da barra_mc
  100. container.height = stage.stageHeight - (TelaY * 0,25) - (barra_mc.height * 1.1);
  101.  
  102. / Ajusto / a com uma largura manter parágrafo altura uma Proporção
  103. container.scaleX = container.scaleY;
  104.  
  105. / Valor / de X não vai Ser centro do palco
  106. contX = * stage.stageWidth 0,5;
  107.  
  108. / Valor / de Y vai Ser. Abaixo do menu e acima da barra_mc
  109. Conty = (container.height * 0.5) + (TelaY * 0,25);
  110.  
  111. / / N º POSIÇÃO movo corretra
  112. TweenLite.to (container, 4, (x: contX, y: Conty, a facilidade: Elastic.easeOut));
  113. )
  114.  
  115. endereco_mc.addEventListener (Event.ENTER_FRAME, _pronto);
  116. função _pronto (e: Event): void (
  117. endereco_mc.x + = velocidadeX;
  118. if (> = endereco_mc.x stage.stageWidth-540) (
  119. velocidadeX *=- 1;
  120. ) Else if <(endereco_mc.x = 0) (
  121. velocidadeX *=- 1;
  122. )
  123. )
  124.  
  125. arrumaLayout ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement