Jump to content
Search Community

ajmeraviglia

Members
  • Posts

    7
  • Joined

  • Last visited

ajmeraviglia's Achievements

0

Reputation

  1. Hi. I dont' know if this can be useful for someone, but I started to find solutions for the problems I had in October and I want to post them in case It can be helpful. Using loops and arrays is simplifying a lot the code I am using. Instead of writng the same code over and over for each button I am doing this: import com.greensock.*; import com.greensock.easing.*; //Initial status of Buttons and Mc's TweenMax.to(MC1,0.1,{_alpha:100}); TweenMax.to(BT1, 0.1, {_alpha:0}); TweenMax.to(MCBolo1,0.1,{_alpha:100}); TweenMax.to(MCVara1,0.1,{_alpha:100}); BT1.enabled = false; //Estado de los botones de interface. Buttons status for (i = 0; i < 9; i++) { this["BT" + i].onRelease = function(){ selec = Number(this._name.slice(2)); alfear(); }; } function alfear() { for (i = 0; i < 9; i++) { TweenMax.to(this["MC"+i],0.3,{_alpha:0}); TweenMax.to(this["MCBolo"+i],0.3,{_alpha:0}); TweenMax.to(this["MCVara"+i],0.3,{_alpha:0}); TweenMax.to(this["BT" + i],0.3,{_alpha:100}); this["BT" + i].enabled = true; } this["BT" + selec].enabled = false; TweenMax.to(this["MC" + selec],0.3,{_alpha:100}); TweenMax.to(this["MCBolo"+selec],0.3,{_alpha:100}); TweenMax.to(this["MCVara"+selec],0.3,{_alpha:100}); TweenMax.to(this["BT"+selec],0.3,{_alpha:0}); } //Changing the size of circles and bars A_escalar=new Array(0,125,121,113,110,92,106,95,93); for (i = 0; i < 9; i++) { TweenMax.to(this["MCBolo"+i],0.3,{_xscale:A_escalar[i], _yscale:A_escalar[i],ease:Quart.easeOut}); } A_alargar=new Array(0,231,139,139,0,277,332,63,554); for (i = 0; i < 9; i++) { TweenMax.to(this["MCVara"+i],0.3,{_xscale:A_alargar[i],ease:Quart.easeOut}); } This is not perfect, as can be seen in the .fla: I haven't been able to make it work for just one MCBolo and one MCVara, so I have to bear those ugly alpha transitions between MCBolo1 and 2 and so on, and between MCVara1 and 2 and so on. And I haven't been able to use different values for duration. Even using different functions for the different tweenings it will always use the first it reads. But it is better than it was just a month ago and I am working on it. Hope it can help somebody. Thank you for your work, Alejandro.
  2. Ok. I will work on it for a while. I understand what you say about building systems for me. In fact, I know the main problem resides in a poor level of AS. If I ever get to a solution I will share it here in case it is useful for anybody. Or if a have a more concrete doubt maybe I ask again. Thank you again for your time, anyway. I can use the first solution while I try something for the other problem. Alejandro
  3. This works well when a button acts on one propperty of one MC. I did'nt think about it when I made the Ejemplo, but what if the same button must change two different propperties in two different MC? In Ejemplo02 I want Btn01 to change MC01's alpha and MC04 position all at the same time. Is there a way to make three, four... properties, each one in a different MC and with one button, using a similar code? That's what I need to do. Thank you for your help. Alejandro
  4. ¡¡¡Impresionante!!! Thank you very much. This will save me a lot of work.
  5. Hi, In the example (Ejemplo.fla) I send I have made a number of movieclips that go from alpha:100 to alpha:20 when you click the adequate button. One movieclip changes its alpha to 20 while the rest goes to alpha:100. Is there a way to avoid writing all the alpha that don’t change for each button? Instead of: Btn01.onRelease = function():Void { var twMove:TweenMax = new TweenMax.to(MC1,0.1,{_alpha:20}); TweenMax.to(MC2,0.1,{_alpha:100}); TweenMax.to(MC3,0.1,{_alpha:100}); …and so on for each MC } And so for each button, Say, for example, MC1 go to alpha 20; all the rest of MCs go to alpha:100? With conditionals, for example? Thank you. Alejandro
  6. It works great!!! Thank you very much for your help. I am sorry I did not explain the problem in an easier way, I'l try to do better in the future. I am unexperienced at this moment in AS coding. I understand the code you sent me from a (let's say) logical point of view, but I will try to find more information to understand it better (and, maybe, use them to create other things in the future). Thank you again. Alex.
  7. Hello, I am spending my summer holidays trying to get familiar with TweenMax, which I think is a great code, and I find myself in a dead end situation at this moment. If you look at the .fla file I have included, you will see Symbol_1 has a rollover-rollout effect (Symbol_2 just does its task, and doesn’t have this effect). I have not been able to do this just writing code (and I have tried anything I could figure with the skills I have at this moment) and I had to use a fake Symbol_1_fk that appears and disappears at the right moments. When I tried to do this with code, this line: Txt_Symbol_1.onRelease = function(){ var twMove1:TweenMax = new TweenMax.to(Txt_Symbol_1, 0.1, {_alpha:100}); } affected all lines regarding Symbol_1’s alpha, and overwrite : int did not help. I don’t want to use a button, which on the other side would not help, either. ¿How can I do this? Thank you very much for your work and your help. Greetings from Spain. Alejandro Meraviglia.
×
×
  • Create New...