RE: [flexcoders] Memory Leak in DataServices based App ??

2009-06-26 Thread Alex Harui
What does the memory profiler say?  There's a "tutorial" on how to use it on my 
blog.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dharmendra Chauhan
Sent: Friday, June 26, 2009 10:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Memory Leak in DataServices based App ??





Hi All,

 I have  very basic application which uses  DataSerives over RTMP channel  
to populate dataGrid , I have not used any  user defined component.

This application has got LOAD data and Remove data  Button just to simulate the 
actual application

What happens , when I click on LOAD data , It  loads the data from 
server(JBOSS) then I Remove all the data and force the GC to run

If I continuously keep loading and removing the  data ,  memory goes up every 
time and after some times It reaches to threshold and  finally crashes the 
Browser.

In actual application as soon as user logs in a dedicated DS destination is 
created..

 private function createDestination(destName:String):void{
var remoteServi! ce:RemoteObject = new 
RemoteObject("DestinationManager");
remoteService.addEventListener(ResultEvent.RESULT, 
resultHandler,false,0,true);
var operation:AbstractOperation = 
remoteService.getOperation("createDestination");
operation.send(destName);
var cs:ChannelSet = new ChannelSet();
var rtmpChannel:RTMPChannel = ServerConfig.getChannel("my-rtmp") as 
 RTMPChannel;
cs.addChannel(rtmpChannel);
  ! ;  tradeService = new DataService() ;
  ! ; & nbsp;tradeService.destination=destName;
tradeService.channelSet = cs;
}


Now when user hits on Load data button to load the trade data ...

   public function loadData():void
{
var remoteService:RemoteObject  = new RemoteObject("filterRemoteVO");
var operation:AbstractOperation = 
remoteService.getOperation("loadData");
tradeService.fill(tradeCollection);
operation.send(rowData.t! ext ,GUIID);
tradeList.dataProvider = tradeCollection;

}


Remove Data  hit I clean all the resource and released collection :-

 public  function  removeAll():void{
if(tradeList.dataProvider){
 tradeCollection.source = new Array();
 tradeList.dataProvider.source = new Array();
 tradeList.dataProvider = null;
}
   tradeService.release();
   &nb! sp;  ; tradeService.releaseCollection(tradeCollection);
 tradeService.channelSet.disconnectAll();
 tradeService.disconnect();
  tradeService.logout();
  System.gc();
}

Except these 3 function I don't have any code which could cause memory leak.

I m using

 *   LCDS 2.5
 *   Flex 3.0
 *   JBoss4.2

Please see the mxml file below   , If  possible please have a look at it , I 
might  not be using dataSerice API correctly.

I have been trying to solve this leak for last two week , I really need help 
from you guys.
My client has already evaluating other contemporary technology because of this 
memory issue.

I have al! so created scalled down war file which can be deployed on any  java 
application server.Just provide your emial Id , Iwill send that to you.

Any help will greatly be appreciated

Regards,

Dam
 MXML##



http://www.adobe.com/2006/mxml"; layout="absolute"
 creationComplete="init();" height="100%" width="100%"
>





 

   



  &n! bsp;&nbs p;






&! nbsp;   







 


   

  &nbs! p;  ;




 !




 &! nbsp;  ! ;
&nb sp;   



&! lt;/mx:GridItem>




  &nbs! p; 















[flexcoders] Memory Leak in DataServices based App ??

2009-06-26 Thread Dharmendra Chauhan
Hi All,

  I have  very basic application which uses  DataSerives over RTMP
channel  to populate dataGrid , I have not used any  user defined
component.

This application has got LOAD data and Remove data  Button just to
simulate the actual application

What happens , when I click on LOAD data , It  loads the data from
server(JBOSS) then I Remove all the data and force the GC to run

If I continuously keep loading and removing the  data ,  memory goes up
every time and after some times It reaches to threshold and  finally
crashes the Browser.

In actual application as soon as user logs in a dedicated DS destination
is created..

  private function createDestination(destName:String):void{
 var remoteService:RemoteObject = new
RemoteObject("DestinationManager");
 remoteService.addEventListener(ResultEvent.RESULT,
resultHandler,false,0,true);
 var operation:AbstractOperation =
remoteService.getOperation("createDestination");
 operation.send(destName);
 var cs:ChannelSet = new ChannelSet();
 var rtmpChannel:RTMPChannel =
ServerConfig.getChannel("my-rtmp") as  RTMPChannel;
 cs.addChannel(rtmpChannel);
 tradeService = new DataService() ;
 tradeService.destination=destName;
 tradeService.channelSet = cs;
 }


Now when user hits on Load data button to load the trade data ...

public function loadData():void
 {
 var remoteService:RemoteObject  = new
RemoteObject("filterRemoteVO");
 var operation:AbstractOperation =
remoteService.getOperation("loadData");
 tradeService.fill(tradeCollection);
 operation.send(rowData.text ,GUIID);
 tradeList.dataProvider = tradeCollection;

 }


Remove Data  hit I clean all the resource and released collection :-

  public  function  removeAll():void{
 if(tradeList.dataProvider){
  tradeCollection.source = new Array();
  tradeList.dataProvider.source = new Array();
  tradeList.dataProvider = null;
 }
tradeService.release();
   tradeService.releaseCollection(tradeCollection);
  tradeService.channelSet.disconnectAll();
  tradeService.disconnect();
   tradeService.logout();
   System.gc();
 }

Except these 3 function I don't have any code which could cause memory
leak.

I m using

* LCDS 2.5

* Flex 3.0
* JBoss4.2

Please see the mxml file below   , If  possible please have a look at it
, I might  not be using dataSerice API correctly.

I have been trying to solve this leak for last two week , I really need
help from you guys.
My client has already evaluating other contemporary technology because
of this memory issue.

I have also created scalled down war file which can be deployed on any 
java application server.Just provide your emial Id , Iwill send that to
you.

Any help will greatly be appreciated

Regards,

Dam
 MXML##



http://www.adobe.com/2006/mxml";
layout="absolute"
  creationComplete="init();" height="100%" width="100%"
 >
 
 



  


 
 
 
 
 
 
 
 
 
 
 
 
 
 



 
  
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 



 










[flexcoders] Re: Flex Browse File

2009-06-26 Thread reversible_82
No, it seem like this class do not exist in flex, should be a way to do
this on flex, does anyone have an Idea?

--- In flexcoders@yahoogroups.com, "Tim Hoff"  wrote:
>
>
> Not sure if this available for flex, but for air:
>
> var file:File = new File();
> file.addEventListener(Event.SELECT, dirSelected);
> file.browseForDirectory("Select a directory");
> function dirSelected(e:Event):void {
> trace(file.nativePath);
> }
>
> -TH
>
> --- In flexcoders@yahoogroups.com, "reversible_82" reversible_82@
> wrote:
> >
> > Hi guys,
> >
> > I'm trying to browse and select a folder from the local file
system,i
> was reading about the FileReferenceList class to browse a file, but
that
> does not let me select a folder, just a file, do you know how can I
get
> Around this, or some source to read. I need to select a folder from
the
> local system not a file.
> >
> > Thanks
> >
>




[flexcoders] Save the display the destination folder to save a file

2009-06-26 Thread reversible_82
I guys, I need to select a destination folder to save a file that's
ok with the FileReference Class but I need to represent the path in a
read only text input component, here is the path example of the text
that I want to display
"C:\Pictures\etc"

is there any way to accomplish this action??.

Thanks



[flexcoders] Applly Transition in Flex4

2009-06-26 Thread j2me_soul
I got a section of code in Flex3.
How can I achieve the same function in Flex4?



























































RE: [flexcoders] external itemrenderer: how to refer to main app variables and functions

2009-06-26 Thread Alex Harui
parentDocument might work.  Some use events.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of kshah0...@ymail.com
Sent: Friday, June 26, 2009 8:14 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] external itemrenderer: how to refer to main app variables 
and functions





I have an external Itemrenderer used for a datagrid. The function in the 
itemrenderer performs a function when button is clicked. However I need to 
access the main app's functions.

Do I use events or "super."?



[flexcoders] Watching a class full of bindable properties

2009-06-26 Thread steve horvath

I have a class marked Bindable with many properties.  The class has a
read-only function which returns come custom XML based on the
properties.  I want to fire a bindable event when any of the properties
change.

So far the ways that I've thought of doing it are:
1) Create a ChangeWatcher that monitors each individual property.  (The
host would be "this" and the chain would be an array with every single
property listed in it.)
2) Write a setter and a getter for every single property, with the
setter dispatching a custom bindable event.

The problem with the first method is I'd have to list out every
property.  Every time a property was added to this class I'd have to
make sure I updated the chain array.  The problem with the second method
is I'd have to write setters and getters for every single property. 
(The actual class has more than 20 properties.)  It would make the class
harder to read.

