Hi Beno,
I think you are close ... but far :S, but close :)
public class Main extends MovieClip <--- this is your class declaration
public function Main ():void <--- this is your class's constructor
(first thing being called when you do a 'var main:Main = new Main()'
class mcHatAndFace <-- this is not a class, it is just a method of
your Main's class, hence you should write it:
public function mcHatAndFace ():void {
// your code goes here...
}
and then you can call this method by simply:
var main:Main = new Main();
addChild(main); <-- you have to add it to the scene since it is an
extended MovieClip
main.mcHatAndFace();
Here is a very nice tutorial on getting started with AS3.
<http://www.senocular.com/flash/tutorials/as3withflashcs3/>
All in all (and more), <http://www.senocular.com/> is a top quality
site when it comes to understanding ActionScript and Flash Player.
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
{
}
}
class mcHatAndFace extends Main
{
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
}
}
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders