Re: [Swftools-common] Class definition with swfc
Here is an .sc example of what I would like to do (this is just an example, this code doesn't make much sense) : .flash bbox=150x150 version=7 name=test.swf .circle button_circle r=8 line=0 fill=#808080 .button button .show button_circle as=shape .show button_circle as=hover .show button_circle as=pressed .end .put b1=button x=0 y=0 .put b2=button x=16 y=0 .action: class myclass { var field1; var field2; } _root.b1.onRelease = function() { trace(Button 1 pressed); }; _root.b2.onRelease = function() { trace(Button 2 pressed); }; .end .end I am using swftools 0.9.0 and when I issue a swfc example.sc, I obtain : error: class myclass ^ Line 3: Reason: 'syntax error' I guess this is not the right way to define a class but I could not manage to find any proper way. P.Y. Rollo a écrit : Hello, First, thanks a lot for swftools! I've just discovered that swftools makes flash development possible under Linux. There is something I can't figure out how to do : How to define and use custom classes when using a .sc file and swfc compiler? When using the class keyword in a .action section of an .sc file, I always obtain a syntax error. The same code in a .as file works well using mtasc compiler. I'm trying that with flash=7 version. I read, in the Adobe reference documentation, that there should be one class per file, so I should have one .as file per class and one .sc file including/importing/using them. I tried to compile .as files into .swf files and then swfcombine them, or even .swf them in my .sc files but I could not use my classes in the .action sections. Does anyone have a idea of how to do that ? Thanks, P.Y. Rollo
Re: [Swftools-common] Class definition with swfc
Here is an .sc example of what I would like to do (this is just an example, this code doesn't make much sense) : .flash bbox=150x150 version=7 name=test.swf .circle button_circle r=8 line=0 fill=#808080 .button button .show button_circle as=shape .show button_circle as=hover .show button_circle as=pressed .end .put b1=button x=0 y=0 .put b2=button x=16 y=0 .action: class myclass { var field1; var field2; } _root.b1.onRelease = function() { trace(Button 1 pressed); }; _root.b2.onRelease = function() { trace(Button 2 pressed); }; .end .end I am using swftools 0.9.0 and when I issue a swfc example.sc, I obtain : error: class myclass ^ Line 3: Reason: 'syntax error' I guess this is not the right way to define a class but I could not manage to find any proper way. P.Y. Rollo a écrit : Hello, First, thanks a lot for swftools! I've just discovered that swftools makes flash development possible under Linux. There is something I can't figure out how to do : How to define and use custom classes when using a .sc file and swfc compiler? When using the class keyword in a .action section of an .sc file, I always obtain a syntax error. The same code in a .as file works well using mtasc compiler. I'm trying that with flash=7 version. I read, in the Adobe reference documentation, that there should be one class per file, so I should have one .as file per class and one .sc file including/importing/using them. I tried to compile .as files into .swf files and then swfcombine them, or even .swf them in my .sc files but I could not use my classes in the .action sections. Does anyone have a idea of how to do that ? Thanks, P.Y. Rollo