[flexcoders] Call Popup via string var

2005-06-17 Thread Fernando Lobos



i try call pop via : var popup12 = mx.managers.PopUpManager.createPopUp(_root,frm_matriculas, modal, {deferred: true});all ok !But this way var popup12 = mx.managers.PopUpManager.createPopUp
(_root,frm_matriculas, modal, {deferred: true});function llama_popup (pop_1:object ){ var popup12 = mx.managers.PopUpManager.createPopUp(_root, pop_1,modal, {deferred: true});}
nuevopopup:objectnuevopopup = frm_matriculasllama_popup(nuevopopup)-nothing, can i do for call popup function with 
string ?








Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] Call Popup via string var

2005-06-17 Thread Matt Chotin










You need to make sure that frm_matriculas
is still linked into your application. If Flex does not see a reference to
that class it will not put it in the SWF for you.



Add something like this line to your
Application:

var dependency : frm_matriculas; 



HTH,

Matt











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Fernando Lobos
Sent: Friday, June 17, 2005 2:21
PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Call Popup
via string var





i try call pop via :


 var popup12 = mx.managers.PopUpManager.createPopUp(_root,
frm_matriculas, modal, {deferred: true});


all ok !


But this way


 var popup12 = mx.managers.PopUpManager.createPopUp (_root,
frm_matriculas, modal, {deferred: true});


function llama_popup (pop_1:object ){

 var popup12 = mx.managers.PopUpManager.createPopUp(_root, pop_1,
modal, {deferred: true});

}

nuevopopup:object

nuevopopup = frm_matriculas
llama_popup(nuevopopup)

-
nothing, can i do for call popup
function with string ? 










Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.












Re: [flexcoders] call popup with string

2005-03-09 Thread Manish Jethani
On Tue, 8 Mar 2005 10:50:25 -0300, Fernando Lobos
[EMAIL PROTECTED] wrote:

 function llama_popup (pop_1:object ){
 
 var popup12 = mx.managers.PopUpManager.createPopUp(_root, pop_1,
 modal, {deferred: true});
 
 }
 
 nuevopopup:object
 
 nuevopopup = frm_matriculas
 llama_popup(nuevopopup)

The second argument to createPopUp() is an object, a reference to the
class, not a string (the name of the class). So if you remove the
quotes around frm_matriculas it should work.

Manish




Re: [flexcoders] call popup with string

2005-03-09 Thread Fernando Lobos
yes, i know but , who can instantiate a class via string from variable?


On Wed, 9 Mar 2005 14:58:40 +0530, Manish Jethani
[EMAIL PROTECTED] wrote:
 On Tue, 8 Mar 2005 10:50:25 -0300, Fernando Lobos
 [EMAIL PROTECTED] wrote:
 
  function llama_popup (pop_1:object ){
  
  var popup12 = mx.managers.PopUpManager.createPopUp(_root, pop_1,
  modal, {deferred: true});
  
  }
  
  nuevopopup:object
  
  nuevopopup = frm_matriculas
  llama_popup(nuevopopup)
 
 The second argument to createPopUp() is an object, a reference to the
 class, not a string (the name of the class). So if you remove the
 quotes around frm_matriculas it should work.
 
 Manish
 
 Yahoo! Groups Sponsor
 ADVERTISEMENT
 
 
 Yahoo! Groups Links
 
 To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 
 To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
 
 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




Re: [flexcoders] call popup with string

2005-03-09 Thread Manish Jethani
On Wed, 9 Mar 2005 08:29:44 -0300, Fernando Lobos
[EMAIL PROTECTED] wrote:

 yes, i know but , who can instantiate a class via string from variable?

Actually that's what UIObject does internally. It does attachMovie()
on the class's symbolName. So, yes, it's possible to create an object
from a string identifying the class. Using the class reference seems
to be the preferred way in Flex.

If all you have is strings, you can create a mapping from the strings
to their corresponding class references and look up the mapping every
time you need a reference. Maybe there's a better Flash Way (TM) that
I'm not aware of (some sibling of Object.registerClass() ).

Manish




RE: [flexcoders] call popup with string