Is there a way I could watch the properties for change with just a
couple lines of code?


 [Bindable]
 public class TheProperties
 {
 public var presetName:String="default";
 public var presetThumb:String="";
 public var presentationTitle:String="";
 public var presentationThumb:String="";
 public var presentationLogoURL:String="";
 // many more properties...

 [Bindable(event="propertyChangeEvent")] // necessary to get rid
of binding warnings
 public function get xmlCode():XML {
 // some funky stuff to create XML based on above properties
 }
 }






[flexcoders] Setting up automated testing in Flex SDK 3.3.0

2009-06-26 Thread tgersic
Hi All,

This is just a brief blog post I wrote on setting up automated testing in Flex, 
with SDK 3.3.0, which is missing the .swc files necessary. Hopefully it will be 
helpful to somebody somewhere:

http://www.modelmetrics.com/tomgersic/setting-up-automated-testing-in-flex-sdk-330/

Tom



Re: [flexcoders] Flex View Stack / Component Life Cycle Best practice

2009-06-26 Thread claudiu ursica
And you probably want to try to catch that change event on it's propagation 
phase instead of bubbling phase.

C





From: Jeffry Houser 
To: flexcoders@yahoogroups.com
Sent: Friday, June 26, 2009 12:08:56 AM
Subject: Re: [flexcoders] Flex View Stack / Component Life Cycle Best practice






You probably want to run code when the viewStack changes.  Look at the 
ViewStack, I bet there is a change event. 

martinosaint wrote:
> Hi there,
>
> I have built a multiplage application in Flex with different user roles. I 
> use a View Stack with a Menu Bar to navigate between the different pages.
>
> However - each time a page gets opened, I need to do some database calls, 
> apply User Role settings, etc. in an init() function. This init function may 
> reference some UI elements of this page.
>
> I tried to load it with the "creationComplete" event, but this one gets only 
> triggered once (since the page is not rebuilt each them the view stack shows 
> it).
>
> Now I have put it on the "show" event, but this seems not to get triggered 
> consistently, or before the page is fully created the first time.
>
> Whats the best practice for this case?
>  * I have to pass in data
>  * Call init functions (database calls)
>  * Manipulate components
>
> Ideally I would need a way to call init each time the page is loaded and 
> after all components are created.
>
> Thanks for your help,
> Martin
>
>
>
>  - - --
>
> --
> Flexcoders Mailing List
> FAQ: http://groups. yahoo.com/ group/flexcoders /files/flexcoder sFAQ.txt
> Alternative FAQ location: https://share. acrobat.com/ adc/document. do?docid= 
> 942dbdc8- e469-446f- b4cf-1e62079f684 7
> Search Archives: http://www.mail- archive.com/ flexcoders% 40yahoogroups. 
> comYahoo! Groups Links
>
>
>
>
> 

-- 
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl. com/684b5h
http://www.twitter. com/reboog711 | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust


   


  

[flexcoders] external itemrenderer: how to refer to main app variables and functions

2009-06-26 Thread kshah0...@ymail.com
I have an external Itemrenderer used for a datagrid.  The function in the 
itemrenderer performs a function when button is clicked.   However I need to 
access the main app's functions.

Do I use events or "super."?



[flexcoders] Re: [Shared Object] Save XML

2009-06-26 Thread thelordsince1984
I would only know if is possible...

thanks again


--- In flexcoders@yahoogroups.com, "Tracy Spratt"  wrote:
>
> What happens when you try?
> 
>  
> 
> You can always save it as a string then re-parse it when you retrieve it.
> 
>  
> 
> Tracy Spratt,
> 
> Lariat Services, development services available
> 
>   _  
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
> Behalf Of thelordsince1984
> Sent: Tuesday, June 23, 2009 11:30 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] [Shared Object] Save XML
> 
>  
> 
> 
> 
> 
> 
> 
> Hi,
> 
> i would know if is possible to save xml format into SharedObjects..
> 
> thanks
> 
> Regard
> Lord
>




[flexcoders] Re: text input that only accepts numbers

2009-06-26 Thread Tim Hoff

Look at the "restrict" property, lest we revert to the stone-ages.

-TH

--- In flexcoders@yahoogroups.com, "kshah0...@..." 
wrote:
>
> What type of Flex validator component can I use so a Text Input
component can only accept numbers?
>
> I've tried the NumberValidator but it does not have character limit.
>





Re: [flexcoders] itemrenderer in datagrid does not refresh

2009-06-26 Thread Jeffry Houser

 Implement the onDataChange event in your itemRenderer . 

kshah0...@ymail.com wrote:
> I have a external Itemrenderer that I am using in a Datagrid.  Everytime I 
> search the datagrid by filterfunction, the itemrenderer does not refresh or 
> displays out of order. 
>
> Any ideas on how I can prevent this from happening?
>
>
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>   

