1) Just open your FLA in Flash IDE
2) In the PUBLISH panel, you have a textfield input named "Class:
" <--- this is the document class, just leave it blank
3) retest with the revised code
hth,
Cedric
On Tue, Nov 17, 2009 at 6:21 AM, Henrik Andersson
<he...@henke37.cjb.net>wrote:
beno - wrote:
Error: Error #2136: The SWF file<file> contains invalid data at
Main/frame1()
The flash player does not like you creating a new instance of a
class that
is the document class for a swf.
How is "public function:init():void;" creating a new instance of a
class
that is the document class for a swf? Is init() defined as such a
class?
Here is the revised code:
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});
}
}
}
Here is the old code:
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();
}
}
}
Please advise.
beno
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders