3 Replies Latest reply on Aug 19, 2009 10:06 AM by Ned Murphy

    Newbie question - using Tween via ActionScript

    Orzb

      Let me start by saying that I'm completely new to Flash, so I will not be at all offended if you phrase your response as though I were eight years old. In fact, I'd quite likely appreciate it.

       

      I'm trying to recreate a simple Flash animation that someone made for me in the past. I thought I had a handle on what was going on in it, but it seems there's a piece I'm missing. Basically, there are three images (actually movie clips) covered by buttons (also movie clips). When a button is clicked, the image beneath it fades into view. There are also three other buttons, one per image, that cause this same thing to happen.

       

      So, I recreated the original file using new images. I created each instance of each movie clip that was present in the original file, and named each of them the same, and set the properties to match. I then copied the ActionScript code from the original to the new one, and ran the debugger. The code is as follows:

       

      import mx.transitions.Tween;
      import mx.transitions.easing.*;
      txt1._alpha=txt2._alpha=txt3._alpha=0;
      click1.onRelease=pclick1.onRelease=function()
      {
        click1._visible=pclick1._visible=false;
        var xScaleT:Tween = new Tween(exp1, "_alpha", Strong.easeOut, 100, 0, 2, true);      
        var xScaleT:Tween = new Tween(txt1, "_alpha", Strong.easeOut, 0, 100, 2, true);
      }

       

      click2.onRelease=pclick2.onRelease=function()
      {
         click2._visible=pclick2._visible=false;
         var xScaleT:Tween = new Tween(exp2, "_alpha", Strong.easeOut, 100, 0, 2, true);      
         var xScaleT:Tween = new Tween(txt2, "_alpha", Strong.easeOut, 0, 100, 2, true);
      }

       

      click3.onRelease=pclick3.onRelease=function()
      {
         click3._visible=pclick3._visible=false;
         var xScaleT:Tween = new Tween(exp3, "_alpha", Strong.easeOut, 100, 0, 2, true);      
         var xScaleT:Tween = new Tween(txt3, "_alpha", Strong.easeOut, 0, 100, 2, true);
      }

       

      When I ran this movie, I received five of the error "A conflict exists with definition xScaleT in namespace internal".

       

      Googling this error led me to believe that it was due to all the declarations having the same name (notwithstanding that this same error doesn't pop up when the original movie is run), so I changed them to xScaleT1, xScaleT2, etc. Doing that got rid of the "conflict exists" errors, but I now get:

       

      1172: Definition mx.transitions:Tween could not be found.
      1172: Definition mx.transition:easing could not be found.

       

      ...and then a bunch of type and property not found errors that I assume stem off its inability to find the above two definitions.

       

      Why doesn't this happen when I run the original movie, and how do I go about fixing it? Is there some declaration or class code I missed copying from the original? Any advice is appreciated. Thanks.