[flexcoders] Re: How to get class definition from a loaded module?

2009-10-19 Thread tnajaryan


Thanks for explanation.

Yes, I know the name of the class. Do you mean to call create() on 
IFlexModuleFactory? 

Thanks.


--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> Modules and popups are exceptions to the .root documentation because they are 
> not parented by the main class in the SWF.  In the case of modules, you 
> typically instantiate an object and parent it somewhere in your main app's 
> containers, even ModuleLoader.
> 
> If you know the name of the class, use factory.create(className) to get the 
> instance.
> 
> Alex Harui
> Flex SDK Developer
> Adobe Systems Inc.
> Blog: http://blogs.adobe.com/aharui
> 



[flexcoders] Re: How to get class definition from a loaded module?

2009-10-19 Thread tnajaryan


OK, this almost works as I want. I can call 
ModuleManager.getAssociatedFactory(obj) to get IFlexModuleFactory and then call 
create(className) to create an instance. 

However it would be even better if I could get a class definition to avoid 
refactoring my program where the flow is like this:

var cls: Class = get-class-by-name(className);
// pass cls to some other function...
var obj: Object = new cls();

While debugging I noticed that IFlexModuleFactory is actually an instance of 
FlexModuleFactory which is not in Flex documentation. This FlexModuleFactory 
has a nice public function getDefinitionByName() which returns exactly what I 
need.

Any reason why is FlexModuleFactory undocumented?

I tried the following sequence and it works perfectly:

var factory: IFlexModuleFactory = ModuleManager.getAssociatedFactory(obj);
var classRef:Class = 
Class(FlexModuleFactory(factory).getDefinitionByName(className));

Is the omission of FlexModuleFactory from documentation intentional?

Thanks a lot!



[flexcoders] Re: How to get class definition from a loaded module?

2009-10-19 Thread tnajaryan


test reply. ignore this.



[flexcoders] Re: How to get class definition from a loaded module?

2009-10-19 Thread tnajaryan


Source is here: http://www.riatest.com/downloads/ModuleProblem.zip

If you uncomment line 13 in ModuleLoaderApp.mxml it will load the module in the 
application domain and everything works fine. However if you comment out this 
line and the module is loaded by default without overriding the domain then 
there is no way to get class definition.

Thanks a lot for looking.


--- In flexcoders@yahoogroups.com, "valdhor"  wrote:
>
> I'm willing to take a look. Can you post the code?
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "tnajaryan"  wrote:
> >
> > I am trying to get class definition from a loaded module using 
> > ApplicationDomain.getDefinition(). I need it to be able to instantiate an 
> > object of that class using operator new.
> > 
> > When the module is loaded in the currentDomain of loader application 
> > everything is fine. I can get the definition using 
> > ApplicationDomain.currentDomain.getDefinition(className) call.
> > 
> > However when the module is loaded by default (not in the loader application 
> > domain) I cannot seem to be able to get the definition no matter what I 
> > try. 
> > 
> > The ApplicationDomain.currentDomain.getDefinition(className) throws and 
> > exception. I tried getting the correct domain using 
> > child.root.loaderInfo.applicationDomain, where child is an object from the 
> > loaded module. This still does not work since it returns the same domain. 
> > 
> > What is even strange is that child.root refers to the top-most application 
> > which seems to contradict to what is written in Flex docs for "root" 
> > property: 
> > "For a display object in a loaded SWF file, the root property is the 
> > top-most display object in the portion of the display list's tree structure 
> > represented by that SWF file." (See 
> > http://livedocs.adobe.com/flex/3/langref/flash/display/DisplayObject.html#root)
> > 
> > Doesn't this mean that "root" should refer to the Module in this case? If 
> > "root" refers to top-most application how do I get the correct domain given 
> > a DisplayObject from the module? 
> > 
> > Anyway, I am unable to find ANY way to get the class definition from the 
> > module using the class name. Any ideas?
> > 
> > Full source code of a trivial sample application that demonstrates the 
> > problem is available if anyone wants to have a look.
> > 
> > Thanks.
> >
>




[flexcoders] How to get class definition from a loaded module?

2009-10-19 Thread tnajaryan
I am trying to get class definition from a loaded module using 
ApplicationDomain.getDefinition(). I need it to be able to instantiate an 
object of that class using operator new.

When the module is loaded in the currentDomain of loader application everything 
is fine. I can get the definition using 
ApplicationDomain.currentDomain.getDefinition(className) call.

However when the module is loaded by default (not in the loader application 
domain) I cannot seem to be able to get the definition no matter what I try. 

The ApplicationDomain.currentDomain.getDefinition(className) throws and 
exception. I tried getting the correct domain using 
child.root.loaderInfo.applicationDomain, where child is an object from the 
loaded module. This still does not work since it returns the same domain. 

What is even strange is that child.root refers to the top-most application 
which seems to contradict to what is written in Flex docs for "root" property: 
"For a display object in a loaded SWF file, the root property is the top-most 
display object in the portion of the display list's tree structure represented 
by that SWF file." (See 
http://livedocs.adobe.com/flex/3/langref/flash/display/DisplayObject.html#root)

Doesn't this mean that "root" should refer to the Module in this case? If 
"root" refers to top-most application how do I get the correct domain given a 
DisplayObject from the module? 

Anyway, I am unable to find ANY way to get the class definition from the module 
using the class name. Any ideas?

Full source code of a trivial sample application that demonstrates the problem 
is available if anyone wants to have a look.

Thanks.




[flexcoders] How to create automation libraries in Flex SDK 3.3?

2009-04-04 Thread tnajaryan
I downloaded SDK 3.3 and extracted datavisualization_sdk3.3.zip into it, then 
run command java -jar DMV-source.jar  "C:\Users\All Users\Adobe\Flex"

The fbpro folder is created but automation libraries are not. 

The output of DMV-source.jar execution reads:

[START OUTPUT]
C:\Program Files\Adobe\Flex Builder 3\sdks\3.3.0\lib>java -jar DMV-source.jar  
"C:\Users\All Users\Adobe\Flex"
using license {flexbuilder3=137740006554349567707756, 
flexbuilder3.displayedFirstLaunchMessage=true}, outputing to directory ..
license is valid, extracting datavisualisation and automation files to ..
[END OUTPUT]


I cannot find automation.swc, automation_agent.swc and automation_dmv.swc 
anywhere in sdks\3.3.0 (I suppose they should be frameworks\lib as in earlier 
SDKs, right?)

Do I have to do anything special to create automation swc's?



[flexcoders] Re: How do YOU do functional testing and automation package questions

2007-12-12 Thread tnajaryan
AFAIK, there are two tools that you can currently use for Flex GUI
testing: Mercury QTP and TestComplete (which is not using
mx.automation and thus is of limited use).

You might also want to have a look at the upcoming GUI testing tool
specifically designed for Flex at http://riatest.com

Disclosure: I am a RIATest developer.


--- In flexcoders@yahoogroups.com, "Neil Curzon" <[EMAIL PROTECTED]> wrote:
>
> Hi all.
> 
> I've been trying to add some automated functional testing to our
flex app.
> 
> I found FunFX, a functional test framework for flex built in ruby.  This
> page (http://peternic.blogspot.com/2007/11/funfx-getting-started.html)
> directed me to install the automation package, which claims that you
can use
> it with LCDS or Express LCDS.  However, it demands a license key to
install,
> and the Express version of LCDS seems to just install by not entering a
> key.  (ie if you have only Express LCDS, it seems you can't actually
install
> the automation package).  Any suggestions?  We are in the process of
> upgrading to Flex 3, but in the short term this isn't an option.
> 
> I'm curious as to what other people are using for functional testing
their
> Flex apps.  Some searching reveals that Selenium can be extended fairly
> easily for Flex testing, and google indicates that several people have
> in-house Selenium extensions, but none of these appear to have been
> contributed back yet.  I'm partway through a proof of concept for
selenium
> testing (I have JavaScript finding buttons in my Flex app), but this
FunFX
> seems to have a lot of work done that I'd have to repeat.
> 
> Any pointers would be appreciated!
> 
> Thanks
> 
> Neil
>



[flexcoders] Ignore this, just testing

2007-12-12 Thread tnajaryan
hi, board.