Re: [Flashcoders] AS3 newbie question: how can I correct this to makean object appear on the stage?
First you are not importing your mybox class correctly. Second, the external class should start with a capital (MyBoxx.as). Third, your declaration of the instance is incorrect for how you have it setup. import myBoxxflash; var myBoxx:MyBoxx = new MyBoxx(); addChild(myBoxx); Your external class needs some work as well. I would read up on some tutorials on how to implement external Classes. -Original Message- From: Paul Freedman p...@freedmania.com Date: Fri, 11 Jun 2010 19:21:55 To: Flash Coders Listflashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3 newbie question: how can I correct this to make an object appear on the stage? I don't understand why this doesn't work... I have a MovieClip, myClass.fla, with one symbol in the library, myBox_mc. Frame 1 of myClass.fla has the following actions: import flash.display.MovieClip; var myBoxx:MovieClip = MovieClip(myBox_mc); addChild(myBoxx); The symbol is exported for ActionScript. Its class remains myBox_mc. Its base class has been changed to myBoxx. The classPath has been properly configured and ends in the classes folder. myBoxx.as is in this folder. The contents of myBoxx.as are: package { import flash.display.MovieClip; public class myBoxx extends MovieClip { public function myBoxx(m:MovieClip) { trace(09myBoxx parent +this.parent); var dmc:MovieClip = m.MovieClip(myBox_mc); m.addChild(dmc); } } } When I run this, I get:Symbol myBox_mcerror #1023No default construtor found in base class myBoxx. I can't find any other example, or any lesson that tells me what's wrong. Any help would be greatly appreciated. Thanks, - Paul ___ 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
Re: [Flashcoders] AS3 newbie question: how can I correct this to makean object appear on the stage?
To supplement Nathan's answer: I think the common thing that is tricky to note for people transitioning from AS2 to AS3: Your library objects with 'Linkage' are now AS3 Classes that (with the default setting) extend MovieClip. You need to instantiate this new class to create an instance of your linked symbol. -jonathan On Fri, Jun 11, 2010 at 4:52 PM, Nathan Mynarcik nat...@mynarcik.comwrote: First you are not importing your mybox class correctly. Second, the external class should start with a capital (MyBoxx.as). Third, your declaration of the instance is incorrect for how you have it setup. import myBoxxflash; var myBoxx:MyBoxx = new MyBoxx(); addChild(myBoxx); Your external class needs some work as well. I would read up on some tutorials on how to implement external Classes. -Original Message- From: Paul Freedman p...@freedmania.com Date: Fri, 11 Jun 2010 19:21:55 To: Flash Coders Listflashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3 newbie question: how can I correct this to make an object appear on the stage? I don't understand why this doesn't work... I have a MovieClip, myClass.fla, with one symbol in the library, myBox_mc. Frame 1 of myClass.fla has the following actions: import flash.display.MovieClip; var myBoxx:MovieClip = MovieClip(myBox_mc); addChild(myBoxx); The symbol is exported for ActionScript. Its class remains myBox_mc. Its base class has been changed to myBoxx. The classPath has been properly configured and ends in the classes folder. myBoxx.as is in this folder. The contents of myBoxx.as are: package { import flash.display.MovieClip; public class myBoxx extends MovieClip { public function myBoxx(m:MovieClip) { trace(09myBoxx parent +this.parent); var dmc:MovieClip = m.MovieClip(myBox_mc); m.addChild(dmc); } } } When I run this, I get:Symbol myBox_mcerror #1023No default construtor found in base class myBoxx. I can't find any other example, or any lesson that tells me what's wrong. Any help would be greatly appreciated. Thanks, - Paul ___ 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 -- -jonathan howe ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] AS3 newbie question: how can I correct this to makean object appear on the stage?
I would also suggest posting only to one mailing list first. This would help ghost threads from being created. Besides, I think most of us are subscribed to both and both lists have many helpful people on them to provide you solutions. Good luck. -Original Message- From: Paul Freedman p...@freedmania.com Date: Fri, 11 Jun 2010 19:21:55 To: Flash Coders Listflashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3 newbie question: how can I correct this to make an object appear on the stage? I don't understand why this doesn't work... I have a MovieClip, myClass.fla, with one symbol in the library, myBox_mc. Frame 1 of myClass.fla has the following actions: import flash.display.MovieClip; var myBoxx:MovieClip = MovieClip(myBox_mc); addChild(myBoxx); The symbol is exported for ActionScript. Its class remains myBox_mc. Its base class has been changed to myBoxx. The classPath has been properly configured and ends in the classes folder. myBoxx.as is in this folder. The contents of myBoxx.as are: package { import flash.display.MovieClip; public class myBoxx extends MovieClip { public function myBoxx(m:MovieClip) { trace(09myBoxx parent +this.parent); var dmc:MovieClip = m.MovieClip(myBox_mc); m.addChild(dmc); } } } When I run this, I get:Symbol myBox_mcerror #1023No default construtor found in base class myBoxx. I can't find any other example, or any lesson that tells me what's wrong. Any help would be greatly appreciated. Thanks, - Paul ___ 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
Re: [Flashcoders] AS3 newbie question: how can I correct this to makean object appear on the stage?
I don't spend as much time on these lists as perhaps I should. I had to creep through this process very carefully before I could see the logic. I'd been following the AS3 lessons in Lynda. While they include all the basic information, they give very little instruction on the nuts-and-bolts of interrelating Classes with graphic elements. If there are other tutorials with more, clearer examples or lessons on the subject, I'd love to see them. Thanks very much, both of you. - Paul - Original Message - From: jonathan howe jonathangh...@gmail.com To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Friday, June 11, 2010 8:18 PM Subject: Re: [Flashcoders] AS3 newbie question: how can I correct this to makean object appear on the stage? To supplement Nathan's answer: I think the common thing that is tricky to note for people transitioning from AS2 to AS3: Your library objects with 'Linkage' are now AS3 Classes that (with the default setting) extend MovieClip. You need to instantiate this new class to create an instance of your linked symbol. -jonathan On Fri, Jun 11, 2010 at 4:52 PM, Nathan Mynarcik nat...@mynarcik.comwrote: First you are not importing your mybox class correctly. Second, the external class should start with a capital (MyBoxx.as). Third, your declaration of the instance is incorrect for how you have it setup. import myBoxxflash; var myBoxx:MyBoxx = new MyBoxx(); addChild(myBoxx); Your external class needs some work as well. I would read up on some tutorials on how to implement external Classes. -Original Message- From: Paul Freedman p...@freedmania.com Date: Fri, 11 Jun 2010 19:21:55 To: Flash Coders Listflashcoders@chattyfig.figleaf.com Subject: [Flashcoders] AS3 newbie question: how can I correct this to make an object appear on the stage? I don't understand why this doesn't work... I have a MovieClip, myClass.fla, with one symbol in the library, myBox_mc. Frame 1 of myClass.fla has the following actions: import flash.display.MovieClip; var myBoxx:MovieClip = MovieClip(myBox_mc); addChild(myBoxx); The symbol is exported for ActionScript. Its class remains myBox_mc. Its base class has been changed to myBoxx. The classPath has been properly configured and ends in the classes folder. myBoxx.as is in this folder. The contents of myBoxx.as are: package { import flash.display.MovieClip; public class myBoxx extends MovieClip { public function myBoxx(m:MovieClip) { trace(09myBoxx parent +this.parent); var dmc:MovieClip = m.MovieClip(myBox_mc); m.addChild(dmc); } } } When I run this, I get:Symbol myBox_mcerror #1023No default construtor found in base class myBoxx. I can't find any other example, or any lesson that tells me what's wrong. Any help would be greatly appreciated. Thanks, - Paul ___ 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 -- -jonathan howe ___ 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