[flexcoders] Re: getDefinitionByName

2006-12-08 Thread Daniel
Nevermind, for some reason it didnt work in the past, but now its
working perfectly.
Sweet!



--- In flexcoders@yahoogroups.com, Daniel [EMAIL PROTECTED] wrote:

 Im using the method getDefinitionByName so I can get instances of
 classes which I only know their name.
 Now, this classes always receive 2 parameters in their constructor.
 My question would be, how can I pass these parameters using the method
 getDefinitionByName, somehing like:
 
 var name:String = Daniel;
 var nickname:String = danboh;
 var ClassName:String = AddClient
 var ClassReference : Class =
 getDefinitionByName(com.client.+ClassName) as Class; 
 var instance : Object = new ClassReference(name, nickname);
 
 Any suggestions???
 
 Thanks for your help!





RE: [flexcoders] Re: getDefinitionByName(): Variable ... is not defined.

2006-10-14 Thread Matt Chotin












You could also look into the includes
compiler directive.



Matt











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of gustavo.saume
Sent: Wednesday, October 11, 2006
5:11 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re:
getDefinitionByName(): Variable ... is not defined.











Hello Tobias,

i recently had the same problem, the workarround i usesd was to create
a class with a variable declaration of all the classes i might create

eg. public class AllClasses
{
public var tmp1:classOne;
public var tmp2:classTwo;
}

and then in my class where i call getDefinitionByName i created
another varible of this type (eg. public var tmp:AllClasses)...you
dont need to instanciate it...

it´s almost the same but at least is a bit organized...

if anyone have a more elegant solution please notify...
Gus.

--- In [EMAIL PROTECTED]ups.com,
tobiaspatton tobias.patton@...
wrote:

 Hello List;
 
 I'm trying to create an interface where a user's selection in a menu 
 component results in other components being created. Right now I'm 
 just prototyping, and experimenting with different ways I might do 
 this.
 
 One way I've thought of is to use an XML data provider for the list 
 where an attribute of each menu entry describes a class that should 
 be instantiated when that item is selected.
 
 e.g.
 
 menu item label=classOne 
 childClass=com.Kodak.Galiano.Test.classOne/
 
 I'm running into a problem, though. Because classOne is never 
 actually used in the source code, classOne is not being
compiled 
 and linked into the application. When I call getDefinitionByName
 ( com.Kodak.Galiano.Test.classOne ), there is an error:
Variable 
 classOne is not defined.
 
 Is there some trick I can use to force classOne to be compiled and 
 linked into the application? Right now my solution is to add a 
 private function that defines a local variable of the appropriate 
 type.
 
 private function TrickCompiler() : void
 {
 var x : classOne;
 }
 
 This does the trick, but it sure seems hacky.
 
 Thanks.
 Tobias.







__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___






[flexcoders] Re: getDefinitionByName

2006-09-05 Thread Daniel Freiman



nevermind, got it to work, still can't figure out what I changed.On 9/5/06, Daniel Freiman [EMAIL PROTECTED]
 wrote:I want to use getDefinitionByName in the flash.utils package to get a class by it's name. I've tried the example in the language reference using Sprite and that works fine but when I use flex classes it doesn't seem to work (I've tried classes I've made and 
mx.controls.ComboBox). Is there a limitation of this function that I'm missing?Dan



__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___