Re: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'"
I warned you it ight fail silently with a cast (a failed cast always returns a null) . the "cleanest sollution" is to extend xmlNode implement that interface and proxy those methods defined on the interface to the xmlNode methods. this might seem like a fair bit more work, but down the line it makes your code much more maintainable. if you want quicker compilation times use mtasc -keep, but doing things right is a good habit to get into. On 1/12/06, Andreas Weber <[EMAIL PROTECTED]> wrote: > > In the light of longer compilation times and the hours wasted with issues > like this... > Shouldn't we consider the claim that strict-typing cuts down developement > time as one of those completely unfounded urban legends? > ;-) > > > mx.controls.treeclasses.TreeDataProvider > > Sounds great, but I still don't get it to work - no compiler error, but > also > no node added: > > import mx.controls.treeclasses.TreeDataProvider > > class Test{ > function Test(){ > var myTreeDP:TreeDataProvider = > TreeDataProvider(new XML()); > myTreeDP.addTreeNode("node", 0); > trace('cast to TreeDataProvider '+myTreeDP); > > // avoid Compiler error when publishing for Player > 7 > var myTreeDP = new XML(); > myTreeDP.addTreeNode("node", 0); > trace('untyped '+myTreeDP); > } > } > > Output: > cast to TreeDataProvider null > untyped > > > > Cheers! > > -- > Andreas Weber > motiondraw.com > > > > > -----Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Johannes > Nel > Sent: Thursday, January 12, 2006 3:21 PM > To: Flashcoders mailing list > Subject: Re: [Flashcoders] TreeDataProvider - "There is no method with > thename'addTreeNode'" > > > mx.controls.treeclasses.TreeDataProvider > > you need to get a good editor :) > > On 1/11/06, Derek Lords <[EMAIL PROTECTED]> wrote: > > > > "missing intrinsic class issue" good guess.This happened to me upon > > upgrading to Flash 8. I had to downgrade each instance to an Object and > > the > > problem went away. > > > > > > > > > > > > > > >From: "Andreas Weber" <[EMAIL PROTECTED]> > > >Reply-To: Flashcoders mailing list > > >To: "Flashcoders" > > >Subject: [Flashcoders] TreeDataProvider - "There is no method with the > > >name'addTreeNode'" > > >Date: Wed, 11 Jan 2006 16:13:26 +0100 > > > > > >With a Tree component on stage and this framecode > > > > > > var myTreeDP:XML = new XML(); > > > myTreeDP.addTreeNode("node", 0); > > > > > >the TreeDataProvider API works fine. > > > > > >However, the same code in a class > > > > > > class Test{ > > > function Test(){ > > > var myTreeDP:XML = new XML(); > > > myTreeDP.addTreeNode("node", 0); > > > } > > > } > > > > > >instantiated from a .fla that has a Tree component on stage, throws a > > >compiler error: > > > > > > "There is no method with the name 'addTreeNode'" > > > > > >Is this a missing intrinsic class issue? Workarounds? (don't have any > > luck > > >with avoiding the compiler error through Array access syntax: no error, > > but > > >no node is added). > > > > > >Cheers! > > > > > >-- > > >Andreas Weber > > >motiondraw.com > > > > > > > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'"
In the light of longer compilation times and the hours wasted with issues like this... Shouldn't we consider the claim that strict-typing cuts down developement time as one of those completely unfounded urban legends? ;-) > mx.controls.treeclasses.TreeDataProvider Sounds great, but I still don't get it to work - no compiler error, but also no node added: import mx.controls.treeclasses.TreeDataProvider class Test{ function Test(){ var myTreeDP:TreeDataProvider = TreeDataProvider(new XML()); myTreeDP.addTreeNode("node", 0); trace('cast to TreeDataProvider '+myTreeDP); // avoid Compiler error when publishing for Player 7 var myTreeDP = new XML(); myTreeDP.addTreeNode("node", 0); trace('untyped '+myTreeDP); } } Output: cast to TreeDataProvider null untyped Cheers! -- Andreas Weber motiondraw.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Johannes Nel Sent: Thursday, January 12, 2006 3:21 PM To: Flashcoders mailing list Subject: Re: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'" mx.controls.treeclasses.TreeDataProvider you need to get a good editor :) On 1/11/06, Derek Lords <[EMAIL PROTECTED]> wrote: > > "missing intrinsic class issue" good guess.This happened to me upon > upgrading to Flash 8. I had to downgrade each instance to an Object and > the > problem went away. > > > > > > > >From: "Andreas Weber" <[EMAIL PROTECTED]> > >Reply-To: Flashcoders mailing list > >To: "Flashcoders" > >Subject: [Flashcoders] TreeDataProvider - "There is no method with the > >name'addTreeNode'" > >Date: Wed, 11 Jan 2006 16:13:26 +0100 > > > >With a Tree component on stage and this framecode > > > > var myTreeDP:XML = new XML(); > > myTreeDP.addTreeNode("node", 0); > > > >the TreeDataProvider API works fine. > > > >However, the same code in a class > > > > class Test{ > > function Test(){ > > var myTreeDP:XML = new XML(); > > myTreeDP.addTreeNode("node", 0); > > } > > } > > > >instantiated from a .fla that has a Tree component on stage, throws a > >compiler error: > > > > "There is no method with the name 'addTreeNode'" > > > >Is this a missing intrinsic class issue? Workarounds? (don't have any > luck > >with avoiding the compiler error through Array access syntax: no error, > but > >no node is added). > > > >Cheers! > > > >-- > >Andreas Weber > >motiondraw.com > > > > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'" - SOLVED
yeah its a sollution, but a baaad habit to get into. On 1/11/06, Andreas Weber <[EMAIL PROTECTED]> wrote: > > Thanks Derek - that's it! > > Not typing the dataprovider as XML allows to publish for Player 7: > > import mx.controls.Tree; > > class Test{ > function Test(){ > // Published for Player 7. Error: There is no method > with the name 'addTreeNode'. > //var myTreeDP:XML = new XML(); > > // Compiles fine when not typed as XML > var myTreeDP = new XML(); > myTreeDP.addTreeNode("node", 0); > } > } > > Cheers! > > -- > Andreas Weber > motiondraw.com > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Derek > Lords > Sent: Donnerstag, 12. Januar 2006 05:11 > To: flashcoders@chattyfig.figleaf.com > Subject: RE: [Flashcoders] TreeDataProvider - "There is no method with > thename'addTreeNode'" > > > "missing intrinsic class issue" good guess.This happened to me upon > upgrading to Flash 8. I had to downgrade each instance to an Object and > the > problem went away. > > > > > > > >From: "Andreas Weber" <[EMAIL PROTECTED]> > >Reply-To: Flashcoders mailing list > >To: "Flashcoders" > >Subject: [Flashcoders] TreeDataProvider - "There is no method with the > >name'addTreeNode'" > >Date: Wed, 11 Jan 2006 16:13:26 +0100 > > > >With a Tree component on stage and this framecode > > > > var myTreeDP:XML = new XML(); > > myTreeDP.addTreeNode("node", 0); > > > >the TreeDataProvider API works fine. > > > >However, the same code in a class > > > > class Test{ > > function Test(){ > > var myTreeDP:XML = new XML(); > > myTreeDP.addTreeNode("node", 0); > > } > > } > > > >instantiated from a .fla that has a Tree component on stage, throws a > >compiler error: > > > > "There is no method with the name 'addTreeNode'" > > > >Is this a missing intrinsic class issue? Workarounds? (don't have any > >luck with avoiding the compiler error through Array access syntax: no > >error, but no node is added). > > > >Cheers! > > > >-- > >Andreas Weber > >motiondraw.com > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'" - SOLVED
Thanks Derek - that's it! Not typing the dataprovider as XML allows to publish for Player 7: import mx.controls.Tree; class Test{ function Test(){ // Published for Player 7. Error: There is no method with the name 'addTreeNode'. //var myTreeDP:XML = new XML(); // Compiles fine when not typed as XML var myTreeDP = new XML(); myTreeDP.addTreeNode("node", 0); } } Cheers! -- Andreas Weber motiondraw.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Derek Lords Sent: Donnerstag, 12. Januar 2006 05:11 To: flashcoders@chattyfig.figleaf.com Subject: RE: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'" "missing intrinsic class issue" good guess.This happened to me upon upgrading to Flash 8. I had to downgrade each instance to an Object and the problem went away. >From: "Andreas Weber" <[EMAIL PROTECTED]> >Reply-To: Flashcoders mailing list >To: "Flashcoders" >Subject: [Flashcoders] TreeDataProvider - "There is no method with the >name'addTreeNode'" >Date: Wed, 11 Jan 2006 16:13:26 +0100 > >With a Tree component on stage and this framecode > > var myTreeDP:XML = new XML(); > myTreeDP.addTreeNode("node", 0); > >the TreeDataProvider API works fine. > >However, the same code in a class > > class Test{ > function Test(){ > var myTreeDP:XML = new XML(); > myTreeDP.addTreeNode("node", 0); > } > } > >instantiated from a .fla that has a Tree component on stage, throws a >compiler error: > > "There is no method with the name 'addTreeNode'" > >Is this a missing intrinsic class issue? Workarounds? (don't have any >luck with avoiding the compiler error through Array access syntax: no >error, but no node is added). > >Cheers! > >-- >Andreas Weber >motiondraw.com > ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'"
var myTreeDP:TreeDataProvider = TreeDataProvider (new XML()); myTreeDP.addTreeNode("node", 0); thjis might just fail silently though, but should work is an example of how we use it. On 1/11/06, Andreas Weber <[EMAIL PROTECTED]> wrote: > > > cast it. > > how? > > Could you elaborate a bit? Thanks! > > -- > Andreas Weber > motiondraw.com > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Johannes > Nel > Sent: Mittwoch, 11. Januar 2006 21:57 > To: Flashcoders mailing list > Subject: Re: [Flashcoders] TreeDataProvider - "There is no method with > thename'addTreeNode'" > > > cast it. > > On 1/11/06, Andreas Weber <[EMAIL PROTECTED]> wrote: > > > > Thanks Devendran - > > This should do it and usually does do it... > > > > However in the context of my project I got the 'no method with the > > name 'addTreeNode' error, no matter in how many even remotely related > > classes I put the import statement. Now, after a lot of digging, > > cursing, ASO file deleting and hair pulling I found the culprit: > > I was publishing for Player 7. Published for Player 8 it compiles just > > fine. (Reproducable by publishing the simple test case for Player 7 / > 8) > > > > Does not make any sense to me and at the moment I'd really still > > prefer to publish for 7... > > > > Cheers! > > -- > > Andreas Weber > > motiondraw.com > > > > > > -Original Message- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of > > Devendran I > > Sent: Mittwoch, 11. Januar 2006 17:24 > > To: Flashcoders mailing list > > Subject: Re: [Flashcoders] TreeDataProvider - "There is no method with > > > thename 'addTreeNode'" > > > > > > Hi > > > > use this code in your Class file > > import mx.controls.Tree; > > > > > > And then compile the Movie. > > > > > > Devendran.I > > > > > > > > Andreas Weber <[EMAIL PROTECTED]> wrote: > > With a Tree component on stage and this framecode > > > > var myTreeDP:XML = new XML(); > > myTreeDP.addTreeNode("node", 0); > > > > the TreeDataProvider API works fine. > > > > However, the same code in a class > > > > class Test{ > > function Test(){ > > var myTreeDP:XML = new XML(); > > myTreeDP.addTreeNode("node", 0); > > } > > } > > > > instantiated from a .fla that has a Tree component on stage, throws a > > compiler error: > > > > "There is no method with the name 'addTreeNode'" > > > > Is this a missing intrinsic class issue? Workarounds? (don't have any > > luck with avoiding the compiler error through Array access syntax: no > > error, but no node is added). > > > > Cheers! > > > > -- > > Andreas Weber > > motiondraw.com > > > > > > > > ___ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > > > > > > - > > Yahoo! Photos > > Got holiday prints? See all the ways to get quality prints in your > > hands ASAP. ___ > > 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 > > > > > > -- > j:pn > ___ > 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 > -- j:pn ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'"
> cast it. how? Could you elaborate a bit? Thanks! -- Andreas Weber motiondraw.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel Sent: Mittwoch, 11. Januar 2006 21:57 To: Flashcoders mailing list Subject: Re: [Flashcoders] TreeDataProvider - "There is no method with thename'addTreeNode'" cast it. On 1/11/06, Andreas Weber <[EMAIL PROTECTED]> wrote: > > Thanks Devendran - > This should do it and usually does do it... > > However in the context of my project I got the 'no method with the > name 'addTreeNode' error, no matter in how many even remotely related > classes I put the import statement. Now, after a lot of digging, > cursing, ASO file deleting and hair pulling I found the culprit: > I was publishing for Player 7. Published for Player 8 it compiles just > fine. (Reproducable by publishing the simple test case for Player 7 / 8) > > Does not make any sense to me and at the moment I'd really still > prefer to publish for 7... > > Cheers! > -- > Andreas Weber > motiondraw.com > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Devendran I > Sent: Mittwoch, 11. Januar 2006 17:24 > To: Flashcoders mailing list > Subject: Re: [Flashcoders] TreeDataProvider - "There is no method with > thename 'addTreeNode'" > > > Hi > > use this code in your Class file > import mx.controls.Tree; > > > And then compile the Movie. > > > Devendran.I > > > > Andreas Weber <[EMAIL PROTECTED]> wrote: > With a Tree component on stage and this framecode > > var myTreeDP:XML = new XML(); > myTreeDP.addTreeNode("node", 0); > > the TreeDataProvider API works fine. > > However, the same code in a class > > class Test{ > function Test(){ > var myTreeDP:XML = new XML(); > myTreeDP.addTreeNode("node", 0); > } > } > > instantiated from a .fla that has a Tree component on stage, throws a > compiler error: > > "There is no method with the name 'addTreeNode'" > > Is this a missing intrinsic class issue? Workarounds? (don't have any > luck with avoiding the compiler error through Array access syntax: no > error, but no node is added). > > Cheers! > > -- > Andreas Weber > motiondraw.com > > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > > - > Yahoo! Photos > Got holiday prints? See all the ways to get quality prints in your > hands ASAP. ___ > 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 > -- j:pn ___ 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