Re: [flexcoders] error while extending dictionary error ..
Hmph... Before I do that, Mayur have you double checked everything? I don't wanna look like more of a clueless douche than usual, so I made a couple of changes to the code you submitted and got this: --- mydict.as package { import flash.utils.Dictionary; public class mydict extends Dictionary { publicstatic var instance:mydict // done to maintain singleton class function mydict (){ super(); } public static function getInstance():mydict { if (instance == null) instance = new mydict(); return instance; } public function addTodict(id:int,val:String):void{ mydict [id] = val // its giving me error here...can not create proeprty 26..(if id was 26..) on mydict } } } --- testbed.mxml http://www.adobe.com/2006/mxml"; layout="absolute" xmlns:ns1="*" creationComplete="test()"> --- And it seems to work fine for me. So I'm happy to file a bug, but please give me the code you were actually using that failed with a copy-paste, rather than re-typing it from memory. -J On Wed, May 14, 2008 at 3:58 PM, Alex Harui <[EMAIL PROTECTED]> wrote: >Sure. Thanks. > > > -- > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Josh McDonald > *Sent:* Tuesday, May 13, 2008 10:53 PM > > *To:* flexcoders@yahoogroups.com > *Subject:* Re: [flexcoders] error while extending dictionary error .. > > > > Yeah, that's all I expected. That way even without knowing the why straight > away, at least you fail-early if you try to do it. Would you like me to file > a bug? > > -J > > On Wed, May 14, 2008 at 3:50 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > Yes, although the fix might be to mark it final. > > > -- > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Josh McDonald > *Sent:* Tuesday, May 13, 2008 10:41 PM > > > *To:* flexcoders@yahoogroups.com > *Subject:* Re: [flexcoders] error while extending dictionary error .. > > > > On the plus side, I'm glad you tried, as weak references stuff will come in > handy, and I only noticed it as a feature of Dictionary when I > double-checked that it wasn't final just now. > > More importantly, since there appears to be voodoo that stops you from > subclassing it, should it be counted as a bug that it's *not* final? > > -J > > On Wed, May 14, 2008 at 3:35 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > I hadn't heard of anyone doing it before so it was possible there was a bug > in there somewhere, and it didn't seem necessary as you ended up anyway. > > > ------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mayur Bais > *Sent:* Tuesday, May 13, 2008 10:04 PM > *To:* flexcoders@yahoogroups.com > *Subject:* Re: [flexcoders] error while extending dictionary error .. > > > > :) :) sure ...there is nothing that I could not do without extending > dictionary... > with singleTon , I wanted to have the only once reference across the > application .. > > I tried once extending it..and ran into a problem..and then solved it by > not sub classing it (directly returning).. > But the curiosity was there in my mind ..hence put up the question here... > > Here is the class which i had tried extending dictionary: (though it did > not worked...) > > package ms.imfusion.model { > > import flash.utils.Dictionary; > import ms.imfusion.Constants; > > public class MemberList extend dictionary > { > >private static var instance:MemberList; // instance of self. > > > > /** > * property memberList of type Dictionary > */ > public var memberList:Dictionary; > > > /** > * constructor > */ > public function MemberList(){ > super(); > } > > > /** > * Returns the reference to self > */ > public static function getInstance():MemberList { > if(instance == null){ > instance = new MemberList(); > } > return instance; > } > > > /** > * Append t
RE: [flexcoders] error while extending dictionary error ..
Sure. Thanks. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 10:53 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] error while extending dictionary error .. Yeah, that's all I expected. That way even without knowing the why straight away, at least you fail-early if you try to do it. Would you like me to file a bug? -J On Wed, May 14, 2008 at 3:50 PM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Yes, although the fix might be to mark it final. From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 10:41 PM To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> Subject: Re: [flexcoders] error while extending dictionary error .. On the plus side, I'm glad you tried, as weak references stuff will come in handy, and I only noticed it as a feature of Dictionary when I double-checked that it wasn't final just now. More importantly, since there appears to be voodoo that stops you from subclassing it, should it be counted as a bug that it's *not* final? -J On Wed, May 14, 2008 at 3:35 PM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: I hadn't heard of anyone doing it before so it was possible there was a bug in there somewhere, and it didn't seem necessary as you ended up anyway. From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ] On Behalf Of Mayur Bais Sent: Tuesday, May 13, 2008 10:04 PM To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> Subject: Re: [flexcoders] error while extending dictionary error .. :) :) sure ...there is nothing that I could not do without extending dictionary... with singleTon , I wanted to have the only once reference across the application .. I tried once extending it..and ran into a problem..and then solved it by not sub classing it (directly returning).. But the curiosity was there in my mind ..hence put up the question here... Here is the class which i had tried extending dictionary: (though it did not worked...) package ms.imfusion.model { import flash.utils.Dictionary; import ms.imfusion.Constants; public class MemberList extend dictionary { private static var instance:MemberList; // instance of self. /** * property memberList of type Dictionary */ public var memberList:Dictionary; /** * constructor */ public function MemberList(){ super(); } /** * Returns the reference to self */ public static function getInstance():MemberList { if(instance == null){ instance = new MemberList(); } return instance; } /** * Append to memeberlist * @param tempMember * @returns void */ public function appendtomemelist(tempMember:MemberObject):void { var userId:int = tempMember.userId; memberList[userId] = tempMember; } /** * Creating memberlist * @param obj from server * creates MemberObject object and adds to memberlist dictionary * @returns void */ public function addToMemberlist(obj:Object):void { for(var i:int=0;imailto:[EMAIL PROTECTED]> > wrote: If it's not giving away any business secrets, why on earth would you want to subclass Dictionary? Flex already has some sort of built in support for singletons, I believe. -J On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Any specific reason why we should not extend dictionary..? I got it working by writing one getter method in the class which returned dictionary... just curious On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Don't extend dictionary, just return a Dictionary. From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ] On Behalf Of Mayur Bais Sent: Tuesday, May 13, 2008 2:11 AM To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ; flexcoders@yahoogroups.com <mailto:flexc
Re: [flexcoders] error while extending dictionary error ..
Yeah, that's all I expected. That way even without knowing the why straight away, at least you fail-early if you try to do it. Would you like me to file a bug? -J On Wed, May 14, 2008 at 3:50 PM, Alex Harui <[EMAIL PROTECTED]> wrote: >Yes, although the fix might be to mark it final. > > > -- > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Josh McDonald > *Sent:* Tuesday, May 13, 2008 10:41 PM > > *To:* flexcoders@yahoogroups.com > *Subject:* Re: [flexcoders] error while extending dictionary error .. > > > > On the plus side, I'm glad you tried, as weak references stuff will come in > handy, and I only noticed it as a feature of Dictionary when I > double-checked that it wasn't final just now. > > More importantly, since there appears to be voodoo that stops you from > subclassing it, should it be counted as a bug that it's *not* final? > > -J > > On Wed, May 14, 2008 at 3:35 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > I hadn't heard of anyone doing it before so it was possible there was a bug > in there somewhere, and it didn't seem necessary as you ended up anyway. > > > -- > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mayur Bais > *Sent:* Tuesday, May 13, 2008 10:04 PM > *To:* flexcoders@yahoogroups.com > *Subject:* Re: [flexcoders] error while extending dictionary error .. > > > > :) :) sure ...there is nothing that I could not do without extending > dictionary... > with singleTon , I wanted to have the only once reference across the > application .. > > I tried once extending it..and ran into a problem..and then solved it by > not sub classing it (directly returning).. > But the curiosity was there in my mind ..hence put up the question here... > > Here is the class which i had tried extending dictionary: (though it did > not worked...) > > package ms.imfusion.model { > > import flash.utils.Dictionary; > import ms.imfusion.Constants; > > public class MemberList extend dictionary > { > >private static var instance:MemberList; // instance of self. > > > > /** > * property memberList of type Dictionary > */ > public var memberList:Dictionary; > > > /** > * constructor > */ > public function MemberList(){ > super(); > } > > > /** > * Returns the reference to self > */ > public static function getInstance():MemberList { > if(instance == null){ > instance = new MemberList(); > } > return instance; > } > > > /** > * Append to memeberlist > * @param tempMember > * @returns void > */ > public function appendtomemelist(tempMember:MemberObject):void { > var userId:int = tempMember.userId; > memberList[userId] = tempMember; > } > > > /** > * Creating memberlist > * @param obj from server > * creates MemberObject object and adds to memberlist dictionary > * @returns void > */ > public function addToMemberlist(obj:Object):void { >for(var i:int=0;i var tempMember:MemberObject = new MemberObject() > tempMember.fill(obj[i]); > appendtomemelist(tempMember); > } > } > > > /** > *Set instance of memberList null on logout > */ > public static function setInstanceNull():void{ > instance = null; // clear mermber information in the current > session > } > } > } > > On Wed, May 14, 2008 at 10:19 AM, Josh McDonald <[EMAIL PROTECTED]> wrote: > > If it's not giving away any business secrets, why on earth would you want > to subclass Dictionary? Flex already has some sort of built in support for > singletons, I believe. > > -J > > > > On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED]> wrote: > > Any specific reason why we should not extend dictionary..? > I got it working by writing one getter method in the class which returned > dictionary... > just curious > > > > On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > Don't extend dictionary, just return a Dictionary. > > > -- > > *From:* flexcoders@yahoogr
RE: [flexcoders] error while extending dictionary error ..
Yes, although the fix might be to mark it final. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Josh McDonald Sent: Tuesday, May 13, 2008 10:41 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] error while extending dictionary error .. On the plus side, I'm glad you tried, as weak references stuff will come in handy, and I only noticed it as a feature of Dictionary when I double-checked that it wasn't final just now. More importantly, since there appears to be voodoo that stops you from subclassing it, should it be counted as a bug that it's *not* final? -J On Wed, May 14, 2008 at 3:35 PM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: I hadn't heard of anyone doing it before so it was possible there was a bug in there somewhere, and it didn't seem necessary as you ended up anyway. From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ] On Behalf Of Mayur Bais Sent: Tuesday, May 13, 2008 10:04 PM To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> Subject: Re: [flexcoders] error while extending dictionary error .. :) :) sure ...there is nothing that I could not do without extending dictionary... with singleTon , I wanted to have the only once reference across the application .. I tried once extending it..and ran into a problem..and then solved it by not sub classing it (directly returning).. But the curiosity was there in my mind ..hence put up the question here... Here is the class which i had tried extending dictionary: (though it did not worked...) package ms.imfusion.model { import flash.utils.Dictionary; import ms.imfusion.Constants; public class MemberList extend dictionary { private static var instance:MemberList; // instance of self. /** * property memberList of type Dictionary */ public var memberList:Dictionary; /** * constructor */ public function MemberList(){ super(); } /** * Returns the reference to self */ public static function getInstance():MemberList { if(instance == null){ instance = new MemberList(); } return instance; } /** * Append to memeberlist * @param tempMember * @returns void */ public function appendtomemelist(tempMember:MemberObject):void { var userId:int = tempMember.userId; memberList[userId] = tempMember; } /** * Creating memberlist * @param obj from server * creates MemberObject object and adds to memberlist dictionary * @returns void */ public function addToMemberlist(obj:Object):void { for(var i:int=0;imailto:[EMAIL PROTECTED]> > wrote: If it's not giving away any business secrets, why on earth would you want to subclass Dictionary? Flex already has some sort of built in support for singletons, I believe. -J On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Any specific reason why we should not extend dictionary..? I got it working by writing one getter method in the class which returned dictionary... just curious On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Don't extend dictionary, just return a Dictionary. From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ] On Behalf Of Mayur Bais Sent: Tuesday, May 13, 2008 2:11 AM To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ; flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> Subject: [flexcoders] error while extending dictionary error .. Hi all, I have class extending a dictionary class: public class mydict extends Dictionary { publicstatic instance:mydict // done to maintain singleton class function mydict (){ super(); } public static funtion getInstance():mydict { return instance; } function addTodict(id:int,val:String):void{ mydict [id] = val // its giving me error here...can not create proeprty 26..(if id was 26..) on mydict } } Any work around?? Regards Mayur -- "Therefore, send not to know For whom the bell tolls. It tolls for the
Re: [flexcoders] error while extending dictionary error ..
ah..ok... got it :) thanks On Wed, May 14, 2008 at 11:03 AM, Josh McDonald <[EMAIL PROTECTED]> wrote: > I'm not speaking from authority, but I'm 99% sure that Dictionary either > partly is, or relies on some native code that lives in the flash plug-in > rather than in the Flex SDK library in order to provide the weakKeys > functionality, and that's why you can't subclass it. > > -J > > > On Wed, May 14, 2008 at 3:04 PM, Mayur Bais <[EMAIL PROTECTED]> wrote: > > > :) :) sure ...there is nothing that I could not do without extending > > dictionary... > > with singleTon , I wanted to have the only once reference across the > > application .. > > > > I tried once extending it..and ran into a problem..and then solved it by > > not sub classing it (directly returning).. > > But the curiosity was there in my mind ..hence put up the question > > here... > > > > Here is the class which i had tried extending dictionary: (though it did > > not worked...) > > > > package ms.imfusion.model { > > > > import flash.utils.Dictionary; > > import ms.imfusion.Constants; > > > > public class MemberList extend dictionary > > { > > > >private static var instance:MemberList; // instance of self. > > > > > > > > /** > > * property memberList of type Dictionary > > */ > > public var memberList:Dictionary; > > > > > > /** > > * constructor > > */ > > public function MemberList(){ > > super(); > > } > > > > > > /** > > * Returns the reference to self > > */ > > public static function getInstance():MemberList { > > if(instance == null){ > > instance = new MemberList(); > > } > > return instance; > > } > > > > > > /** > > * Append to memeberlist > > * @param tempMember > > * @returns void > > */ > > public function appendtomemelist(tempMember:MemberObject):void { > > var userId:int = tempMember.userId; > > memberList[userId] = tempMember; > > } > > > > > > /** > > * Creating memberlist > > * @param obj from server > > * creates MemberObject object and adds to memberlist dictionary > > > > * @returns void > > */ > > public function addToMemberlist(obj:Object):void { > >for(var i:int=0;i > var tempMember:MemberObject = new MemberObject() > > tempMember.fill(obj[i]); > > appendtomemelist(tempMember); > > } > > } > > > > > > /** > > *Set instance of memberList null on logout > > */ > > public static function setInstanceNull():void{ > > instance = null; // clear mermber information in the > > current session > > } > > } > > } > > > > > > On Wed, May 14, 2008 at 10:19 AM, Josh McDonald <[EMAIL PROTECTED]> > > wrote: > > > > > If it's not giving away any business secrets, why on earth would you > > > want to subclass Dictionary? Flex already has some sort of built in > > > support > > > for singletons, I believe. > > > > > > -J > > > > > > > > > On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED]> > > > wrote: > > > > > > > Any specific reason why we should not extend dictionary..? > > > > I got it working by writing one getter method in the class which > > > > returned dictionary... > > > > just curious > > > > > > > > > > > > On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED]> > > > > wrote: > > > > > > > > >Don't extend dictionary, just return a Dictionary. > > > > > > > > > > > > > > > -- > > > > > > > > > > *From:* flexcoders@yahoogroups.com [mailto: > > > > > [EMAIL PROTECTED] *On Behalf Of *Mayur Bais > > > > > *Sent:* Tuesday, May 13, 2008 2:11 AM > > > > > *To:* [EMAIL PROTECTED]; flexcoders@yahoogroup
Re: [flexcoders] error while extending dictionary error ..
On the plus side, I'm glad you tried, as weak references stuff will come in handy, and I only noticed it as a feature of Dictionary when I double-checked that it wasn't final just now. More importantly, since there appears to be voodoo that stops you from subclassing it, should it be counted as a bug that it's *not* final? -J On Wed, May 14, 2008 at 3:35 PM, Alex Harui <[EMAIL PROTECTED]> wrote: >I hadn't heard of anyone doing it before so it was possible there was a > bug in there somewhere, and it didn't seem necessary as you ended up anyway. > > > -- > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mayur Bais > *Sent:* Tuesday, May 13, 2008 10:04 PM > *To:* flexcoders@yahoogroups.com > *Subject:* Re: [flexcoders] error while extending dictionary error .. > > > > :) :) sure ...there is nothing that I could not do without extending > dictionary... > with singleTon , I wanted to have the only once reference across the > application .. > > I tried once extending it..and ran into a problem..and then solved it by > not sub classing it (directly returning).. > But the curiosity was there in my mind ..hence put up the question here... > > Here is the class which i had tried extending dictionary: (though it did > not worked...) > > package ms.imfusion.model { > > import flash.utils.Dictionary; > import ms.imfusion.Constants; > > public class MemberList extend dictionary > { > >private static var instance:MemberList; // instance of self. > > > > /** > * property memberList of type Dictionary > */ > public var memberList:Dictionary; > > > /** > * constructor > */ > public function MemberList(){ > super(); > } > > > /** > * Returns the reference to self > */ > public static function getInstance():MemberList { > if(instance == null){ > instance = new MemberList(); > } > return instance; > } > > > /** > * Append to memeberlist > * @param tempMember > * @returns void > */ > public function appendtomemelist(tempMember:MemberObject):void { > var userId:int = tempMember.userId; > memberList[userId] = tempMember; > } > > > /** > * Creating memberlist > * @param obj from server > * creates MemberObject object and adds to memberlist dictionary > * @returns void > */ > public function addToMemberlist(obj:Object):void { >for(var i:int=0;i var tempMember:MemberObject = new MemberObject() > tempMember.fill(obj[i]); > appendtomemelist(tempMember); > } > } > > > /** > *Set instance of memberList null on logout > */ > public static function setInstanceNull():void{ > instance = null; // clear mermber information in the current > session > } > } > } > > On Wed, May 14, 2008 at 10:19 AM, Josh McDonald <[EMAIL PROTECTED]> wrote: > > If it's not giving away any business secrets, why on earth would you want > to subclass Dictionary? Flex already has some sort of built in support for > singletons, I believe. > > -J > > > > On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED]> wrote: > > Any specific reason why we should not extend dictionary..? > I got it working by writing one getter method in the class which returned > dictionary... > just curious........ > > > > On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > Don't extend dictionary, just return a Dictionary. > > > -- > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mayur Bais > *Sent:* Tuesday, May 13, 2008 2:11 AM > *To:* [EMAIL PROTECTED]; flexcoders@yahoogroups.com > *Subject:* [flexcoders] error while extending dictionary error .. > > > > Hi all, > I have class extending a dictionary class: > > public class mydict extends Dictionary > { > publicstatic instance:mydict // done to maintain singleton class > function mydict (){ > super(); > } > >public static funtion getInstance():mydict { > return instance; > } > > function addTodict(id:int,val:String):void{ > mydict [id] = val // its giving me error here...can not create > proeprty 26..(if id was 26..) on mydict >} > } > > > > Any work around?? > > Regards > Mayur > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > :: Josh 'G-Funk' McDonald > :: 0437 221 380 :: [EMAIL PROTECTED] > > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
RE: [flexcoders] error while extending dictionary error ..
I hadn't heard of anyone doing it before so it was possible there was a bug in there somewhere, and it didn't seem necessary as you ended up anyway. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mayur Bais Sent: Tuesday, May 13, 2008 10:04 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] error while extending dictionary error .. :) :) sure ...there is nothing that I could not do without extending dictionary... with singleTon , I wanted to have the only once reference across the application .. I tried once extending it..and ran into a problem..and then solved it by not sub classing it (directly returning).. But the curiosity was there in my mind ..hence put up the question here... Here is the class which i had tried extending dictionary: (though it did not worked...) package ms.imfusion.model { import flash.utils.Dictionary; import ms.imfusion.Constants; public class MemberList extend dictionary { private static var instance:MemberList; // instance of self. /** * property memberList of type Dictionary */ public var memberList:Dictionary; /** * constructor */ public function MemberList(){ super(); } /** * Returns the reference to self */ public static function getInstance():MemberList { if(instance == null){ instance = new MemberList(); } return instance; } /** * Append to memeberlist * @param tempMember * @returns void */ public function appendtomemelist(tempMember:MemberObject):void { var userId:int = tempMember.userId; memberList[userId] = tempMember; } /** * Creating memberlist * @param obj from server * creates MemberObject object and adds to memberlist dictionary * @returns void */ public function addToMemberlist(obj:Object):void { for(var i:int=0;imailto:[EMAIL PROTECTED]> > wrote: If it's not giving away any business secrets, why on earth would you want to subclass Dictionary? Flex already has some sort of built in support for singletons, I believe. -J On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Any specific reason why we should not extend dictionary..? I got it working by writing one getter method in the class which returned dictionary... just curious On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Don't extend dictionary, just return a Dictionary. From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ] On Behalf Of Mayur Bais Sent: Tuesday, May 13, 2008 2:11 AM To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ; flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> Subject: [flexcoders] error while extending dictionary error .. Hi all, I have class extending a dictionary class: public class mydict extends Dictionary { publicstatic instance:mydict // done to maintain singleton class function mydict (){ super(); } public static funtion getInstance():mydict { return instance; } function addTodict(id:int,val:String):void{ mydict [id] = val // its giving me error here...can not create proeprty 26..(if id was 26..) on mydict } } Any work around?? Regards Mayur -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Re: [flexcoders] error while extending dictionary error ..
I'm not speaking from authority, but I'm 99% sure that Dictionary either partly is, or relies on some native code that lives in the flash plug-in rather than in the Flex SDK library in order to provide the weakKeys functionality, and that's why you can't subclass it. -J On Wed, May 14, 2008 at 3:04 PM, Mayur Bais <[EMAIL PROTECTED]> wrote: > :) :) sure ...there is nothing that I could not do without extending > dictionary... > with singleTon , I wanted to have the only once reference across the > application .. > > I tried once extending it..and ran into a problem..and then solved it by > not sub classing it (directly returning).. > But the curiosity was there in my mind ..hence put up the question here... > > Here is the class which i had tried extending dictionary: (though it did > not worked...) > > package ms.imfusion.model { > > import flash.utils.Dictionary; > import ms.imfusion.Constants; > > public class MemberList extend dictionary > { > >private static var instance:MemberList; // instance of self. > > > > /** > * property memberList of type Dictionary > */ > public var memberList:Dictionary; > > > /** > * constructor > */ > public function MemberList(){ > super(); > } > > > /** > * Returns the reference to self > */ > public static function getInstance():MemberList { > if(instance == null){ > instance = new MemberList(); > } > return instance; > } > > > /** > * Append to memeberlist > * @param tempMember > * @returns void > */ > public function appendtomemelist(tempMember:MemberObject):void { > var userId:int = tempMember.userId; > memberList[userId] = tempMember; > } > > > /** > * Creating memberlist > * @param obj from server > * creates MemberObject object and adds to memberlist dictionary > * @returns void > */ > public function addToMemberlist(obj:Object):void { >for(var i:int=0;i var tempMember:MemberObject = new MemberObject() > tempMember.fill(obj[i]); > appendtomemelist(tempMember); > } > } > > > /** > *Set instance of memberList null on logout > */ > public static function setInstanceNull():void{ > instance = null; // clear mermber information in the current > session > } > } > } > > > On Wed, May 14, 2008 at 10:19 AM, Josh McDonald <[EMAIL PROTECTED]> wrote: > >> If it's not giving away any business secrets, why on earth would you >> want to subclass Dictionary? Flex already has some sort of built in support >> for singletons, I believe. >> >> -J >> >> >> On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED]> wrote: >> >>> Any specific reason why we should not extend dictionary..? >>> I got it working by writing one getter method in the class which returned >>> dictionary... >>> just curious >>> >>> >>> On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED]> wrote: >>> >>>>Don't extend dictionary, just return a Dictionary. >>>> >>>> >>>> -- >>>> >>>> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] >>>> *On Behalf Of *Mayur Bais >>>> *Sent:* Tuesday, May 13, 2008 2:11 AM >>>> *To:* [EMAIL PROTECTED]; flexcoders@yahoogroups.com >>>> *Subject:* [flexcoders] error while extending dictionary error .. >>>> >>>> >>>> >>>> Hi all, >>>> I have class extending a dictionary class: >>>> >>>> public class mydict extends Dictionary >>>> { >>>> publicstatic instance:mydict // done to maintain singleton >>>> class >>>> function mydict (){ >>>> super(); >>>> } >>>> >>>>public static funtion getInstance():mydict { >>>> return instance; >>>> } >>>> >>>> function addTodict(id:int,val:String):void{ >>>> mydict [id] = val // its giving me error here...can not create >>>> proeprty 26..(if id was 26..) on mydict >>>>} >>>> } >>>> >>>> >>>> >>>> Any work around?? >>>> >>>> Regards >>>> Mayur >>>> >>>> >>> >> >> >> -- >> "Therefore, send not to know For whom the bell tolls. It tolls for thee." >> >> :: Josh 'G-Funk' McDonald >> :: 0437 221 380 :: [EMAIL PROTECTED] >> > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
Re: [flexcoders] error while extending dictionary error ..
:) :) sure ...there is nothing that I could not do without extending dictionary... with singleTon , I wanted to have the only once reference across the application .. I tried once extending it..and ran into a problem..and then solved it by not sub classing it (directly returning).. But the curiosity was there in my mind ..hence put up the question here... Here is the class which i had tried extending dictionary: (though it did not worked...) package ms.imfusion.model { import flash.utils.Dictionary; import ms.imfusion.Constants; public class MemberList extend dictionary { private static var instance:MemberList; // instance of self. /** * property memberList of type Dictionary */ public var memberList:Dictionary; /** * constructor */ public function MemberList(){ super(); } /** * Returns the reference to self */ public static function getInstance():MemberList { if(instance == null){ instance = new MemberList(); } return instance; } /** * Append to memeberlist * @param tempMember * @returns void */ public function appendtomemelist(tempMember:MemberObject):void { var userId:int = tempMember.userId; memberList[userId] = tempMember; } /** * Creating memberlist * @param obj from server * creates MemberObject object and adds to memberlist dictionary * @returns void */ public function addToMemberlist(obj:Object):void { for(var i:int=0;i wrote: > If it's not giving away any business secrets, why on earth would you > want to subclass Dictionary? Flex already has some sort of built in support > for singletons, I believe. > > -J > > > On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED]> wrote: > > > Any specific reason why we should not extend dictionary..? > > I got it working by writing one getter method in the class which > > returned dictionary... > > just curious > > > > > > On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > > > >Don't extend dictionary, just return a Dictionary. > > > > > > > > > -- > > > > > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] > > > *On Behalf Of *Mayur Bais > > > *Sent:* Tuesday, May 13, 2008 2:11 AM > > > *To:* [EMAIL PROTECTED]; flexcoders@yahoogroups.com > > > *Subject:* [flexcoders] error while extending dictionary error .. > > > > > > > > > > > > Hi all, > > > I have class extending a dictionary class: > > > > > > public class mydict extends Dictionary > > > { > > > publicstatic instance:mydict // done to maintain singleton > > > class > > > function mydict (){ > > > super(); > > > } > > > > > >public static funtion getInstance():mydict { > > > return instance; > > > } > > > > > > function addTodict(id:int,val:String):void{ > > > mydict [id] = val // its giving me error here...can not create > > > proeprty 26..(if id was 26..) on mydict > > >} > > > } > > > > > > > > > > > > Any work around?? > > > > > > Regards > > > Mayur > > > > > > > > > > > -- > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > :: Josh 'G-Funk' McDonald > :: 0437 221 380 :: [EMAIL PROTECTED] > >
Re: [flexcoders] error while extending dictionary error ..
If it's not giving away any business secrets, why on earth would you want to subclass Dictionary? Flex already has some sort of built in support for singletons, I believe. -J On Wed, May 14, 2008 at 2:43 PM, Mayur Bais <[EMAIL PROTECTED]> wrote: > Any specific reason why we should not extend dictionary..? > I got it working by writing one getter method in the class which returned > dictionary... > just curious > > > On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > >>Don't extend dictionary, just return a Dictionary. >> >> >> -- >> >> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On >> Behalf Of *Mayur Bais >> *Sent:* Tuesday, May 13, 2008 2:11 AM >> *To:* [EMAIL PROTECTED]; flexcoders@yahoogroups.com >> *Subject:* [flexcoders] error while extending dictionary error .. >> >> >> >> Hi all, >> I have class extending a dictionary class: >> >> public class mydict extends Dictionary >> { >> publicstatic instance:mydict // done to maintain singleton class >> function mydict (){ >> super(); >> } >> >>public static funtion getInstance():mydict { >> return instance; >> } >> >> function addTodict(id:int,val:String):void{ >> mydict [id] = val // its giving me error here...can not create >> proeprty 26..(if id was 26..) on mydict >>} >> } >> >> >> >> Any work around?? >> >> Regards >> Mayur >> >> > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]
Re: [flexcoders] error while extending dictionary error ..
Any specific reason why we should not extend dictionary..? I got it working by writing one getter method in the class which returned dictionary... just curious On Tue, May 13, 2008 at 11:11 PM, Alex Harui <[EMAIL PROTECTED]> wrote: >Don't extend dictionary, just return a Dictionary. > > > -- > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Mayur Bais > *Sent:* Tuesday, May 13, 2008 2:11 AM > *To:* [EMAIL PROTECTED]; flexcoders@yahoogroups.com > *Subject:* [flexcoders] error while extending dictionary error .. > > > > Hi all, > I have class extending a dictionary class: > > public class mydict extends Dictionary > { > publicstatic instance:mydict // done to maintain singleton class > function mydict (){ > super(); > } > >public static funtion getInstance():mydict { > return instance; > } > > function addTodict(id:int,val:String):void{ > mydict [id] = val // its giving me error here...can not create > proeprty 26..(if id was 26..) on mydict >} > } > > > > Any work around?? > > Regards > Mayur > > >
RE: [flexcoders] error while extending dictionary error ..
Don't extend dictionary, just return a Dictionary. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Mayur Bais Sent: Tuesday, May 13, 2008 2:11 AM To: [EMAIL PROTECTED]; flexcoders@yahoogroups.com Subject: [flexcoders] error while extending dictionary error .. Hi all, I have class extending a dictionary class: public class mydict extends Dictionary { publicstatic instance:mydict // done to maintain singleton class function mydict (){ super(); } public static funtion getInstance():mydict { return instance; } function addTodict(id:int,val:String):void{ mydict [id] = val // its giving me error here...can not create proeprty 26..(if id was 26..) on mydict } } Any work around?? Regards Mayur
[flexcoders] error while extending dictionary error ..
Hi all, I have class extending a dictionary class: public class mydict extends Dictionary { publicstatic instance:mydict // done to maintain singleton class function mydict (){ super(); } public static funtion getInstance():mydict { return instance; } function addTodict(id:int,val:String):void{ mydict [id] = val // its giving me error here...can not create proeprty 26..(if id was 26..) on mydict } } Any work around?? Regards Mayur