-- 
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711  | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust




[flexcoders] text input that only accepts numbers

2009-06-26 Thread kshah0...@ymail.com
What type of Flex validator component can I use so a Text Input component can 
only accept numbers?

I've tried the NumberValidator but it does not have character limit.



[flexcoders] itemrenderer in datagrid does not refresh

2009-06-26 Thread kshah0...@ymail.com
I have a external Itemrenderer that I am using in a Datagrid.  Everytime I 
search the datagrid by filterfunction, the itemrenderer does not refresh or 
displays out of order. 

Any ideas on how I can prevent this from happening?





[flexcoders] Selecting top level item in PopUpMenuButton

2009-06-26 Thread Antoine
Hi,
I'm using a popupMenuButton to display hierarchical data in Flex 3. I want to 
enable the selection of a top-menu item, even if it has a submenu attached to 
it.
even if this is a regular question on the web, i can't manage to find a good 
answer.

Is there any custom component, or a simple solution i can use to solve this? Or 
is there any workaround?

Thanks a lot,

Antoine




[flexcoders] Cpool Error

2009-06-26 Thread ag_rcuren
I have a Flex application built on Flex 3.2 recently I have found that on 
certain versions of flash player 9 users receive the following error:

VerifyError: Error #1033: Cpool entry 141 is wrong type.

at flash.display::MovieClip/nextFrame()
at mx.managers::SystemManager/deferredNextFrame()
at mx.managers::SystemManager/preloader_initProgressHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.preloaders::Preloader/timerHandler()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()

I have searched high and low for what exactly this means and what I usually 
find is people telling me to upgrade my users to flash player 10. This does fix 
the error but I would really like to know what causes such and error any 
insight would be great.



[flexcoders] Re: PDF - Text Display

2009-06-26 Thread edmoreyra
vea alivepdf

--- In flexcoders@yahoogroups.com, "lrlarsonny"  wrote:
>
> Hello --
> 
> Am I correct is gleaning from my google searches that there is no way to 
> display a pdf in Flex? (Not Air). And that flashpaper is no more?
> 
> Given that, how do developers show formatted text? 
> 
> We are building an app that will show documents within the published flex 
> swf, and I just assumed that there was a way to do this.
> Thanks
> 
> lrlarson
> nyc
>




[flexcoders] Re: Mate CacheSetter

2009-06-26 Thread Anthony DeBonis
We use static constants for all these properties so we don't end up with simple 
type Os

Example:
static public const PROP_APPLICATION_IS_READY:String = "applicationIsReady";
private var _applicationIsReady:Boolean;
+ setter/getter

And in the map




Odd to see it trapping the type check on foo... but hope this helps.

Anthony


--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> Any Mate users here? The forums are down again.
> 
> I'm trying to use the newish CacheSetter tag, as follows:
> 
> 
> 
> Elsewhere:
> 
> 
> 
> This gives the error: "1069 Property foo not found on String"
> 
> If I use the class name instead it complains because the class in
> question has constructor arguments.
> 
> What's the correct approach here? Thanks.
>




[flexcoders] IE8/Vista exit fullscreen -> inputtext locked

2009-06-26 Thread Ward Loockx
Hello,

I have an issue with IE8 and Vista. When you toggle fullscreen and exit 
fullscreen you're unable to use a textinput. Anybody noticed this bug 
before? Any workaround? I attached a small test application to 
illustrate the problem.

Greets,
Ward Loockx




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











Re: valdhor [flexcoders] Re: domain problem in remoteobject application

2009-06-26 Thread Vikram Singh
Yes. You are right. But main problem was that my amfphp code is older.
I have downloaded new code and got globals.php at amfphp/ directory.

Thanks valdhor.





From: valdhor 
To: flexcoders@yahoogroups.com
Sent: Thursday, 25 June, 2009 6:34:04 PM
Subject: Re:valdhor  [flexcoders] Re: domain problem in remoteobject application





Wrong file (You are looking at amfphp/core/ shared/app/ Globals.php) . The file 
should be in the root directory (amfphp/globals. php) along with the 
gateway.php file amongst others.

HTH

Steve

BTW. I would recommend changing to WebORB for a more robust, well tested and 
reliable remoting experience (www.themidnightcod ers.com)