2005-03-09 Thread Dirk Eismann
Hi,

 yes, i know but , who can instantiate a class via string from 
 variable?

Flex cannot load a class dynamically - you'll have to make sure that the class 
gets compiled into your SWF file. This can be achieved by referencing the class 
somewhere inside your code, e.g.

function dependency():Void {
// this function does nothing but
// ensures that your class gets compiled in
foo.bar.MyClass;
}

If you need to instantiate a class by its name then try using the findClass() 
method of the mx.utils.ClasSUtil class:

import mx.utils.ClassUtil;

var f:Function = ClassUtil.findClass(foo.bar.MyClass);
var myInstance = new f();

Dirk.




RE: [flexcoders] call popup with string

2005-03-09 Thread Erik Westra
To instantiate classes via a string I do the folowing:

I have a class Popups.as:

class Popups
{
public function Popups()
{
package.className1;
package.className2;
package.className3;
};
};

The above class makes sure the classes are included in the swf.

Then when I need to access it I can do things like:

var classString = package.className3;

var classRef = _global;
var class_array = classString.split(.);
for (var i = 0; i  class_array.length; i++)
{
classRef = classRef[class_array[i]];
};

Then u can use classRef to do whatever u want.

Greetz Erik


-Original Message-
From: Manish Jethani [mailto:[EMAIL PROTECTED] 
Sent: woensdag 9 maart 2005 13:05
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] call popup with string


On Wed, 9 Mar 2005 08:29:44 -0300, Fernando Lobos
[EMAIL PROTECTED] wrote:

 yes, i know but , who can instantiate a class via string from
variable?

Actually that's what UIObject does internally. It does attachMovie() on
the class's symbolName. So, yes, it's possible to create an object from
a string identifying the class. Using the class reference seems to be
the preferred way in Flex.

If all you have is strings, you can create a mapping from the strings to
their corresponding class references and look up the mapping every time
you need a reference. Maybe there's a better Flash Way (TM) that I'm
not aware of (some sibling of Object.registerClass() ).

Manish


 
Yahoo! Groups Links



 







Re: [flexcoders] call popup with string

2005-03-09 Thread Fernando Lobos
thanx all for your help!


On Wed, 9 Mar 2005 13:20:18 +0100, Erik Westra [EMAIL PROTECTED] wrote:
 To instantiate classes via a string I do the folowing:
 
 I have a class Popups.as:
 
 class Popups
 {
 public function Popups()
 {
 package.className1;
 package.className2;
 package.className3;
 };
 };
 
 The above class makes sure the classes are included in the swf.
 
 Then when I need to access it I can do things like:
 
 var classString = package.className3;
 
 var classRef = _global;
 var class_array = classString.split(.);
 for (var i = 0; i  class_array.length; i++)
 {
 classRef = classRef[class_array[i]];
 };
 
 Then u can use classRef to do whatever u want.
 
 Greetz Erik
 
 
 -Original Message-
 From: Manish Jethani [mailto:[EMAIL PROTECTED] 
 Sent: woensdag 9 maart 2005 13:05
 To: flexcoders@yahoogroups.com
 Subject: Re: [flexcoders] call popup with string
 
 
 On Wed, 9 Mar 2005 08:29:44 -0300, Fernando Lobos
 [EMAIL PROTECTED] wrote:
 
  yes, i know but , who can instantiate a class via string from
 variable?
 
 Actually that's what UIObject does internally. It does attachMovie() on
 the class's symbolName. So, yes, it's possible to create an object from
 a string identifying the class. Using the class reference seems to be
 the preferred way in Flex.
 
 If all you have is strings, you can create a mapping from the strings to
 their corresponding class references and look up the mapping every time
 you need a reference. Maybe there's a better Flash Way (TM) that I'm
 not aware of (some sibling of Object.registerClass() ).
 
 Manish
 
 
 
 Yahoo! Groups Links
 
 
 
 
 
 
 
 
 Yahoo! Groups Sponsor
 ADVERTISEMENT
 
 
 Yahoo! Groups Links
 
 To visit your group on the web, go to:
 http://groups.yahoo.com/group/flexcoders/
 
 To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
 
 Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.