(AS2) How to access a symbol from inside a class extends movieclip?
I created a movieclip symbol and exported to actionscr开发者_开发问答ipt, I created the .as file:
class BRIQUE extends MovieClip
{
function BRIQUE()
{
graphics._x=10;
}
}
"graphics" is an image imported on the stage inside my symbol, but it seems not to be accessible this way (I get an error), nevertheless it works this way in as3 then what is the right way in as2 ?
Thanks
in AS3 there is an option in Flash that says something like "automatically declare every instance on stage in my class" so Flash adds the public var graphics:MovieClip automatically. i think in AS2 you have to do this manually.
AND please use a different name for the variable - graphics is an built-in thing.
class BRIQUE extends MovieClip
{
public var mygraphic:MovieClip
function BRIQUE()
{
mygraphic._x=10;
}
}
加载中,请稍侯......
精彩评论