[mtasc] Relative references in MTASC
Xavi Marín
xavierm at iws.es
Wed Jun 21 13:48:00 CEST 2006
Hi Paolo,
and Tuto.swf must exists with the MC library element, build with swfmill
perhaps....
The mtasc inject the new code to the existing swf file
Salut!
Xavi Marín
Paolo Speroni wrote:
> Dear all, I have the following problem:
>
> I want to dinamically configure a Flash movie (built using Macromedia
> Flash 8 or Swfmill) using actionscript code; in other words there is a
> main .SWF file (with all the classes in the library) with an empty
> first frame and a /loadClip/ function that have to load the external
> .SWF file made using MTASC
>
> I have a serius problem becouse to dinamically configure a page I have
> to use, for example, the /attachMovie/ function;
> Unfortunatly if I compile the following actionscript code:
>
>
> class Tuto {
> static var app : Tuto;
>
> function Tuto() {
> attachMovie("MC","MC1",1)
> MC._x=48
> MC.AR._alpha=40
> MC.BR._alpha=255
> }
>
> static function main(mc) {
> app = new Tuto();
> }
> }
>
> the following error is reported:
>
> / type error Tuto have no field attachMovie/
>
>
> If I attach the "_root" indication, everything works ok and the main
> movie acts exactly as I'm expecting:
>
>
> class Tuto {
>
> static var app : Tuto;
>
> function Tuto() {
> _root.attachMovie("MC","MC1",1)
> _root.MC._x=48
> _root.MC.AR._alpha=40
> _root.MC.BR._alpha=255
> }
>
> static function main(mc) {
> app = new Tuto();
> }
> }
>
>
> but unfortunatly I can't use absolute references (like "_root.MC...").
> I tryed attaching "_parent" and "this" (for example:
> /this.attachmovie/...), but an error is reported.
>
> I've tried many ways but unfortunatly nothing work :( ..Please help me
>
> Paolo
More information about the mtasc
mailing list