Hi;
Okay, I have this as code in the first frame of a timeline:
var main:Main = new Main();
addChild(main);
main.init();
main.another();
I have this code in 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");
}
public function init():void
{
trace("init");
var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
TweenPlugin.activate([AutoAlphaPlugin]);
addChild(mcHatAndFaceInstance);
mcHatAndFaceInstance.x = 350;
mcHatAndFaceInstance.y = 100;
mcHatAndFaceInstance.alpha = 0;
TweenLite.to(mcHatAndFaceInstance, 1, {autoAlpha:1});
}
public function another():void
{
var mcHandInstance:mcHand = new mcHand();
addChild(mcHandInstance);
mcHand.x = 400;
mcHand.y = 400;
}
}
}
This throws errors concerning mcHand and no traces are printed. When I take
out public function another():void and the call to the same in the code from
the timeline, everything works and the traces are printed as well. Why is
this? I also tried putting the mcHand code in the init() function and that
didn't work. Why?
TIA,
beno
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders