[flexcoders] Re: ModuleManger - READY event does not always fire

2008-03-03 Thread Kevin Broce
Thanks Alex.

I think what I was doing wrong was that my "Modules only" Flex project 
had the "Framework linkage" set to RSL.  This seemed to cause some of 
the Modules to unload (according to the debug trace output) when 
several Modules were loaded simultaneously.

My Modules are loaded by a Flex app that loads the framework via RSLs, 
so the Modules are guaranteed to have all the framework classes 
available.  The Modules don't need to load any RSLs themselves.

On my Modules project, I changed the Framework linkage back to "Merged 
into code", however I manually modified the Link Type of the 
framework.swc to be "External".  If I use charting, I would have to 
make the same change to the datavisualization.swc.

This is confusing because the Framework linkage says "Merged" even 
though this is not true.  It seems that a 3rd option should be added to 
Framework linkage called "External".

I probably create a lot more Module projects than full-blown 
Application projects.  On a Modules project, if I could set the 
Framework linkage to "External" and have it change all the Link Types 
like it does for RSLs, that would be a nice convenience and eliminate 
confusion.








[flexcoders] Re: Module unloads but FlexModuleFactory instance does not unload

2008-03-03 Thread Kevin Broce
After researching Application Domains, I understand now that this is 
not a bug.

The following post by Roger Gonzalez really helped to explain what I 
was doing wrong: 

http://blogs.adobe.com/rgonzalez/2006/06/applicationdomain.html

Using the following code is NOT recommended:

Info.load( ApplicationDomain.currentDomain );

This places the Module's "factory" class definition in the SAME app 
domain as Flex.  You cannot remove it once its loaded unless you shut 
down your main Flex application.

The reason I was confused is because I misunderstood the difference 
between the above code and this code:

Info.load( new ApplicationDomain( 
ApplicationDomain.currentDomain ) );

which is eqivalent to (see mx.modules.ModuleManager line 459):

Info.load();

By creating a "new" app domain, the "factory" class definition is now 
separated from the main Flex app domain.  This new domain is 
a "child" underneath the Flex app domain. When the Module 
(TestModule) is unloaded, I believe it causes the "child" app domain 
to go out of scope allowing it to also be GC'd.

Gaurav: Thanks for testing this and helping me.  I really appreciate 
it.





[flexcoders] Re: Module unloads but FlexModuleFactory instance does not unload

2008-03-02 Thread Kevin Broce
Listed below is a simple Module loading example that demonstrates the 
problem (source code at bottom).

Create a new Flex project and set FlexApp.mxml as the "Main 
application file" and add TestModule.mxml as a Module.

To verify that the _TestModule_mx_core_FlexModuleFactory "factory" 
instance is NOT getting unloaded, perform these steps:

1) Launch profiler and wait for FlexApp to load

2) Before clicking "Load Module", take a Memory Snapshot.

3) Click "Load Module" and wait for TestModule to load (its a green 
square).

4) Click "Unload Module" and TestModule unloads.

5) Take a 2nd Memory Snapshot.

6) Select both Memory Snapshots and click "Find Loitering Objects".


You should see _TestModule_mx_core_FlexModuleFactory in the Loitering 
Objects list.  You can double-click 
_TestModule_mx_core_FlexModuleFactory to obtain further details.

I want to confirm that someone else can reproduce this issue before I 
submit a bug to Adobe.  I also want to confirm that this behavior is 
not by design.

Does anyone have any suggestions as to why this happens and possible 
work arounds?

Note: I am using Flex Builder 3.0 (release).

Thanks!





FlexApp.mxml



http://www.adobe.com/2006/mxml"; 
layout="vertical"> 











TestModule.mxml



http://www.adobe.com/2006/mxml"; 
layout="absolute" width="200" height="200" backgroundColor="#BBF2A2">






[flexcoders] Module unloads but FlexModuleFactory instance does not unload

2008-03-01 Thread Kevin Broce
I have a simple Module (TestModule) that I can load and unload using 
ModuleManager in a Flex Application (FlexApp). 

Profiler shows the following two new Live Objects when TestModule 
loads:

TestModule

_TestModule_mx_core_FlexModuleFactory

Each object has a total of 1 instance.

When I unload TestModule and force a GC, the TestModule instance and 
memory drop to 0 which is good. However, 
_TestModule_mx_core_FlexModuleFactory continues to have 1 instance 
and is using memory.

When I grab "before and after" Memory Snapshots in Profiler, the 
Factory instance appears in the Loitering Objects list.  The Object 
References for the Factory show 2 instances:

--
Instance  Property
--

_TestModule_mx_core_FlexModuleFactory (2)

Function (2)[savedThis]

_TestModule_mx_core_FlexMod...  moduleCompleteHandler

flash.display:LoaderInfo[listner0]

Function (1)[savedThis]

_TestModule_mx_core_FlexMod...  docFrameHandler


Instance #2 is coming from the Module loading process and appears to 
be unloading properly.

Instance #1 appears to be coming from mx.core:FlexModuleFactory.  
However, this code is part of the "generated" ActionScript that I 
cannot debug.

I tried loading TestModule into the "current" App Domain and I also 
tried loading it into a separate "child" App Domain, however the 
results were the same.

I'm using Flex Builder 3.0 (release). FlexApp is loading the 
framework.swc as an RSL.

TestModule.mxml
---


http://www.adobe.com/2006/mxml"; 
layout="absolute" width="200" height="100">




Questions:

How do I unload this Factory instance?


Why are there 2 instances under Loitering Objects when the Cumulative 
Instance count is only 1?


Thanks for your help.  I am really stuck on this.






[flexcoders] RSL with crossdomain.xml (Flex 2.0)

2006-09-29 Thread Kevin Broce
I wanted to know if it is possible to load a Flex application from one 
domain and have it load an RSL from a different domain assuming a 
properly configured crossdomain.xml file.

I thought this was supported in Flex 1.5, however the Flex 2.0 docs say:

"RSLs are not shared across domains. If a client runs an application in 
domain1 and uses an RSL, and then launches an application in domain2 
that uses the same RSL, the client downloads the RSL twice."

I wanted to ask before spending a lot of time trying to get this to 
work.

Thanks.







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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Re: Loading classes

2005-08-26 Thread Kevin Broce
The Flex server is not compiling your Class file because FlexBuilder 
is not copying it to the Flex server.  Only "squares.mxml" is 
getting compliled and since there is no "DrawIcons" Class present, 
it "could not be loaded".

Add the following code to the top of your Script block 
in "squares.mxml":

import DrawIcons.as;

This triggers FlexBuilder to copy your Class file to the Flex server 
whenever it changes.

Once the Flex server has a copy of DrawIcons.as, it will compile it 
and show you your errors.  For example, Flex is "case-sensitive", 
and your variable names are not, so Flex will complain about that.


--- In flexcoders@yahoogroups.com, Prasad Dhananjaya <[EMAIL PROTECTED]> 
wrote:
> Hi All,
> 
> I want to draw two squares inside the canves.
> I define "DrawIcons"class. My class file and MXML file is in the 
same
> directory. When I run this, it says "The class "DrawIcons()"could 
not 
> be loaded" (line of error is "var Square1:DrawIcons = new DrawIcons
(100, 200);")
> Can someone please tell me what's the wrong with this code?
> 
> Thanks,
> Prasad
> (Absolute beginner of 
> Flex & ActionScript,
> Studying using of classes)
> 
> --square.mxml---
> http://www.macromedia.com/2003/mxml";>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---
> 
> 
> -DrawIcons.as--
> //Class definition
>   class DrawIcons {
>   var xValue:Number;
>   var yValue:Number;
> 
> //Contractor
>   function DrawIcons(cordiX:Number,cordiY:Number){
>   this.Xvalue=cordiX;
>   this.Yvalue=cordiY;
>   }
> //Drawing square
>   function createSquare() {
> var square_mc:MovieClip;
> square_mc = MyCanves.createEmptyMovieClip
("square_mc",getNextHighestDepth());
> square_mc.lineStyle(1, 0x00, 100);
> square_mc.beginFill(0xFF, 100);
> square_mc.moveTo(0, 0);
> square_mc.lineTo(50, 0);
> square_mc.lineTo(50, 50);
> square_mc.lineTo(0, 50);
> square_mc.lineTo(0, 0);
> square_mc.endFill();
> 
> square_mc._x = this.Xvalue;
> square_mc._y = this.Yvalue; 
>}
> }
> 





 Yahoo! Groups Sponsor ~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
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:
http://docs.yahoo.com/info/terms/
 





