Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
ClassFinder is basically that, but not using eval. You're right, it's the same. You can just use your own, as I do. I only mentioned ClassFinder because it was referenced in the thread. Jim Kremens On 2/5/06, Tyler Wright <[EMAIL PROTECTED]> wrote: > > Then you can use classfinder to instantiate them dynamically. > > > I've never seen an mx.utils.ClassFinder ... is it part of the vs. 2 > component set they shipped with MX'04 ? > > All packages and classes are defined on the _global scope. Vs. 2 componets' > EventDispatcher, if included in your swf, can be accessed via > _global.mx.events.EventDispatcher. Seems funny to have a whole ClassFinder > when all you need is > > var newClass:Function = eval("_global." + classPath); > > which is probably what ClassFinder is anyway. It's like the MM remoting > componets, a dozen classes to replace the handful of lines of conveniently > undocumented code. This has nothing to do with this thread, but here's a > freebe for anyone wanting to know how to roll their own remoting. > > var nc:NetConnection = new NetConnection(); > nc.onStatus = function() { ... };// catch the errors > nc.onResult = function() { ... };// receive the results > nc.connect("http://uri.com/gateway.script";); > if (username != undefined && password != undefined) { > nc.addHeader("Credentials", false, {userid:username, > password:password}); > } > // send command to server > nc.call("ClassName.methodName", nc, param1, param2); > > it's pretty simple by itself without the complexities of all the proxies > making it simple. > > uh, that was a bit of a digression. > > Tyler > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Jim Kremens ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
> Then you can use classfinder to instantiate them dynamically. I've never seen an mx.utils.ClassFinder ... is it part of the vs. 2 component set they shipped with MX'04 ? All packages and classes are defined on the _global scope. Vs. 2 componets' EventDispatcher, if included in your swf, can be accessed via _global.mx.events.EventDispatcher. Seems funny to have a whole ClassFinder when all you need is var newClass:Function = eval("_global." + classPath); which is probably what ClassFinder is anyway. It's like the MM remoting componets, a dozen classes to replace the handful of lines of conveniently undocumented code. This has nothing to do with this thread, but here's a freebe for anyone wanting to know how to roll their own remoting. var nc:NetConnection = new NetConnection(); nc.onStatus = function() { ... };// catch the errors nc.onResult = function() { ... };// receive the results nc.connect("http://uri.com/gateway.script";); if (username != undefined && password != undefined) { nc.addHeader("Credentials", false, {userid:username, password:password}); } // send command to server nc.call("ClassName.methodName", nc, param1, param2); it's pretty simple by itself without the complexities of all the proxies making it simple. uh, that was a bit of a digression. Tyler ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
For your classes to be present in the swf, you don't need to import or instantiate them. Just type their fully qualified name somewhere: public function defineDependencies() { com.myClassPath.foo; com.otherClassPath.bar; } Then you can use classfinder to instantiate them dynamically. Jim Kremens On 4 Feb 2006 04:35:30 -, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > If the classes are present in the main movie that is "injected" with the > classes compiled by flash, any symbols in loaded movies that have a symbol > name that matches a class that uses object.register gets the behavior > attached when its loaded, I actually found this by accident and its worked > out very well. > > I don't use shared libraries, I have an lib folder that all my project can > access, even in a team of several flash developers we have found having the > code available in a src folder works better for us than a swf. > > Grant. > > - Original Message - > From: Cedric Muller [EMAIL PROTECTED] > To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com > Sent: 2/3/06 3:26 AM > Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > > > grant, how do you make your classes as shared libraries (for example > > making fx.swf provide the rest of the app with all the available > > classes for transitions, tweens, ...) ? > > I always wondered how mtasc would handle such (I don't have time to > > dig that part...) > > > > cedric > > > > > > > Yes, that's true, but then someone without MTASC cannot compile (it > > > will not work), so if my customer will want sources and want to > > > compile it, it will be problem :) > > > > > > On 3 Feb 2006 06:40:47 -, [EMAIL PROTECTED] > > > wrote: > > >> I do something similar in my arp extensions to force "command" > > >> classes defined in an xml document to be loaded at runtime. I use > > >> the -pack feature of mtasc that forces classes from a package into > > >> your swf. > > >> > > >> so if you wanted force all the classes in com.bluetube.command > > >> into your swf you would pass > > >> -pack com\bluetube\command to mtasc. > > >> > > >> I hate having to put a dummy constructor or fluff in the code to > > >> make it work, I prefer the mtasc approach. > > >> > > >> Grant. > > >> > > >> - Original Message - > > >> From: Cdric_Muller [EMAIL PROTECTED] > > >> To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com > > >> Sent: 2/2/06 7:18 AM > > >> Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > > >> > > >>> but please, remember that this is a Flash Hack with a lot of whack > > >>> and crack :) > > >>> you're welcome! > > >>> cedric > > >>> > > >>>> This works Cedric, thank you very much :) > > >>>> All of you > > >>>> > > >>>> On 2/2/06, Cédric Muller wrote: > > >>>>> in your .as file (main class, or classesManger,...) you can simply > > >>>>> put references to the classes you will/should use ... > > >>>>> > > >>>>> I did it once the following way: > > >>>>> > > >>>>> /** > > >>>>> * setPackagesToImport > > >>>>> * fake method, never gets called. just here for 'import' + > > >>>>> reference > > >>>>> purposes > > >>>>> * > > >>>>> */ > > >>>>> > > >>>>> private function setPackagesToImport ():Void { > > >>>>> sk.sowhat.linuxPlayer. ScreenEffects; > > >>>>> sk.sowhat.linuxPlayer.ScreenVideo; > > >>>>> sk.sowhat.linuxPlayer.Screen; > > >>>>> sk.sowhat.linuxPlayer.HelperFunctions; > > >>>>> // and so on ... > > >>>>> } > > >>>>> > > >>>>> with such, you assure yourself that Flash will include the > > >>>>> classes . not very official, nor clean, but really worked > > >>>>> for me > > >>>>> (as I had to reference the classes paths through xml) > > >>>>> cedric > > >>>>> >
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
If the classes are present in the main movie that is "injected" with the classes compiled by flash, any symbols in loaded movies that have a symbol name that matches a class that uses object.register gets the behavior attached when its loaded, I actually found this by accident and its worked out very well. I don't use shared libraries, I have an lib folder that all my project can access, even in a team of several flash developers we have found having the code available in a src folder works better for us than a swf. Grant. - Original Message - From: Cedric Muller [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 2/3/06 3:26 AM Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > grant, how do you make your classes as shared libraries (for example > making fx.swf provide the rest of the app with all the available > classes for transitions, tweens, ...) ? > I always wondered how mtasc would handle such (I don't have time to > dig that part...) > > cedric > > > > Yes, that's true, but then someone without MTASC cannot compile (it > > will not work), so if my customer will want sources and want to > > compile it, it will be problem :) > > > > On 3 Feb 2006 06:40:47 -, [EMAIL PROTECTED] > > wrote: > >> I do something similar in my arp extensions to force "command" > >> classes defined in an xml document to be loaded at runtime. I use > >> the -pack feature of mtasc that forces classes from a package into > >> your swf. > >> > >> so if you wanted force all the classes in com.bluetube.command > >> into your swf you would pass > >> -pack com\bluetube\command to mtasc. > >> > >> I hate having to put a dummy constructor or fluff in the code to > >> make it work, I prefer the mtasc approach. > >> > >> Grant. > >> > >> ----- Original Message - > >> From: Cdric_Muller [EMAIL PROTECTED] > >> To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com > >> Sent: 2/2/06 7:18 AM > >> Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > >> > >>> but please, remember that this is a Flash Hack with a lot of whack > >>> and crack :) > >>> you're welcome! > >>> cedric > >>> > >>>> This works Cedric, thank you very much :) > >>>> All of you > >>>> > >>>> On 2/2/06, Cédric Muller wrote: > >>>>> in your .as file (main class, or classesManger,...) you can simply > >>>>> put references to the classes you will/should use ... > >>>>> > >>>>> I did it once the following way: > >>>>> > >>>>> /** > >>>>> * setPackagesToImport > >>>>> * fake method, never gets called. just here for 'import' + > >>>>> reference > >>>>> purposes > >>>>> * > >>>>> */ > >>>>> > >>>>> private function setPackagesToImport ():Void { > >>>>> sk.sowhat.linuxPlayer. ScreenEffects; > >>>>> sk.sowhat.linuxPlayer.ScreenVideo; > >>>>> sk.sowhat.linuxPlayer.Screen; > >>>>> sk.sowhat.linuxPlayer.HelperFunctions; > >>>>> // and so on ... > >>>>> } > >>>>> > >>>>> with such, you assure yourself that Flash will include the > >>>>> classes . not very official, nor clean, but really worked > >>>>> for me > >>>>> (as I had to reference the classes paths through xml) > >>>>> cedric > >>>>> > >>>>>> Yes it works > >>>>>> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with > >>>>>> no import) > >>>>>> > >>>>>> this is not problem > >>>>>> > >>>>>> but i create instance dynamicly, i got string in XML > >>>>>> "sk.sowhat.linuxPlayer.play4dogs.Test" > >>>>>> and i need create instance, but application doesnt know which > >>>>>> classes > >>>>>> will be instantiated, so i cannot create instance of all possible > >>>>>> class in initialize phase of application > >>>>>> > >>>>>> > >&
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
If my customer requires source code I give them mtasc, ant and a document on how to run it. Grant. - Original Message - From: franto [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 2/3/06 2:57 AM Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > Yes, that's true, but then someone without MTASC cannot compile (it > will not work), so if my customer will want sources and want to > compile it, it will be problem :) > > On 3 Feb 2006 06:40:47 -, [EMAIL PROTECTED] wrote: > > I do something similar in my arp extensions to force "command" classes > > defined in an xml document to be loaded at runtime. I use the -pack > > feature of mtasc that forces classes from a package into your swf. > > > > so if you wanted force all the classes in com.bluetube.command into your > > swf you would pass > > -pack com\bluetube\command to mtasc. > > > > I hate having to put a dummy constructor or fluff in the code to make it > > work, I prefer the mtasc approach. > > > > Grant. > > > > - Original Message - > > From: Cdric_Muller [EMAIL PROTECTED] > > To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com > > Sent: 2/2/06 7:18 AM > > Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > > > > > but please, remember that this is a Flash Hack with a lot of whack > > > and crack :) > > > you're welcome! > > > cedric > > > > > > > This works Cedric, thank you very much :) > > > > All of you > > > > > > > > On 2/2/06, Cédric Muller wrote: > > > >> in your .as file (main class, or classesManger,...) you can simply > > > >> put references to the classes you will/should use ... > > > >> > > > >> I did it once the following way: > > > >> > > > >> /** > > > >> * setPackagesToImport > > > >> * fake method, never gets called. just here for 'import' + > > > >> reference > > > >> purposes > > > >> * > > > >> */ > > > >> > > > >> private function setPackagesToImport ():Void { > > > >> sk.sowhat.linuxPlayer. ScreenEffects; > > > >> sk.sowhat.linuxPlayer.ScreenVideo; > > > >> sk.sowhat.linuxPlayer.Screen; > > > >> sk.sowhat.linuxPlayer.HelperFunctions; > > > >> // and so on ... > > > >> } > > > >> > > > >> with such, you assure yourself that Flash will include the > > > >> classes . not very official, nor clean, but really worked for me > > > >> (as I had to reference the classes paths through xml) > > > >> cedric > > > >> > > > >>> Yes it works > > > >>> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with > > > >>> no import) > > > >>> > > > >>> this is not problem > > > >>> > > > >>> but i create instance dynamicly, i got string in XML > > > >>> "sk.sowhat.linuxPlayer.play4dogs.Test" > > > >>> and i need create instance, but application doesnt know which > > > >>> classes > > > >>> will be instantiated, so i cannot create instance of all possible > > > >>> class in initialize phase of application > > > >>> > > > >>> > > > >>> > > > >>> On 2/2/06, franto wrote: > > > >>>> but Ian, why it find other classes, i dont instantiate any of > > > >>>> class, > > > >>>> that code you can see in email is everything, and it has found 15 > > > >>>> classes, but 3 doesnt find > > > >>>> > > > >>>> Classes found: 15 > > > >>>> Classes not found: 3 > > > >>>> > > > >>>> Why? > > > >>>> > > > >>>> On 2/2/06, Ian Thomas wrote: > > > >>>>> Hi Franto, > > > >>>>> > > > >>>>> As far as I understand it, 'import' isn't enough to get a class > > > >>>>> compiled > > > >>>>> into your .swf. > > > >>>>> > > > >>>>> The line: > > > >&
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
grant, how do you make your classes as shared libraries (for example making fx.swf provide the rest of the app with all the available classes for transitions, tweens, ...) ? I always wondered how mtasc would handle such (I don't have time to dig that part...) cedric Yes, that's true, but then someone without MTASC cannot compile (it will not work), so if my customer will want sources and want to compile it, it will be problem :) On 3 Feb 2006 06:40:47 -, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I do something similar in my arp extensions to force "command" classes defined in an xml document to be loaded at runtime. I use the -pack feature of mtasc that forces classes from a package into your swf. so if you wanted force all the classes in com.bluetube.command into your swf you would pass -pack com\bluetube\command to mtasc. I hate having to put a dummy constructor or fluff in the code to make it work, I prefer the mtasc approach. Grant. - Original Message - From: Cdric_Muller [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 2/2/06 7:18 AM Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem but please, remember that this is a Flash Hack with a lot of whack and crack :) you're welcome! cedric This works Cedric, thank you very much :) All of you On 2/2/06, Cédric Muller wrote: in your .as file (main class, or classesManger,...) you can simply put references to the classes you will/should use ... I did it once the following way: /** * setPackagesToImport * fake method, never gets called. just here for 'import' + reference purposes * */ private function setPackagesToImport ():Void { sk.sowhat.linuxPlayer. ScreenEffects; sk.sowhat.linuxPlayer.ScreenVideo; sk.sowhat.linuxPlayer.Screen; sk.sowhat.linuxPlayer.HelperFunctions; // and so on ... } with such, you assure yourself that Flash will include the classes . not very official, nor clean, but really worked for me (as I had to reference the classes paths through xml) cedric Yes it works var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import) this is not problem but i create instance dynamicly, i got string in XML "sk.sowhat.linuxPlayer.play4dogs.Test" and i need create instance, but application doesnt know which classes will be instantiated, so i cannot create instance of all possible class in initialize phase of application On 2/2/06, franto wrote: but Ian, why it find other classes, i dont instantiate any of class, that code you can see in email is everything, and it has found 15 classes, but 3 doesnt find Classes found: 15 Classes not found: 3 Why? On 2/2/06, Ian Thomas wrote: Hi Franto, As far as I understand it, 'import' isn't enough to get a class compiled into your .swf. The line: import sk.sowhat.linuxPlayer.play4dogs.Test; just tells the compiler that any mention of the word Test in your code will refer to that class. If the class isn't compiled into the SWF, ClassFinder won't find it. You actually need to access or instantiate the class somewhere in the code to make Flash include it. From memory I think just referring to the class constructor is enough e.g. import sk.sowhat.linuxPlayer.play4dogs.Test; var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere later in the code I also have a vague memory that you might be able to force MTASC to include classes, but not being a user of MTASC (yet!) I'm not certain on that one. HTH, Ian P.S. You may just get away with import sk.sowhat.linuxPlayer.play4dogs.Test; sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash includes the code I seem to remember reading that somewhere... although syntactically it's odd. On 2/2/06, franto wrote: Can someone explain me this? Im using mx.utils.ClassFinder.findClass to find class and make instance from it but some classes it cant find, it's not just problem of "mx.utils.ClassFinder.findClass" im using another way to create dynamic class (as I wrote yesterday to the list) but same classes are not found e.g sk.sowhat.linuxPlayer.play4dogs.Test but when I create instance in this way new sk.sowhat.linuxPlayer.play4dogs.Test() it is created!!! Can someone tell me why? I try all I know, add imports and such but nothing help me. Im stuck on this for 8 hours now :( and i have to find solution Please help :) Maybe you can try it on your own projects, if it will find your classes Thank you ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --- --
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
Yes, that's true, but then someone without MTASC cannot compile (it will not work), so if my customer will want sources and want to compile it, it will be problem :) On 3 Feb 2006 06:40:47 -, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I do something similar in my arp extensions to force "command" classes > defined in an xml document to be loaded at runtime. I use the -pack feature > of mtasc that forces classes from a package into your swf. > > so if you wanted force all the classes in com.bluetube.command into your swf > you would pass > -pack com\bluetube\command to mtasc. > > I hate having to put a dummy constructor or fluff in the code to make it > work, I prefer the mtasc approach. > > Grant. > > - Original Message - > From: Cdric_Muller [EMAIL PROTECTED] > To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com > Sent: 2/2/06 7:18 AM > Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > > > but please, remember that this is a Flash Hack with a lot of whack > > and crack :) > > you're welcome! > > cedric > > > > > This works Cedric, thank you very much :) > > > All of you > > > > > > On 2/2/06, Cédric Muller wrote: > > >> in your .as file (main class, or classesManger,...) you can simply > > >> put references to the classes you will/should use ... > > >> > > >> I did it once the following way: > > >> > > >> /** > > >> * setPackagesToImport > > >> * fake method, never gets called. just here for 'import' + > > >> reference > > >> purposes > > >> * > > >> */ > > >> > > >> private function setPackagesToImport ():Void { > > >> sk.sowhat.linuxPlayer. ScreenEffects; > > >> sk.sowhat.linuxPlayer.ScreenVideo; > > >> sk.sowhat.linuxPlayer.Screen; > > >> sk.sowhat.linuxPlayer.HelperFunctions; > > >> // and so on ... > > >> } > > >> > > >> with such, you assure yourself that Flash will include the > > >> classes . not very official, nor clean, but really worked for me > > >> (as I had to reference the classes paths through xml) > > >> cedric > > >> > > >>> Yes it works > > >>> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with > > >>> no import) > > >>> > > >>> this is not problem > > >>> > > >>> but i create instance dynamicly, i got string in XML > > >>> "sk.sowhat.linuxPlayer.play4dogs.Test" > > >>> and i need create instance, but application doesnt know which > > >>> classes > > >>> will be instantiated, so i cannot create instance of all possible > > >>> class in initialize phase of application > > >>> > > >>> > > >>> > > >>> On 2/2/06, franto wrote: > > >>>> but Ian, why it find other classes, i dont instantiate any of > > >>>> class, > > >>>> that code you can see in email is everything, and it has found 15 > > >>>> classes, but 3 doesnt find > > >>>> > > >>>> Classes found: 15 > > >>>> Classes not found: 3 > > >>>> > > >>>> Why? > > >>>> > > >>>> On 2/2/06, Ian Thomas wrote: > > >>>>> Hi Franto, > > >>>>> > > >>>>> As far as I understand it, 'import' isn't enough to get a class > > >>>>> compiled > > >>>>> into your .swf. > > >>>>> > > >>>>> The line: > > >>>>> import sk.sowhat.linuxPlayer.play4dogs.Test; > > >>>>> just tells the compiler that any mention of the word Test in your > > >>>>> code will > > >>>>> refer to that class. > > >>>>> > > >>>>> If the class isn't compiled into the SWF, ClassFinder won't find > > >>>>> it. You > > >>>>> actually need to access or instantiate the class somewhere in > > >>>>> the code to > > >>>>> make Flash include it. From memory I think just referring to the > > >>>>> class > > >>>>> constructor is enough e.g. > > >
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
I do something similar in my arp extensions to force "command" classes defined in an xml document to be loaded at runtime. I use the -pack feature of mtasc that forces classes from a package into your swf. so if you wanted force all the classes in com.bluetube.command into your swf you would pass -pack com\bluetube\command to mtasc. I hate having to put a dummy constructor or fluff in the code to make it work, I prefer the mtasc approach. Grant. - Original Message - From: Cdric_Muller [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: 2/2/06 7:18 AM Subject: Re: [Flashcoders] mx.utils.ClassFinder.findClass problem > but please, remember that this is a Flash Hack with a lot of whack > and crack :) > you're welcome! > cedric > > > This works Cedric, thank you very much :) > > All of you > > > > On 2/2/06, Cédric Muller wrote: > >> in your .as file (main class, or classesManger,...) you can simply > >> put references to the classes you will/should use ... > >> > >> I did it once the following way: > >> > >> /** > >> * setPackagesToImport > >> * fake method, never gets called. just here for 'import' + > >> reference > >> purposes > >> * > >> */ > >> > >> private function setPackagesToImport ():Void { > >> sk.sowhat.linuxPlayer. ScreenEffects; > >> sk.sowhat.linuxPlayer.ScreenVideo; > >> sk.sowhat.linuxPlayer.Screen; > >> sk.sowhat.linuxPlayer.HelperFunctions; > >> // and so on ... > >> } > >> > >> with such, you assure yourself that Flash will include the > >> classes . not very official, nor clean, but really worked for me > >> (as I had to reference the classes paths through xml) > >> cedric > >> > >>> Yes it works > >>> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with > >>> no import) > >>> > >>> this is not problem > >>> > >>> but i create instance dynamicly, i got string in XML > >>> "sk.sowhat.linuxPlayer.play4dogs.Test" > >>> and i need create instance, but application doesnt know which > >>> classes > >>> will be instantiated, so i cannot create instance of all possible > >>> class in initialize phase of application > >>> > >>> > >>> > >>> On 2/2/06, franto wrote: > >>>> but Ian, why it find other classes, i dont instantiate any of > >>>> class, > >>>> that code you can see in email is everything, and it has found 15 > >>>> classes, but 3 doesnt find > >>>> > >>>> Classes found: 15 > >>>> Classes not found: 3 > >>>> > >>>> Why? > >>>> > >>>> On 2/2/06, Ian Thomas wrote: > >>>>> Hi Franto, > >>>>> > >>>>> As far as I understand it, 'import' isn't enough to get a class > >>>>> compiled > >>>>> into your .swf. > >>>>> > >>>>> The line: > >>>>> import sk.sowhat.linuxPlayer.play4dogs.Test; > >>>>> just tells the compiler that any mention of the word Test in your > >>>>> code will > >>>>> refer to that class. > >>>>> > >>>>> If the class isn't compiled into the SWF, ClassFinder won't find > >>>>> it. You > >>>>> actually need to access or instantiate the class somewhere in > >>>>> the code to > >>>>> make Flash include it. From memory I think just referring to the > >>>>> class > >>>>> constructor is enough e.g. > >>>>> > >>>>> import sk.sowhat.linuxPlayer.play4dogs.Test; > >>>>> > >>>>> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // > >>>>> somewhere > >>>>> later in the code > >>>>> > >>>>> I also have a vague memory that you might be able to force MTASC > >>>>> to include > >>>>> classes, but not being a user of MTASC (yet!) I'm not certain on > >>>>> that one. > >>>>> > >>>>> HTH, > >>>>> Ian > >>>>> > >&
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
but please, remember that this is a Flash Hack with a lot of whack and crack :) you're welcome! cedric This works Cedric, thank you very much :) All of you On 2/2/06, Cédric Muller <[EMAIL PROTECTED]> wrote: in your .as file (main class, or classesManger,...) you can simply put references to the classes you will/should use ... I did it once the following way: /** * setPackagesToImport * fake method, never gets called. just here for 'import' + reference purposes * */ private function setPackagesToImport ():Void { sk.sowhat.linuxPlayer. ScreenEffects; sk.sowhat.linuxPlayer.ScreenVideo; sk.sowhat.linuxPlayer.Screen; sk.sowhat.linuxPlayer.HelperFunctions; // and so on ... } with such, you assure yourself that Flash will include the classes . not very official, nor clean, but really worked for me (as I had to reference the classes paths through xml) cedric Yes it works var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import) this is not problem but i create instance dynamicly, i got string in XML "sk.sowhat.linuxPlayer.play4dogs.Test" and i need create instance, but application doesnt know which classes will be instantiated, so i cannot create instance of all possible class in initialize phase of application On 2/2/06, franto <[EMAIL PROTECTED]> wrote: but Ian, why it find other classes, i dont instantiate any of class, that code you can see in email is everything, and it has found 15 classes, but 3 doesnt find Classes found: 15 Classes not found: 3 Why? On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Franto, As far as I understand it, 'import' isn't enough to get a class compiled into your .swf. The line: import sk.sowhat.linuxPlayer.play4dogs.Test; just tells the compiler that any mention of the word Test in your code will refer to that class. If the class isn't compiled into the SWF, ClassFinder won't find it. You actually need to access or instantiate the class somewhere in the code to make Flash include it. From memory I think just referring to the class constructor is enough e.g. import sk.sowhat.linuxPlayer.play4dogs.Test; var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere later in the code I also have a vague memory that you might be able to force MTASC to include classes, but not being a user of MTASC (yet!) I'm not certain on that one. HTH, Ian P.S. You may just get away with import sk.sowhat.linuxPlayer.play4dogs.Test; sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash includes the code I seem to remember reading that somewhere... although syntactically it's odd. On 2/2/06, franto <[EMAIL PROTECTED]> wrote: Can someone explain me this? Im using mx.utils.ClassFinder.findClass to find class and make instance from it but some classes it cant find, it's not just problem of "mx.utils.ClassFinder.findClass" im using another way to create dynamic class (as I wrote yesterday to the list) but same classes are not found e.g sk.sowhat.linuxPlayer.play4dogs.Test but when I create instance in this way new sk.sowhat.linuxPlayer.play4dogs.Test() it is created!!! Can someone tell me why? I try all I know, add imports and such but nothing help me. Im stuck on this for 8 hours now :( and i have to find solution Please help :) Maybe you can try it on your own projects, if it will find your classes Thank you ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- --- -- --- -- --- Franto http://blog.franto.com http://www.flashcoders.sk -- -- -- - Franto http://blog.franto.com http://www.flashcoders.sk ___ 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 -- -- -- - Franto http://blog.franto.com http://www.flashcoders.sk ___ 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] mx.utils.ClassFinder.findClass problem
This works Cedric, thank you very much :) All of you On 2/2/06, Cédric Muller <[EMAIL PROTECTED]> wrote: > in your .as file (main class, or classesManger,...) you can simply > put references to the classes you will/should use ... > > I did it once the following way: > > /** > * setPackagesToImport > * fake method, never gets called. just here for 'import' + reference > purposes > * > */ > > private function setPackagesToImport ():Void { > sk.sowhat.linuxPlayer. ScreenEffects; > sk.sowhat.linuxPlayer.ScreenVideo; > sk.sowhat.linuxPlayer.Screen; > sk.sowhat.linuxPlayer.HelperFunctions; > // and so on ... > } > > with such, you assure yourself that Flash will include the > classes . not very official, nor clean, but really worked for me > (as I had to reference the classes paths through xml) > cedric > > > Yes it works > > var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with > > no import) > > > > this is not problem > > > > but i create instance dynamicly, i got string in XML > > "sk.sowhat.linuxPlayer.play4dogs.Test" > > and i need create instance, but application doesnt know which classes > > will be instantiated, so i cannot create instance of all possible > > class in initialize phase of application > > > > > > > > On 2/2/06, franto <[EMAIL PROTECTED]> wrote: > >> but Ian, why it find other classes, i dont instantiate any of class, > >> that code you can see in email is everything, and it has found 15 > >> classes, but 3 doesnt find > >> > >> Classes found: 15 > >> Classes not found: 3 > >> > >> Why? > >> > >> On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > >>> Hi Franto, > >>> > >>> As far as I understand it, 'import' isn't enough to get a class > >>> compiled > >>> into your .swf. > >>> > >>> The line: > >>> import sk.sowhat.linuxPlayer.play4dogs.Test; > >>> just tells the compiler that any mention of the word Test in your > >>> code will > >>> refer to that class. > >>> > >>> If the class isn't compiled into the SWF, ClassFinder won't find > >>> it. You > >>> actually need to access or instantiate the class somewhere in > >>> the code to > >>> make Flash include it. From memory I think just referring to the > >>> class > >>> constructor is enough e.g. > >>> > >>> import sk.sowhat.linuxPlayer.play4dogs.Test; > >>> > >>> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // > >>> somewhere > >>> later in the code > >>> > >>> I also have a vague memory that you might be able to force MTASC > >>> to include > >>> classes, but not being a user of MTASC (yet!) I'm not certain on > >>> that one. > >>> > >>> HTH, > >>> Ian > >>> > >>> P.S. > >>> You may just get away with > >>> import sk.sowhat.linuxPlayer.play4dogs.Test; > >>> > >>> sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the > >>> constructor, so Flash > >>> includes the code > >>> > >>> I seem to remember reading that somewhere... although > >>> syntactically it's > >>> odd. > >>> > >>> On 2/2/06, franto <[EMAIL PROTECTED]> wrote: > > Can someone explain me this? > Im using mx.utils.ClassFinder.findClass to find class and make > instance > from it > but some classes it cant find, it's not just problem of > "mx.utils.ClassFinder.findClass" im using another way to create > dynamic class (as I wrote yesterday to the list) > but same classes are not found e.g > > sk.sowhat.linuxPlayer.play4dogs.Test > > but when I create instance in this way > > new sk.sowhat.linuxPlayer.play4dogs.Test() > > it is created!!! Can someone tell me why? I try all I know, add > imports and such but nothing > help me. Im stuck on this for 8 hours now :( and i have to find > solution > > Please help :) > > Maybe you can try it on your own projects, if it will find your > classes > > Thank you > > > > >>> ___ > >>> Flashcoders mailing list > >>> Flashcoders@chattyfig.figleaf.com > >>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >>> > >> > >> > >> -- > >> - > >> - > >> --- > >> Franto > >> > >> http://blog.franto.com > >> http://www.flashcoders.sk > >> > > > > > > -- > > -- > > -- > > - > > Franto > > > > http://blog.franto.com > > http://www.flashcoders.sk > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.c
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
in your .as file (main class, or classesManger,...) you can simply put references to the classes you will/should use ... I did it once the following way: /** * setPackagesToImport * fake method, never gets called. just here for 'import' + reference purposes * */ private function setPackagesToImport ():Void { sk.sowhat.linuxPlayer. ScreenEffects; sk.sowhat.linuxPlayer.ScreenVideo; sk.sowhat.linuxPlayer.Screen; sk.sowhat.linuxPlayer.HelperFunctions; // and so on ... } with such, you assure yourself that Flash will include the classes . not very official, nor clean, but really worked for me (as I had to reference the classes paths through xml) cedric Yes it works var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import) this is not problem but i create instance dynamicly, i got string in XML "sk.sowhat.linuxPlayer.play4dogs.Test" and i need create instance, but application doesnt know which classes will be instantiated, so i cannot create instance of all possible class in initialize phase of application On 2/2/06, franto <[EMAIL PROTECTED]> wrote: but Ian, why it find other classes, i dont instantiate any of class, that code you can see in email is everything, and it has found 15 classes, but 3 doesnt find Classes found: 15 Classes not found: 3 Why? On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Franto, As far as I understand it, 'import' isn't enough to get a class compiled into your .swf. The line: import sk.sowhat.linuxPlayer.play4dogs.Test; just tells the compiler that any mention of the word Test in your code will refer to that class. If the class isn't compiled into the SWF, ClassFinder won't find it. You actually need to access or instantiate the class somewhere in the code to make Flash include it. From memory I think just referring to the class constructor is enough e.g. import sk.sowhat.linuxPlayer.play4dogs.Test; var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere later in the code I also have a vague memory that you might be able to force MTASC to include classes, but not being a user of MTASC (yet!) I'm not certain on that one. HTH, Ian P.S. You may just get away with import sk.sowhat.linuxPlayer.play4dogs.Test; sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash includes the code I seem to remember reading that somewhere... although syntactically it's odd. On 2/2/06, franto <[EMAIL PROTECTED]> wrote: Can someone explain me this? Im using mx.utils.ClassFinder.findClass to find class and make instance from it but some classes it cant find, it's not just problem of "mx.utils.ClassFinder.findClass" im using another way to create dynamic class (as I wrote yesterday to the list) but same classes are not found e.g sk.sowhat.linuxPlayer.play4dogs.Test but when I create instance in this way new sk.sowhat.linuxPlayer.play4dogs.Test() it is created!!! Can someone tell me why? I try all I know, add imports and such but nothing help me. Im stuck on this for 8 hours now :( and i have to find solution Please help :) Maybe you can try it on your own projects, if it will find your classes Thank you ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- - - --- Franto http://blog.franto.com http://www.flashcoders.sk -- -- -- - Franto http://blog.franto.com http://www.flashcoders.sk ___ 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] mx.utils.ClassFinder.findClass problem
yes, new class[sk.sowhat.linuxPlayer.play4dogs.ScreenManager]: undefined new class[sk.sowhat.linuxPlayer.play4horses.ScreenSingle]: undefined new class[sk.sowhat.linuxPlayer.Screen]: undefined Classes found: 15 Classes not found: 3 I try to look into that classes, but i dont find nothing strange On 2/2/06, Cédric Muller <[EMAIL PROTECTED]> wrote: > do you know which ones weren't found (the 3 classes) ? > > > but Ian, why it find other classes, i dont instantiate any of class, > > that code you can see in email is everything, and it has found 15 > > classes, but 3 doesnt find > > > > Classes found: 15 > > Classes not found: 3 > > > > Why? > > > > On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > >> Hi Franto, > >> > >> As far as I understand it, 'import' isn't enough to get a class > >> compiled > >> into your .swf. > >> > >> The line: > >> import sk.sowhat.linuxPlayer.play4dogs.Test; > >> just tells the compiler that any mention of the word Test in your > >> code will > >> refer to that class. > >> > >> If the class isn't compiled into the SWF, ClassFinder won't find > >> it. You > >> actually need to access or instantiate the class somewhere in the > >> code to > >> make Flash include it. From memory I think just referring to the > >> class > >> constructor is enough e.g. > >> > >> import sk.sowhat.linuxPlayer.play4dogs.Test; > >> > >> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // > >> somewhere > >> later in the code > >> > >> I also have a vague memory that you might be able to force MTASC > >> to include > >> classes, but not being a user of MTASC (yet!) I'm not certain on > >> that one. > >> > >> HTH, > >> Ian > >> > >> P.S. > >> You may just get away with > >> import sk.sowhat.linuxPlayer.play4dogs.Test; > >> > >> sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the > >> constructor, so Flash > >> includes the code > >> > >> I seem to remember reading that somewhere... although > >> syntactically it's > >> odd. > >> > >> On 2/2/06, franto <[EMAIL PROTECTED]> wrote: > >>> > >>> Can someone explain me this? > >>> Im using mx.utils.ClassFinder.findClass to find class and make > >>> instance > >>> from it > >>> but some classes it cant find, it's not just problem of > >>> "mx.utils.ClassFinder.findClass" im using another way to create > >>> dynamic class (as I wrote yesterday to the list) > >>> but same classes are not found e.g > >>> > >>> sk.sowhat.linuxPlayer.play4dogs.Test > >>> > >>> but when I create instance in this way > >>> > >>> new sk.sowhat.linuxPlayer.play4dogs.Test() > >>> > >>> it is created!!! Can someone tell me why? I try all I know, add > >>> imports and such but nothing > >>> help me. Im stuck on this for 8 hours now :( and i have to find > >>> solution > >>> > >>> Please help :) > >>> > >>> Maybe you can try it on your own projects, if it will find your > >>> classes > >>> > >>> Thank you > >>> > >>> > >>> > >> ___ > >> Flashcoders mailing list > >> Flashcoders@chattyfig.figleaf.com > >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > >> > > > > > > -- > > -- > > -- > > - > > Franto > > > > http://blog.franto.com > > http://www.flashcoders.sk > > ___ > > 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 > -- - Franto http://blog.franto.com http://www.flashcoders.sk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
do you know which ones weren't found (the 3 classes) ? but Ian, why it find other classes, i dont instantiate any of class, that code you can see in email is everything, and it has found 15 classes, but 3 doesnt find Classes found: 15 Classes not found: 3 Why? On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: Hi Franto, As far as I understand it, 'import' isn't enough to get a class compiled into your .swf. The line: import sk.sowhat.linuxPlayer.play4dogs.Test; just tells the compiler that any mention of the word Test in your code will refer to that class. If the class isn't compiled into the SWF, ClassFinder won't find it. You actually need to access or instantiate the class somewhere in the code to make Flash include it. From memory I think just referring to the class constructor is enough e.g. import sk.sowhat.linuxPlayer.play4dogs.Test; var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere later in the code I also have a vague memory that you might be able to force MTASC to include classes, but not being a user of MTASC (yet!) I'm not certain on that one. HTH, Ian P.S. You may just get away with import sk.sowhat.linuxPlayer.play4dogs.Test; sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash includes the code I seem to remember reading that somewhere... although syntactically it's odd. On 2/2/06, franto <[EMAIL PROTECTED]> wrote: Can someone explain me this? Im using mx.utils.ClassFinder.findClass to find class and make instance from it but some classes it cant find, it's not just problem of "mx.utils.ClassFinder.findClass" im using another way to create dynamic class (as I wrote yesterday to the list) but same classes are not found e.g sk.sowhat.linuxPlayer.play4dogs.Test but when I create instance in this way new sk.sowhat.linuxPlayer.play4dogs.Test() it is created!!! Can someone tell me why? I try all I know, add imports and such but nothing help me. Im stuck on this for 8 hours now :( and i have to find solution Please help :) Maybe you can try it on your own projects, if it will find your classes Thank you ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- -- -- - Franto http://blog.franto.com http://www.flashcoders.sk ___ 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] mx.utils.ClassFinder.findClass problem
Yes it works var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import) this is not problem but i create instance dynamicly, i got string in XML "sk.sowhat.linuxPlayer.play4dogs.Test" and i need create instance, but application doesnt know which classes will be instantiated, so i cannot create instance of all possible class in initialize phase of application On 2/2/06, franto <[EMAIL PROTECTED]> wrote: > but Ian, why it find other classes, i dont instantiate any of class, > that code you can see in email is everything, and it has found 15 > classes, but 3 doesnt find > > Classes found: 15 > Classes not found: 3 > > Why? > > On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > Hi Franto, > > > > As far as I understand it, 'import' isn't enough to get a class compiled > > into your .swf. > > > > The line: > > import sk.sowhat.linuxPlayer.play4dogs.Test; > > just tells the compiler that any mention of the word Test in your code will > > refer to that class. > > > > If the class isn't compiled into the SWF, ClassFinder won't find it. You > > actually need to access or instantiate the class somewhere in the code to > > make Flash include it. From memory I think just referring to the class > > constructor is enough e.g. > > > > import sk.sowhat.linuxPlayer.play4dogs.Test; > > > > var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere > > later in the code > > > > I also have a vague memory that you might be able to force MTASC to include > > classes, but not being a user of MTASC (yet!) I'm not certain on that one. > > > > HTH, > > Ian > > > > P.S. > > You may just get away with > > import sk.sowhat.linuxPlayer.play4dogs.Test; > > > > sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash > > includes the code > > > > I seem to remember reading that somewhere... although syntactically it's > > odd. > > > > On 2/2/06, franto <[EMAIL PROTECTED]> wrote: > > > > > > Can someone explain me this? > > > Im using mx.utils.ClassFinder.findClass to find class and make instance > > > from it > > > but some classes it cant find, it's not just problem of > > > "mx.utils.ClassFinder.findClass" im using another way to create > > > dynamic class (as I wrote yesterday to the list) > > > but same classes are not found e.g > > > > > > sk.sowhat.linuxPlayer.play4dogs.Test > > > > > > but when I create instance in this way > > > > > > new sk.sowhat.linuxPlayer.play4dogs.Test() > > > > > > it is created!!! Can someone tell me why? I try all I know, add > > > imports and such but nothing > > > help me. Im stuck on this for 8 hours now :( and i have to find solution > > > > > > Please help :) > > > > > > Maybe you can try it on your own projects, if it will find your classes > > > > > > Thank you > > > > > > > > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > -- > - > Franto > > http://blog.franto.com > http://www.flashcoders.sk > -- - Franto http://blog.franto.com http://www.flashcoders.sk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
but Ian, why it find other classes, i dont instantiate any of class, that code you can see in email is everything, and it has found 15 classes, but 3 doesnt find Classes found: 15 Classes not found: 3 Why? On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > Hi Franto, > > As far as I understand it, 'import' isn't enough to get a class compiled > into your .swf. > > The line: > import sk.sowhat.linuxPlayer.play4dogs.Test; > just tells the compiler that any mention of the word Test in your code will > refer to that class. > > If the class isn't compiled into the SWF, ClassFinder won't find it. You > actually need to access or instantiate the class somewhere in the code to > make Flash include it. From memory I think just referring to the class > constructor is enough e.g. > > import sk.sowhat.linuxPlayer.play4dogs.Test; > > var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere > later in the code > > I also have a vague memory that you might be able to force MTASC to include > classes, but not being a user of MTASC (yet!) I'm not certain on that one. > > HTH, > Ian > > P.S. > You may just get away with > import sk.sowhat.linuxPlayer.play4dogs.Test; > > sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash > includes the code > > I seem to remember reading that somewhere... although syntactically it's > odd. > > On 2/2/06, franto <[EMAIL PROTECTED]> wrote: > > > > Can someone explain me this? > > Im using mx.utils.ClassFinder.findClass to find class and make instance > > from it > > but some classes it cant find, it's not just problem of > > "mx.utils.ClassFinder.findClass" im using another way to create > > dynamic class (as I wrote yesterday to the list) > > but same classes are not found e.g > > > > sk.sowhat.linuxPlayer.play4dogs.Test > > > > but when I create instance in this way > > > > new sk.sowhat.linuxPlayer.play4dogs.Test() > > > > it is created!!! Can someone tell me why? I try all I know, add > > imports and such but nothing > > help me. Im stuck on this for 8 hours now :( and i have to find solution > > > > Please help :) > > > > Maybe you can try it on your own projects, if it will find your classes > > > > Thank you > > > > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- - Franto http://blog.franto.com http://www.flashcoders.sk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
or just import com.whatever.Foo; var foo:Foo; no need for the :Function, or the assignment. martin Ian Thomas wrote: Whoops - I'm being dim. These will work just as well: import sk.sowhat.linuxPlayer.play4dogs.Test; var dummyVar:Function=Test; or var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import) Ian ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
Whoops - I'm being dim. These will work just as well: import sk.sowhat.linuxPlayer.play4dogs.Test; var dummyVar:Function=Test; or var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import) Ian On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote: > > Hi Franto, > > As far as I understand it, 'import' isn't enough to get a class compiled > into your .swf. > > The line: > import sk.sowhat.linuxPlayer.play4dogs.Test; > just tells the compiler that any mention of the word Test in your code > will refer to that class. > > If the class isn't compiled into the SWF, ClassFinder won't find it. You > actually need to access or instantiate the class somewhere in the code to > make Flash include it. From memory I think just referring to the class > constructor is enough e.g. > > import sk.sowhat.linuxPlayer.play4dogs.Test; > > var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere > later in the code > > I also have a vague memory that you might be able to force MTASC to > include classes, but not being a user of MTASC (yet!) I'm not certain on > that one. > > HTH, > Ian > > P.S. > You may just get away with > import sk.sowhat.linuxPlayer.play4dogs.Test; > > sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so > Flash includes the code > > I seem to remember reading that somewhere... although syntactically it's > odd. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] mx.utils.ClassFinder.findClass problem
because you call it directly new sk.whatever.linux.AClass() calls the class directly, as you specify the path, it doesn't need to import it before ... another way would be to: import sk.whatever.linux.AClass; var myAClass = new AClass(); would work too ... now regarding your idea, if you push *direct* references (not with "sk.classes") to the class in the 'c' Array, you should find that it works too ... var c=[]; c.push(sk.sowhat.linuxPlayer.Application); c.push(sk.sowhat.linuxPlayer.HelperFunctions); ??? cedric Can someone explain me this? Im using mx.utils.ClassFinder.findClass to find class and make instance from it but some classes it cant find, it's not just problem of "mx.utils.ClassFinder.findClass" im using another way to create dynamic class (as I wrote yesterday to the list) but same classes are not found e.g sk.sowhat.linuxPlayer.play4dogs.Test but when I create instance in this way new sk.sowhat.linuxPlayer.play4dogs.Test() it is created!!! Can someone tell me why? I try all I know, add imports and such but nothing help me. Im stuck on this for 8 hours now :( and i have to find solution Please help :) Maybe you can try it on your own projects, if it will find your classes Thank you import sk.sowhat.linuxPlayer.Application; import sk.sowhat.linuxPlayer.play4horses.*; import sk.sowhat.linuxPlayer.Screen; var c = [] c.push("sk.sowhat.linuxPlayer.Application") c.push("sk.sowhat.linuxPlayer.HelperFunctions") c.push("sk.sowhat.linuxPlayer.Screen") c.push("com.franto.ria.screen.Screen") c.push("sk.sowhat.linuxPlayer.ScreenEffects") c.push("sk.sowhat.linuxPlayer.ScreenInfoBanner") c.push("sk.sowhat.linuxPlayer.ScreenVideo") c.push("sk.sowhat.linuxPlayer.play4horses.Application") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenInfoBanner") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenSingle") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenAds") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenMultiBets") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenManager") c.push("sk.sowhat.linuxPlayer.play4dogs.Application") c.push("sk.sowhat.linuxPlayer.play4dogs.Test") c.push("sk.sowhat.linuxPlayer.play4dogs.ScreenInfoBanner") c.push("sk.sowhat.linuxPlayer.play4dogs.ScreenManager") new sk.sowhat.linuxPlayer.play4dogs.Test(); for (var i in c) { screenClass = c[i]; var newClass:Function = mx.utils.ClassFinder.findClass(screenClass); if (newClass == undefined) { trace("new class["+screenClass+"]: " + newClass); } } Franto http://blog.franto.com http://www.flashcoders.sk ___ 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] mx.utils.ClassFinder.findClass problem
Hi Franto, As far as I understand it, 'import' isn't enough to get a class compiled into your .swf. The line: import sk.sowhat.linuxPlayer.play4dogs.Test; just tells the compiler that any mention of the word Test in your code will refer to that class. If the class isn't compiled into the SWF, ClassFinder won't find it. You actually need to access or instantiate the class somewhere in the code to make Flash include it. From memory I think just referring to the class constructor is enough e.g. import sk.sowhat.linuxPlayer.play4dogs.Test; var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere later in the code I also have a vague memory that you might be able to force MTASC to include classes, but not being a user of MTASC (yet!) I'm not certain on that one. HTH, Ian P.S. You may just get away with import sk.sowhat.linuxPlayer.play4dogs.Test; sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so Flash includes the code I seem to remember reading that somewhere... although syntactically it's odd. On 2/2/06, franto <[EMAIL PROTECTED]> wrote: > > Can someone explain me this? > Im using mx.utils.ClassFinder.findClass to find class and make instance > from it > but some classes it cant find, it's not just problem of > "mx.utils.ClassFinder.findClass" im using another way to create > dynamic class (as I wrote yesterday to the list) > but same classes are not found e.g > > sk.sowhat.linuxPlayer.play4dogs.Test > > but when I create instance in this way > > new sk.sowhat.linuxPlayer.play4dogs.Test() > > it is created!!! Can someone tell me why? I try all I know, add > imports and such but nothing > help me. Im stuck on this for 8 hours now :( and i have to find solution > > Please help :) > > Maybe you can try it on your own projects, if it will find your classes > > Thank you > > > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] mx.utils.ClassFinder.findClass problem
Can someone explain me this? Im using mx.utils.ClassFinder.findClass to find class and make instance from it but some classes it cant find, it's not just problem of "mx.utils.ClassFinder.findClass" im using another way to create dynamic class (as I wrote yesterday to the list) but same classes are not found e.g sk.sowhat.linuxPlayer.play4dogs.Test but when I create instance in this way new sk.sowhat.linuxPlayer.play4dogs.Test() it is created!!! Can someone tell me why? I try all I know, add imports and such but nothing help me. Im stuck on this for 8 hours now :( and i have to find solution Please help :) Maybe you can try it on your own projects, if it will find your classes Thank you import sk.sowhat.linuxPlayer.Application; import sk.sowhat.linuxPlayer.play4horses.*; import sk.sowhat.linuxPlayer.Screen; var c = [] c.push("sk.sowhat.linuxPlayer.Application") c.push("sk.sowhat.linuxPlayer.HelperFunctions") c.push("sk.sowhat.linuxPlayer.Screen") c.push("com.franto.ria.screen.Screen") c.push("sk.sowhat.linuxPlayer.ScreenEffects") c.push("sk.sowhat.linuxPlayer.ScreenInfoBanner") c.push("sk.sowhat.linuxPlayer.ScreenVideo") c.push("sk.sowhat.linuxPlayer.play4horses.Application") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenInfoBanner") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenSingle") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenAds") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenMultiBets") c.push("sk.sowhat.linuxPlayer.play4horses.ScreenManager") c.push("sk.sowhat.linuxPlayer.play4dogs.Application") c.push("sk.sowhat.linuxPlayer.play4dogs.Test") c.push("sk.sowhat.linuxPlayer.play4dogs.ScreenInfoBanner") c.push("sk.sowhat.linuxPlayer.play4dogs.ScreenManager") new sk.sowhat.linuxPlayer.play4dogs.Test(); for (var i in c) { screenClass = c[i]; var newClass:Function = mx.utils.ClassFinder.findClass(screenClass); if (newClass == undefined) { trace("new class["+screenClass+"]: " + newClass); } } Franto http://blog.franto.com http://www.flashcoders.sk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders