Hi,

Could you try the following ? (you were doing addChild on 'mcHatAndFace' class, but I know you want the instance to be added to the display list, not its class)

Main.as:

package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
    {
    public function Main():void
      {
      trace("Main class is initialized");
    }

   public function init():void
      {
        trace("Main.init is being called... let's see what happens now...");
      var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
      TweenPlugin.activate([AutoAlphaPlugin]);
      addChild(mcHatAndFaceInstance);
      mcHatAndFaceInstance.x = 100;
      mcHatAndFaceInstance.y = 100;
      mcHatAndFaceInstance.alpha = 0;
      TweenLite.to(mcHatAndFaceInstance, 1, {autoAlpha:1});
    }
  }
}

now, somewhere in your FLA (where you have the mcHatAndFace symbol), just for testing purposes:

1) remove all the code (document class, or timeline code)
2) add the following on frame 1

var main:Main = new Main();
addChild(main);
main.init();

hth,
Cedric


package
{
  import flash.display.MovieClip;
  import com.greensock.*;
  import com.greensock.plugins.*;
  import com.greensock.easing.*;
  public class Main extends MovieClip
    {
    public function Main():void
      {
      var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
      TweenPlugin.activate([AutoAlphaPlugin]);
      var mcHatAndFace = new MovieClip();
      this.addChild(mcHatAndFace);
      mcHatAndFace.x = 100;
      mcHatAndFace.y = 100;
      mcHatAndFace.alpha = 0;
TweenLite.to(mcHatAndFace, 1, {autoAlpha:1}); // 2nd param in seconds;
3rd in % alpha
      var main:Main = new Main();
      addChild(main);
      main.mcHatAndFace();
    }
  }
}

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to