[flexcoders] Re: Flex App with RSL fails in Standalone Flash Player

2005-08-24 Thread Kevin Broce
Matt:  Thanks so much for the information.

I was able to get the app to run in the standalone version 
using "File-Open" and referencing localhost.  I couldn't get it to 
work using a crossdomain file.

However, your post got me to think hard about what I was actually 
doing.  Obviously there is a big difference between the "local file 
system" and "localhost".  My example was trying to mix the two which 
is not a good idea even if it does work.  (If I'm already running 
the main App from the local file system, then why hassle with 
loading an RSL from localhost?)  The solution is to either run both 
from the local file system or run both from localhost.

I had been struggling to understand the "url" attribute in the SWS 
definition which is why my app was a bit convoluted initially.

My solution turned out to be the following simple change to 
myRSL.sws:

 

Thanks again for your help.  I can't tell you how many times I've 
searched FlexCoders and found answers to my problems from your posts 
and the posts of the other experts.  



--- In flexcoders@yahoogroups.com, "Matt Chotin" <[EMAIL PROTECTED]> 
wrote:
> You might need a crossdomain.xml file available since the 
standalone is
> not considered to be running from the same location as localhost 
in all
> likelihood.
> 
>  
> 
> What happens if you open up the standalone player, then use File -
> Open
> and hit http://localhost/pathtofile?  If it works I'm pretty sure 
the
> crossdomain.xml is gonna be it.
> 
>  
> 
> Matt
> 
>  
> 





 Yahoo! Groups Sponsor ~--> 
http://us.ard.yahoo.com/SIG=12h0pb4ll/M=362329.6886308.7839368.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124895577/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!.
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
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:
http://docs.yahoo.com/info/terms/
 




[flexcoders] Flex App with RSL fails in Standalone Flash Player

2005-08-22 Thread Kevin Broce
I cannot get a simple Flex application to run in the standalone 
Flash Player when an RSL is used.  

This App (with RSL) runs SUCCESSFULLY when I load it in a browser 
from my "localhost" web server.  Its only FAILING in the SA Flash 
Player.  If I compile the App without the RSL, it runs correctly in 
the SA Flash Player.

I am compiling the App and RSL using the Flex command-line 
compilers.  I am not using the runtime Flex server.

Here's what happens when I run the App in the SA Flash Player:

1) The Library preloader displays "Library 1 of 1".  
2) The Application preloader displays "Initializing".  Progress bar 
goes to 100% but preloader does not disappear.
3) A very small black square with a green border appears in the 
upper left corner of the Flash Player.  
4) If I click the small black square, the border color changes to 
pink.  The cursor changes to a hand symbol.

---
myApp.mxml
---


http://www.macromedia.com/2003/mxml"; 
width="100%" height="100%"
rsl="myRSL.sws">







---
myRSL.sws
---

http://localhost/myApp/myRSL.swf";>
  http://www.macromedia.com/2003/mxml"; />
  


All the files are located in the same folder.  

Again:  This App runs successfully in the browser!

Any comments or advice will be most appreciated.  

Roger G.:  PLEASE HELP!

Thanks







 Yahoo! Groups Sponsor ~--> 
http://us.ard.yahoo.com/SIG=12hu6u6u3/M=362131.6882499.7825260.1510227/D=groups/S=1705007207:TM/Y=YAHOO/EXP=1124754139/A=2889191/R=0/SIG=10r90krvo/*http://www.thebeehive.org
">Get Bzzzy! (real tools to help you find a job) Welcome to the Sweet Life 
- brought to you by One Economy.
~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
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:
http://docs.yahoo.com/info/terms/