--- In flexcod...@yahoogro ups.com, Vikram Singh  wrote:
>
> hello valdhor
> 
> in my amfphp directory there is only one globals.php file and it contains 
> these 
> 
>  /**
>  * Defines globals used throughout amfphp package for config options
>  * 
>  * @license http://opensource. org/licenses/ gpl-license. php GNU Public 
> License
>  * @copyright (c) 2003 amfphp.org
>  * @package flashservices
>  * @subpackage app
>  */
> 
> global $amfphp;
> 
> $amfphp = array();
> $amfphp['errorLevel '] = E_ALL ^ E_NOTICE;
> $amfphp['instanceNa me'] = NULL;
> $amfphp['classPath' ] = 'services/';
> $amfphp['customMapp ingsPath' ] = 'services/';
> $amfphp['adapterMap pings'] = array();
> $amfphp['incomingCl assMappings' ] = array();
> $amfphp['outgoingCl assMappings' ] = array();
> $amfphp['webService Method'] = 'php5';
> $amfphp['disableDes cribeService' ] = false;
> $amfphp['disableTra ce'] = false;
> $amfphp['disableDeb ug'] = false;
> $amfphp['lastMethod Call'] = '/1';
> $amfphp['isFlashCom m'] = false;
> $amfphp['classInsta nces'] = array();
> $amfphp['regenerate MethodTable' ] = false;
> $amfphp['amf3Record SetFormat' ] = "Array";
> $amfphp['encoding' ] = "amf0";
> 
> ?>
> 
> so what should i do? I am confused.
> 
> 
> 
> 
>  _ _ __
> From: valdhor 
> To: flexcod...@yahoogro ups.com
> Sent: Tuesday, 23 June, 2009 7:19:43 PM
> Subject: [flexcoders] Re: domain problem in remoteobject application
> 
> 
> 
> 
> 
> Inside your amfphp directory you will find a file globals.php.
> 
> Change the $servicesPath variable to the full path to your services directory.
> 
> HTH
> 
> Steve
> 
> --- In flexcod...@yahoogro ups.com, Vikram Singh  wrote:
> >
> > I am not getting excetly what you are trying to say me.
> > Can you please tell me in some detail which/how configure in amfphp?
> > I am little bit freshers for this stuff.
> > 
> > 
> > Thanks.
> > 
> > 
> >  _ _ __
> > From: Pedro Sena 
> > To: flexcod...@yahoogro ups.com
> > Sent: Monday, 22 June, 2009 5:55:51 PM
> > Subject: Re: [flexcoders] domain problem in remoteobject application
> > 
> > 
> > 
> > 
> > 
> > You can configure in amfphp where your 'services' would be.
> > 
> > Take a look at documentation, I think that your idea is to have just one 
> > amfphp directory for every project, if so, You can reference external 
> > directories in a way that amfphp would search for them.
> > 
> > HTH
> > 
> > 
> > On Mon, Jun 22, 2009 at 9:07 AM, Vikram Singh  
> > wrote:
> > 
> > 
> > 
> > 
> > Hello friends,
> > I have a query regarding domain problem.
> > My database is at primarydomain (www..primarydomain . com)
> > I also have subdomain and place all at subdomain directory. like this...
> > 
> > scenario 1:
> > Current file arrangement is:
> > 
> > Exported release build flex project at :www.subdomain. com/flexApplicat ion/
> > amfphp code placed at :www.subdomain. com/flexApplicat ion/amfphpcode/
> > 
> > this is perfectly working.
> > but now... 
> > 
> > scenario 2:
> > need to arrange like this
> > 
> > Exported release build flex project at :www.subdomain. com/flexApplicat ion/
> > amfphp code placed at :www.subdomain. com/amfphpcode/
> > 
> > amfphpcode is placed outside of flex application directory.
> > 
> > to run perfectly flex application in scenario-2, what changes I have to 
> > make with flex application code OR any other.
> > OR any other possible idea to implement it in scenario-2.
> > Please help me...
> > 
> > Regards,
> > Vikram. 
> > 
> >  _ _ __
> >  ICC World Twenty20 England '09 exclusively on YAHOO! CRICKET 
> > 
> > 
> > -- 
> > /**
> > * Pedro Sena
> > * Systems Architect
> > * Sun Certified Java Programmer 
> > * Sun Certified Web Component Developer
> > */
> > 
> > 
> > 
> > 
> >   ICC World Twenty20 England '09 exclusively on YAHOO! CRICKET 
> > http://cricket. yahoo.com
> >
> 
> 
> 
> 
> 
>   Cricket on your mind? Visit the ultimate cricket website. Enter 
> http://cricket. yahoo.com
>


   


  Love Cricket? Check out live scores, photos, video highlights and more. 
Click here http://cricket.yahoo.com