Hiya, I've started compiling using MTASC from Textmate using the 'Build with MTASC' option. I'm using the XTraceTest.as file (at the bottom) and it compiles great.
What I can't figure out is how to target the Stage from my class, if I have movieclips on there that I want to target for example. I can target the _root but this isn't ideal.
Any suggestions much appreciated
Cheers :) Ali
import com.mab.util.debug;
class XTraceTest extends MovieClip{ static function main() { debug.waitForSocketConnection = true; debug.initSocket("127.0.0.1"); debug.trace("Yo, whaz upppppp:?"); debug.trace("This is a really really really really really really really really really really really long string"); debug.trace("[DEBUG] This is a debug string"); debug.trace("[WARN] This is a warning"); debug.trace("[NORMAL] This is a normal formatter string"); debug.trace("[CRITICAL] This is a critical warning"); for(var a = 0; a < 10; a++) {//say hi 10 times debug.trace("Hi server! " + a); } var testOb = {question:"Are you cool?", response:"Of course!"}; debug.dumpObject(testOb); } }
-------------------------------------------------------------------------- Alistair Colling Interactive Developer
FPP Brand Communications (Newcastle upon Tyne) The Courtyard Dinsdale Place Sandyford Newcastle upon Tyne NE2 1BD Telephone: +44 (0)191 261 6662 Fax: +44 (0)191 233 2511
This transmission is confidential and intended solely for the person or organisation to whom it is addressed. It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action in reliance on it. If you have received this transmission in error, please notify the sender at the e-mail address above. FPP Design Limited. Reg. Office: The Courtyard, Dinsdale Place, Sandyford, Newcastle upon Tyne NE2 1BD. Registered Number 3775564. Registered in England and Wales. Visit our website at http://www.fpp.net/
in object oriented programing, objects on the stage are not used, so ideal is to attach them from library and give them a reference. and because you switched to mtasc i suppose you want to do OOP. i recomend you to use haXe instead anyway, mtasc is not developed anymore.
On Fri, May 23, 2008 at 2:47 PM, Alistair Colling alistair.colling@fpp.net wrote:
Hiya, I've started compiling using MTASC from Textmate using the 'Build with MTASC' option. I'm using the XTraceTest.as file (at the bottom) and it compiles great.
What I can't figure out is how to target the Stage from my class, if I have movieclips on there that I want to target for example. I can target the _root but this isn't ideal.
Any suggestions much appreciated
Cheers :) Ali
import com.mab.util.debug;
class XTraceTest extends MovieClip{ static function main() { debug.waitForSocketConnection = true; debug.initSocket("127.0.0.1"); debug.trace("Yo, whaz upppppp:?"); debug.trace("This is a really really really really really really really really really really really long string"); debug.trace("[DEBUG] This is a debug string"); debug.trace("[WARN] This is a warning"); debug.trace("[NORMAL] This is a normal formatter string"); debug.trace("[CRITICAL] This is a critical warning");
for(var a = 0; a < 10; a++) {//say hi 10 times debug.trace("Hi server! " + a); } var testOb = {question:"Are you cool?", response:"Of
course!"}; debug.dumpObject(testOb); }
}
Alistair Colling Interactive Developer
FPP Brand Communications (Newcastle upon Tyne) The Courtyard Dinsdale Place Sandyford Newcastle upon Tyne NE2 1BD Telephone: +44 (0)191 261 6662 Fax: +44 (0)191 233 2511
This transmission is confidential and intended solely for the person or organisation to whom it is addressed. It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action in reliance on it. If you have received this transmission in error, please notify the sender at the e-mail address above.FPP Design Limited. Reg. Office: The Courtyard, Dinsdale Place, Sandyford, Newcastle upon Tyne NE2 1BD.Registered Number 3775564. Registered in England and Wales. Visit our website at http://www.fpp.net/
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
If you are using the -main flag in MTASC (if you are using the AS2 bundle it's on by default) your main() method will be called with a parameter, like this:
class YourApp { static function main(mc:MovieClip){ // mc is the Stage, equivalent to _root most of the time. } }
Thus, you can target _root by setting a variable in your class when it is initialized.
Here's the skeleton for 99% of my AS2 projects:
class Foo { var _timeline:MovieClip; function Foo(timeline){ _timeline = timeline; } static function main(tl:MovieClip){ var app:Foo = new Foo(tl); } }
For more info, I'd suggest checking the MTASC list: http://lists.motion-twin.com/mailman/listinfo/mtasc
About MTASC not being developed anymore... the project is alive, and the maintainer is rather active on the mailing list. The thing is MTASC is pretty much finished (it's solid as a rock, fast, and no known bugs exist on the code) and AS2 is not going to change, so there's no reason for development to "happen" : )
If you already know AS2 or need to mantain "old" code, there is no reason not to use MTASC.
Thanks for your reply Ale, I've got this working by placing this code in my fla then publishing the swf:
import Foo; var myF = new Foo(this);
I now can publish from Textmate, debug in XTrace and add graphic elements to my FLA, its great ! :) Thanks, Ali
On 23 May 2008, at 22:46, Ale Muñoz wrote:
If you are using the -main flag in MTASC (if you are using the AS2 bundle it's on by default) your main() method will be called with a parameter, like this:
class YourApp { static function main(mc:MovieClip){ // mc is the Stage, equivalent to _root most of the time. } }
Thus, you can target _root by setting a variable in your class when it is initialized.
Here's the skeleton for 99% of my AS2 projects:
class Foo { var _timeline:MovieClip; function Foo(timeline){ _timeline = timeline; } static function main(tl:MovieClip){ var app:Foo = new Foo(tl); } }
For more info, I'd suggest checking the MTASC list: http://lists.motion-twin.com/mailman/listinfo/mtasc
About MTASC not being developed anymore... the project is alive, and the maintainer is rather active on the mailing list. The thing is MTASC is pretty much finished (it's solid as a rock, fast, and no known bugs exist on the code) and AS2 is not going to change, so there's no reason for development to "happen" : )
If you already know AS2 or need to mantain "old" code, there is no reason not to use MTASC.
-- Ale Muñoz http://sofanaranja.com http://bomberstudios.com<ATT00001>
-------------------------------------------------------------------------- Alistair Colling Interactive Developer
FPP Brand Communications (Newcastle upon Tyne) The Courtyard Dinsdale Place Sandyford Newcastle upon Tyne NE2 1BD Telephone: +44 (0)191 261 6662 Fax: +44 (0)191 233 2511
This transmission is confidential and intended solely for the person or organisation to whom it is addressed. It may contain privileged and confidential information. If you are not the intended recipient, you should not copy, distribute or take any action in reliance on it. If you have received this transmission in error, please notify the sender at the e-mail address above. FPP Design Limited. Reg. Office: The Courtyard, Dinsdale Place, Sandyford, Newcastle upon Tyne NE2 1BD. Registered Number 3775564. Registered in England and Wales. Visit our website at http://www.fpp.net/