[flexcoders] Re: Overriding getters/setters getting compile error

2007-08-25 Thread Tony
Sorry, if it sounded like I meant it was a scoping problem. They just
cannot have the same name for compiler purposes.  I was just pointing
out that you had duplicate property names. Coming from the .NET world
this is very normal for me.  I should have just said You have a
duplicate property name problem :)

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

 Please pardon my jumping in here, but I think it may just be more a 
 case of duplicate names than scoping issues.  The compiler identifies 
 a getter function by its name, and the same with a variable.  If you 
 have both a getter and a variable named widget, how would the 
 compiler be able to tell them apart and know when you wanted just the 
 variable as opposed to executing the getter function?  Prefixing 
 the _ to the variable name is typical convention for mking the 
 variable and getter/setter distinguishable from each other 
 (e.g., _widget is the variable, widget is the getter/setter).
 
 Doug
 
 --- In flexcoders@yahoogroups.com, Peter Connolly psconnolly@ 
 wrote:
 
  Thanks Tony, although I must admit that I don't understand why this 
 now
  works.  Why can't the variable and the getter/setter methods be in 
 the same
  scope?  I don't remember reading anything about that kind of 
 restriction...
  
  
  On 8/23/07, Tony Alves threealves@ wrote:
  
 Your private variable and getter/setter are in the same scope.
   try:
   private var _widget:String;
   override public function get widget():String {
   return _widget;
   }
   override public function set widget(value:String):void {
   _widget = value;
   }
   Peter Connolly wrote:
   
I get the following compiler errors:
   
1021: Duplicate function definition Base.as http://Base.as
line 11
1021: Duplicate function definition Base.as http://Base.as
line 14
1023: Incompatible override Base.as http://Base.as
line 11
1023: Incompatible override Base.as http://Base.as
line 14
   
If my parent class is:
   
package
{
public class Base
{
private var widget:String;
   
public function Base(value:String = base-level widget) {
trace('Base.as http://Base.as' - value of widget is: 
+ this.widget);
}
   
public function get widget():String {
return this.widget;
}
public function set widget(value:String):void {
this.widget = value;
}
}
}
   
and the class with overriden getters/setters is:
   
package
{
public class OverridenClass extends Base
{
public function OverridenClass(value:String = overriden
widget value) {
super(value);
trace(value of widget is:  + widget);
}
   
override public function get widget():String {
return widget;
}
override public function set widget(value:String):void {
this.widget = value;
}
   
}
}
   
The lines that are highlighted are the ones marked as errors by 
 the
compiler under Hotfix3, Flex 2.0.1.
   
I thought I was following the examples shown on p. 
 135 Overriding
getters and setters in the Programming ActionScript 3.0 manual.
   
Can anyone point out to me why this is not working?
   
__._,_
   

  
 





[flexcoders] Using [Event...] in Custom Classes

2007-08-25 Thread Tony Alves
Jurgen,
I believe the problem here is that you are setting up a metadata tag on 
your class in actionscript which is not needed and I think it was said 
that Event meta tags are ignored by the compiler in ActionScript 
classes.  Someone here can clear that up for us.  I am not sure why, but 
it is only needed on MXML when setting up an event.  Because you are 
extending your class as an EventDispatcher, you only just need to 
dispatch the event you are setting up.

package components
{
import flash.events.Event;
public class MyClass extends EventDispatcher
{
public static const MY_EVENT:String = myEvent;
   
private function myFunction():void
{
dispatchEvent(new Event(MyClass.MY_EVENT));
}
}
}

THEN you can instantiate a MyClass variable and add an event listener:
var mine:MyClass = new MyClass();
mine.addEventListener(MyClass.MY_EVENT,someHandlerFunction);

The code assist is trying to show you the events on the event dispatcher 
and there really is just the two by default (activate and deactivate).
Don't ask me why though.  I always set up my Event types as constant 
vars on my class, so I know I need to access them off my class name.
This should work the same way for custom Events also.

Maybe an adobe flex expert can explain this better than I, but that is 
my understanding.

Regards,
Tony

P.S. ( you were borrowing (some call it hijacking) another thread and I 
think it was getting missed.)

Jurgen Wrote: 
There seems to be an issue using a custom class' event metadata in an
addEventListener statement. Here is an example:

package com.example
{

import flash.events.EventDispatcher;

[Event(name=myEvent, type=flash.events.Event)]

public class MyClass extends EventDispatcher
{

// class code

private function myFunction():void
{
dispatchEvent(new Event(myEvent));
}

}

}

When using an instance of that class and creating an addEventListener in
code (not using it with MXML tags) Flex Builder's code assist lists the
event, but splits it apart and shows it as Event.MY_EVENT.

That of course throws a compiler error.

Is this by design and how would we work with an event in a custom class
using the [Event...] metatag?

I haven't checked to see if this is different with a custom event. I'll
check on that next, but I wanted to see if anyone has run into this
problem before.

Thanks,

Jurgen


[flexcoders] Debugging Flex and Java inside Eclipse

2007-08-25 Thread flex.fusion
Hi Everyone,

I want to setup the debug mode for Flex and Java inside Eclipse with 
help of flex-builder plugin to eclipse and Apache Tomcat 5.5 web-
server.

I am following one nice link:
http://www.jamesward.org/wordpress/2006/07/05/debug-flex-java-
together-in-flex-builder-2/

My problem is with step 3 mentioned in above link.
When I reach to step 3, Eclipse shows 1 ERROR..
error statement: Unknown Configuration Variable 'compiler.keep-as3-
metadata'

I do have following code inside my flex-config.xml
compiler
 keep-as3-metadata
  nameBindable/name
  nameManaged/name
  nameChangeEvent/name
  nameNonCommittingChangeEvent/name
  nameTransient/name
 /keep-as3-metadata
/compiler

JFI: My Tomcat Server is running when I am configuring this project 
with FDS.

I will be glad if I can resolve this error and configure the 
projects for DEBUG mode.
I will be greatful if there are any other good links for similar 
purpose.

Thanks in Advance,
Savan



[flexcoders] moveEffect between 2 containers

2007-08-25 Thread maybe later...
Hi,
I have a custom component (X) in canvas1. I'm trying to use a move
effect to move it from canvas1 to canvas2.
I also want X to become canvas2's child at the end.
When I apply a move effect on X, it moves only within canvas1.
should I use removeChild() and addChild() manually ? or is there a
better way ?
Thanks.



RE: [flexcoders] Re: Using [Event...] in Custom Classes

2007-08-25 Thread Gordon Smith
Please file a bug against Flex Builder at http://bugs.adobe.com/flex.
 
- Gordon



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Saturday, August 25, 2007 8:08 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Using [Event...] in Custom Classes



Event metadata is definitely not ignored in AS. Take a look at just
about any class in the framework and you'll see plenty [Event] tags.
It is there specifically to provide code hinting and support for
binding in MXML.

The problem here is that the code completion engine is offering class
constants that don't exist. They seem to be based on the constant
value, with some reformatting applied to convert to all uppercase and
inserting underscores anywhere there is a lowercase next to uppercase.
So MyEvtClass.FLY = flyAway appears in the completion list as
MyEvtClass.FLY_AWAY

Ben

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tony Alves [EMAIL PROTECTED] wrote:

 Jurgen,
 I believe the problem here is that you are setting up a metadata tag
on 
 your class in actionscript which is not needed and I think it was said

 that Event meta tags are ignored by the compiler in ActionScript 
 classes. Someone here can clear that up for us. I am not sure why,
but 
 it is only needed on MXML when setting up an event. Because you are 
 extending your class as an EventDispatcher, you only just need to 
 dispatch the event you are setting up.
 
 package components
 {
 import flash.events.Event;
 public class MyClass extends EventDispatcher
 {
 public static const MY_EVENT:String = myEvent;
 
 private function myFunction():void
 {
 dispatchEvent(new Event(MyClass.MY_EVENT));
 }
 }
 }
 
 THEN you can instantiate a MyClass variable and add an event listener:
 var mine:MyClass = new MyClass();
 mine.addEventListener(MyClass.MY_EVENT,someHandlerFunction);
 
 The code assist is trying to show you the events on the event
dispatcher 
 and there really is just the two by default (activate and deactivate).
 Don't ask me why though. I always set up my Event types as constant 
 vars on my class, so I know I need to access them off my class name.
 This should work the same way for custom Events also.
 
 Maybe an adobe flex expert can explain this better than I, but that is

 my understanding.
 
 Regards,
 Tony
 
 P.S. ( you were borrowing (some call it hijacking) another thread and
I 
 think it was getting missed.)
 
 Jurgen Wrote: 
 There seems to be an issue using a custom class' event metadata in an
 addEventListener statement. Here is an example:
 
 package com.example
 {
 
 import flash.events.EventDispatcher;
 
 [Event(name=myEvent, type=flash.events.Event)]
 
 public class MyClass extends EventDispatcher
 {
 
 // class code
 
 private function myFunction():void
 {
 dispatchEvent(new Event(myEvent));
 }
 
 }
 
 }
 
 When using an instance of that class and creating an addEventListener
in
 code (not using it with MXML tags) Flex Builder's code assist lists
the
 event, but splits it apart and shows it as Event.MY_EVENT.
 
 That of course throws a compiler error.
 
 Is this by design and how would we work with an event in a custom
class
 using the [Event...] metatag?
 
 I haven't checked to see if this is different with a custom event.
I'll
 check on that next, but I wanted to see if anyone has run into this
 problem before.
 
 Thanks,
 
 Jurgen




 


[flexcoders] Memory leaks

2007-08-25 Thread André Rodrigues Pena
Hi all,

It might be a well-known that Flex has several memory issues. It doesn't
completely free the memory of the components you add runtime, when you
remove them from their containers, and when it comes to large-scale
applications, this is a huge concern. The way my co-workers found to pass by
it was to create a Javascript/Flex framework to allow Flex to load modules
in separate HTML frames and provide communication between them. So, when a
module gets out of scene, the browser frees the entire SWF. But this
approach limits the user interaction like drag-n-drop support between
modules. It's not natural.

It seems that the browser may have a great part of the blame. They realized,
for instance, that Internet Explorer releases the memory when the window is
minimized and FireFox doesn't.

I'm here to ask what else can be done regarding memory issues. And how you
professionals have dealt with it.

Thanks

-- 
André Rodrigues Pena


Re: [flexcoders] Re: Using [Event...] in Custom Classes

2007-08-25 Thread Tony Alves
ok, I see your point.  I did not look at it that way. So, it is a bug then.

ben.clinkinbeard wrote:

 Event metadata is definitely not ignored in AS. Take a look at just
 about any class in the framework and you'll see plenty [Event] tags.
 It is there specifically to provide code hinting and support for
 binding in MXML.

 The problem here is that the code completion engine is offering class
 constants that don't exist. They seem to be based on the constant
 value, with some reformatting applied to convert to all uppercase and
 inserting underscores anywhere there is a lowercase next to uppercase.
 So MyEvtClass.FLY = flyAway appears in the completion list as
 MyEvtClass.FLY_AWAY

 Ben

 --- In flexcoders@yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com, Tony Alves [EMAIL PROTECTED] wrote:
 
  Jurgen,
  I believe the problem here is that you are setting up a metadata tag on
  your class in actionscript which is not needed and I think it was said
  that Event meta tags are ignored by the compiler in ActionScript
  classes. Someone here can clear that up for us. I am not sure why,
 but
  it is only needed on MXML when setting up an event. Because you are
  extending your class as an EventDispatcher, you only just need to
  dispatch the event you are setting up.
 
  package components
  {
  import flash.events.Event;
  public class MyClass extends EventDispatcher
  {
  public static const MY_EVENT:String = myEvent;
 
  private function myFunction():void
  {
  dispatchEvent(new Event(MyClass.MY_EVENT));
  }
  }
  }
 
  THEN you can instantiate a MyClass variable and add an event listener:
  var mine:MyClass = new MyClass();
  mine.addEventListener(MyClass.MY_EVENT,someHandlerFunction);
 
  The code assist is trying to show you the events on the event
 dispatcher
  and there really is just the two by default (activate and deactivate).
  Don't ask me why though. I always set up my Event types as constant
  vars on my class, so I know I need to access them off my class name.
  This should work the same way for custom Events also.
 
  Maybe an adobe flex expert can explain this better than I, but that is
  my understanding.
 
  Regards,
  Tony
 
  P.S. ( you were borrowing (some call it hijacking) another thread and I
  think it was getting missed.)
 
  Jurgen Wrote: 
  There seems to be an issue using a custom class' event metadata in an
  addEventListener statement. Here is an example:
 
  package com.example
  {
 
  import flash.events.EventDispatcher;
 
  [Event(name=myEvent, type=flash.events.Event)]
 
  public class MyClass extends EventDispatcher
  {
 
  // class code
 
  private function myFunction():void
  {
  dispatchEvent(new Event(myEvent));
  }
 
  }
 
  }
 
  When using an instance of that class and creating an addEventListener in
  code (not using it with MXML tags) Flex Builder's code assist lists the
  event, but splits it apart and shows it as Event.MY_EVENT.
 
  That of course throws a compiler error.
 
  Is this by design and how would we work with an event in a custom class
  using the [Event...] metatag?
 
  I haven't checked to see if this is different with a custom event. I'll
  check on that next, but I wanted to see if anyone has run into this
  problem before.
 
  Thanks,
 
  Jurgen
 

  


[flexcoders] Fractional scroll gotcha

2007-08-25 Thread Richard Rodseth
I'm on a tight schedule to produce a scrollable zoomable document view
- a vertical list of images (pages) of varying sizes. This has already
been done on the project in HTML (without the zooming), and I was
hoping to effectively demonstrate the power of Flex.

So I created a page component that uses an image tag, and use it as an
itemRenderer on a list. Then I discovered that I can't scroll properly
if the cell is larger than the list. Rats.

I don't know if I have the time to implement my own item recycling, so
suggestions would be appreciated. I don't need item selection, so
solutions that don't rely on List might be just fine.

I might be able to use Moxie if this is issue is being addressed soon,
as long as I don't need a newer Player (my understanding is that's
only needed for the caching feature).

Thanks in advance,
- RIchard


RE: [flexcoders] Memory leaks

2007-08-25 Thread Alex Harui
There are two major memory usage scenarios in Flex.  One involves creating a 
new instance of a component, displaying, and later destroying it.  The other 
involves bringing in one or more classes of components in a module and trying 
to get rid of that module later when its classes are no longer needed.
 
Honestly, I don't know of any issues of the first kind at this point.  A major 
problem with ViewStack related components was addressed in Hotfix2, and a 
DateField issue was either addressed in the same hotfix, or a workaround was 
provided and the issue fixed for Moxie.  A recent issue with Menus was fixed 
for Moxie and a workaround was provided.  I'm sure there are still issues out 
there, and they should be filed as bugs so we can investigate and fix them.  I 
also encourage you to try to isolate problems of this nature and post examples 
on this forum as often there can be a misunderstanding of how memory management 
works in Flash/Flex.
 
The second kind of issues is sort of a fact-of-life for Flex.  The first module 
to introduce shared code via Styles or Managers must remain in memory to serve 
all other code.  This has been explained on my 
blog.http://blogs.adobe.com/aharui/2007/03/modules.html.  The blog article 
includes an example of a way to deal with this situation, although often the 
easiest way is just to include all managers in the main app, and bring in 
styles via runtime CSS.
 
As you'll see in the article, browser memory management has little to do with 
it.  It simply has to do with how GC works (described further elsewhere on my 
blog) and how styles and singleton managers are shared.  Any memory changes 
when minimizing is probably due to IE releasing its own browser resources, 
although the player may release some at that time as well.
 
If you have further questions, this forum should be able to help you out.  In 
the future, please ask sooner before you spend time creating eloborate 
infrastructures.
 
-Alex



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of André 
Rodrigues Pena
Sent: Saturday, August 25, 2007 10:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Memory leaks



Hi all,

It might be a well-known that Flex has several memory issues. It doesn't 
completely free the memory of the components you add runtime, when you remove 
them from their containers, and when it comes to large-scale applications, this 
is a huge concern. The way my co-workers found to pass by it was to create a 
Javascript/Flex framework to allow Flex to load modules in separate HTML frames 
and provide communication between them. So, when a module gets out of scene, 
the browser frees the entire SWF. But this approach limits the user interaction 
like drag-n-drop support between modules. It's not natural. 

It seems that the browser may have a great part of the blame. They realized, 
for instance, that Internet Explorer releases the memory when the window is 
minimized and FireFox doesn't.

I'm here to ask what else can be done regarding memory issues. And how you 
professionals have dealt with it. 

Thanks

-- 
André Rodrigues Pena 

 


Re: [flexcoders] Re: Using [Event...] in Custom Classes

2007-08-25 Thread Doug McCune
Yeah, here's the way I think it works in the current FB 3 release anyway
(which is the way ben described too):

You put metadata in your class, something like:

[Event(name=myEvent, type=com.me.MyEvent)]

So then you type: myClass.addEventListener( and then the auto events come up
in the list that allows you to select one of the possible events. The IDE
knows that there is an event named myEvent, which is defined by the
metadata. The IDE does not know what static constant myEvent is actually
defined by, but the IDE does try to substitute in a static constant from the
MyEvent class. It just converts the string that is in the metadata tag into
a format like MY_EVENT. It converts all characters to uppercase, and then
anywhere that there is a change in case in your event it adds in an
underscore. So if you had metadata that defined an event called
myReallyCoolEvent, then the IDE would bring up code hinting that read like
this: MyEvent.MY_REALLY_COOL_EVENT.

So in you MyEvent class, if you don't have the event defined with that
naming convention, then the code autocomplete isn't going to work for you.
You'll type .addEventListener(, get the list of events that the IDE thinks
should be defined in certain constants, and then you'll have to change it
after the fact to redefine the proper const names.

I've taken to just naming my stuff based on what the IDE assumes. So if I
define an event of type myEvent, I know that I need to have MY_EVENT
constant in the event class.

There are actually a few cases of this not working with the framework
classes. I don't remember where I've seen it, but some of the internal
framework source defines events that don't conform to the proper naming
convention, so when you get the autocomplete for the addEventListener call
it actually fills in with undefined constants that won't compile.

Doug

On 8/25/07, Tony Alves [EMAIL PROTECTED] wrote:

   ok, I see your point. I did not look at it that way. So, it is a bug
 then.

 ben.clinkinbeard wrote:
 
  Event metadata is definitely not ignored in AS. Take a look at just
  about any class in the framework and you'll see plenty [Event] tags.
  It is there specifically to provide code hinting and support for
  binding in MXML.
 
  The problem here is that the code completion engine is offering class
  constants that don't exist. They seem to be based on the constant
  value, with some reformatting applied to convert to all uppercase and
  inserting underscores anywhere there is a lowercase next to uppercase.
  So MyEvtClass.FLY = flyAway appears in the completion list as
  MyEvtClass.FLY_AWAY
 
  Ben
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
  mailto:flexcoders% flexcoders%2540yahoogroups.com, Tony Alves
 [EMAIL PROTECTED] wrote:
  
   Jurgen,
   I believe the problem here is that you are setting up a metadata tag
 on
   your class in actionscript which is not needed and I think it was said
   that Event meta tags are ignored by the compiler in ActionScript
   classes. Someone here can clear that up for us. I am not sure why,
  but
   it is only needed on MXML when setting up an event. Because you are
   extending your class as an EventDispatcher, you only just need to
   dispatch the event you are setting up.
  
   package components
   {
   import flash.events.Event;
   public class MyClass extends EventDispatcher
   {
   public static const MY_EVENT:String = myEvent;
  
   private function myFunction():void
   {
   dispatchEvent(new Event(MyClass.MY_EVENT));
   }
   }
   }
  
   THEN you can instantiate a MyClass variable and add an event listener:
   var mine:MyClass = new MyClass();
   mine.addEventListener(MyClass.MY_EVENT,someHandlerFunction);
  
   The code assist is trying to show you the events on the event
  dispatcher
   and there really is just the two by default (activate and deactivate).
   Don't ask me why though. I always set up my Event types as constant
   vars on my class, so I know I need to access them off my class name.
   This should work the same way for custom Events also.
  
   Maybe an adobe flex expert can explain this better than I, but that is
   my understanding.
  
   Regards,
   Tony
  
   P.S. ( you were borrowing (some call it hijacking) another thread and
 I
   think it was getting missed.)
  
   Jurgen Wrote: 
   There seems to be an issue using a custom class' event metadata in an
   addEventListener statement. Here is an example:
  
   package com.example
   {
  
   import flash.events.EventDispatcher;
  
   [Event(name=myEvent, type=flash.events.Event)]
  
   public class MyClass extends EventDispatcher
   {
  
   // class code
  
   private function myFunction():void
   {
   dispatchEvent(new Event(myEvent));
   }
  
   }
  
   }
  
   When using an instance of that class and creating an addEventListener
 in
   code (not using it with MXML tags) Flex Builder's code assist lists
 the
   event, but splits it apart and shows it as Event.MY_EVENT.
  
   That of course throws a 

Re: [flexcoders] Re: Using [Event...] in Custom Classes

2007-08-25 Thread Tony Alves
Ben,
I appologize.  I was way off on this one.  I made a bad assumption based 
on my ignorance.
Do you ever wish you could take back a post?  :)
Tony eating crow

ben.clinkinbeard wrote:

 Event metadata is definitely not ignored in AS. Take a look at just
 about any class in the framework and you'll see plenty [Event] tags.
 It is there specifically to provide code hinting and support for
 binding in MXML.

 The problem here is that the code completion engine is offering class
 constants that don't exist. They seem to be based on the constant
 value, with some reformatting applied to convert to all uppercase and
 inserting underscores anywhere there is a lowercase next to uppercase.
 So MyEvtClass.FLY = flyAway appears in the completion list as
 MyEvtClass.FLY_AWAY

 Ben

 --- In flexcoders@yahoogroups.com 
 mailto:flexcoders%40yahoogroups.com, Tony Alves [EMAIL PROTECTED] wrote:
 
  Jurgen,
  I believe the problem here is that you are setting up a metadata tag on
  your class in actionscript which is not needed and I think it was said
  that Event meta tags are ignored by the compiler in ActionScript
  classes. Someone here can clear that up for us. I am not sure why,
 but
  it is only needed on MXML when setting up an event. Because you are
  extending your class as an EventDispatcher, you only just need to
  dispatch the event you are setting up.
 
  package components
  {
  import flash.events.Event;
  public class MyClass extends EventDispatcher
  {
  public static const MY_EVENT:String = myEvent;
 
  private function myFunction():void
  {
  dispatchEvent(new Event(MyClass.MY_EVENT));
  }
  }
  }
 
  THEN you can instantiate a MyClass variable and add an event listener:
  var mine:MyClass = new MyClass();
  mine.addEventListener(MyClass.MY_EVENT,someHandlerFunction);
 
  The code assist is trying to show you the events on the event
 dispatcher
  and there really is just the two by default (activate and deactivate).
  Don't ask me why though. I always set up my Event types as constant
  vars on my class, so I know I need to access them off my class name.
  This should work the same way for custom Events also.
 
  Maybe an adobe flex expert can explain this better than I, but that is
  my understanding.
 
  Regards,
  Tony
 
  P.S. ( you were borrowing (some call it hijacking) another thread and I
  think it was getting missed.)
 
  Jurgen Wrote: 
  There seems to be an issue using a custom class' event metadata in an
  addEventListener statement. Here is an example:
 
  package com.example
  {
 
  import flash.events.EventDispatcher;
 
  [Event(name=myEvent, type=flash.events.Event)]
 
  public class MyClass extends EventDispatcher
  {
 
  // class code
 
  private function myFunction():void
  {
  dispatchEvent(new Event(myEvent));
  }
 
  }
 
  }
 
  When using an instance of that class and creating an addEventListener in
  code (not using it with MXML tags) Flex Builder's code assist lists the
  event, but splits it apart and shows it as Event.MY_EVENT.
 
  That of course throws a compiler error.
 
  Is this by design and how would we work with an event in a custom class
  using the [Event...] metatag?
 
  I haven't checked to see if this is different with a custom event. I'll
  check on that next, but I wanted to see if anyone has run into this
  problem before.
 
  Thanks,
 
  Jurgen
 

  


RE: [flexcoders] Memory leaks - binding to e4x XML?

2007-08-25 Thread Tracy Spratt
I came across this article, wherein the author alleges that binding to e4x XML 
objects cause memory leaks:

http://blog.fastlanesw.com/?p=14

 

His arguments / findings, seemed  well reasoned and supported, and I do not 
have the background to refute them.  Perhaps someone here might discuss this.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex 
Harui
Sent: Saturday, August 25, 2007 2:21 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Memory leaks

 

There are two major memory usage scenarios in Flex.  One involves creating a 
new instance of a component, displaying, and later destroying it.  The other 
involves bringing in one or more classes of components in a module and trying 
to get rid of that module later when its classes are no longer needed.

 

Honestly, I don't know of any issues of the first kind at this point.  A major 
problem with ViewStack related components was addressed in Hotfix2, and a 
DateField issue was either addressed in the same hotfix, or a workaround was 
provided and the issue fixed for Moxie.  A recent issue with Menus was fixed 
for Moxie and a workaround was provided.  I'm sure there are still issues out 
there, and they should be filed as bugs so we can investigate and fix them.  I 
also encourage you to try to isolate problems of this nature and post examples 
on this forum as often there can be a misunderstanding of how memory management 
works in Flash/Flex.

 

The second kind of issues is sort of a fact-of-life for Flex.  The first module 
to introduce shared code via Styles or Managers must remain in memory to serve 
all other code.  This has been explained on my 
blog.http://blogs.adobe.com/aharui/2007/03/modules.html.  The blog article 
includes an example of a way to deal with this situation, although often the 
easiest way is just to include all managers in the main app, and bring in 
styles via runtime CSS.

 

As you'll see in the article, browser memory management has little to do with 
it.  It simply has to do with how GC works (described further elsewhere on my 
blog) and how styles and singleton managers are shared.  Any memory changes 
when minimizing is probably due to IE releasing its own browser resources, 
although the player may release some at that time as well.

 

If you have further questions, this forum should be able to help you out.  In 
the future, please ask sooner before you spend time creating eloborate 
infrastructures.

 

-Alex

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of André 
Rodrigues Pena
Sent: Saturday, August 25, 2007 10:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Memory leaks

Hi all,

It might be a well-known that Flex has several memory issues. It doesn't 
completely free the memory of the components you add runtime, when you remove 
them from their containers, and when it comes to large-scale applications, this 
is a huge concern. The way my co-workers found to pass by it was to create a 
Javascript/Flex framework to allow Flex to load modules in separate HTML frames 
and provide communication between them. So, when a module gets out of scene, 
the browser frees the entire SWF. But this approach limits the user interaction 
like drag-n-drop support between modules. It's not natural. 

It seems that the browser may have a great part of the blame. They realized, 
for instance, that Internet Explorer releases the memory when the window is 
minimized and FireFox doesn't.

I'm here to ask what else can be done regarding memory issues. And how you 
professionals have dealt with it. 

Thanks

-- 
André Rodrigues Pena 

 



[flexcoders] Re: setFocus stopped working

2007-08-25 Thread bobklhr
That was it Alex. Your suggestion worked.

Thanks

Bob
 --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 Sounds like a timing issue.  When the modal dialog goes away, the 
focus
 managers try to restore focus to the object that last had focus 
before
 the modal dialog appeared.  This is probably happening after your 
call
 to setFocus, thus negating its effect.
  
 First thing to try is to use callLater(focusManager.setFocus, [
 recipeName ]);
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of bobklhr
 Sent: Friday, August 24, 2007 11:29 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] setFocus stopped working
 
 
 
 I have a button which calls a function which creates a new object 
and 
 sets the focus on a field, e.g. 
 
 focusManager.setFocus(recipeName);
 
 This works fine.
 
 I recently changed this so that the button would now open a modal 
 dialog to collect some information and then call the original 
 function. Now the the focus goes to the button, not the field!
 
 Any idea what's going wrong and how I can fix it?
 
 Thanks
 
 Bob





[flexcoders] Re: AIR vs DLL vs. External code?

2007-08-25 Thread droponrcll
--- In flexcoders@yahoogroups.com, hank williams [EMAIL PROTECTED] 
wrote:

 
 So in your mind, Adobe's goal of being cross platform should be
 abandoned since there is no way to do cross-platform COM? Would you
 find it acceptable if it allowed you to do Mac only desktop stuff or
 does windows only compatible == desktop software?

I think Adobe should provide hooks that allow extension, for instance 
by Java.  If it so happens that a third-party or homegrown extension 
*happens* not to be cross-platform, AIR itself will still be cross-
platform.  It shouldn't be Adobe's business to enforce that 
everything that could ever be used by AIR would have to be cross-
platform.

For example, both Authorware and Director (Adobe's desktop 
application building programs) are both cross-platform but allow 
extension via Xtras and other means.  Not all of those Xtras are 
cross-platform, but developers still find them incredibly useful, 
either because they are only working on one platform or because they 
can work around the gap in some other way on the other platform.

-Amy



RE: [flexcoders] Flex + SOAP + AXIS support?

2007-08-25 Thread Peter Farland
Right, Flex WebServices are focused on SOAP 1.1 support and this will
not change in Flex 3.
 
A new implementation of Flex WebServices was introduced in Flex 2.0.1
HF2 to coincide with LCDS 2.5 (though there are a few gaps and will be
more complete in Flex 3). This implementation is focused on supporting
the majority of the WS-I Basic Profile Version 1.0 (but not things like
UDDI) while also retaining support for legacy features such as
rpc-encoded style, soap encoded types such as Array and a few of the
custom Axis types such as Map. SOAP 1.2 support will not be in Flex 3.
 
I suggest using literal style where possible going forward with
WebServices.
 
Please log any WebService bugs against Flex 3 as soon as you find them: 
 
http://bugs.adobe.com/flex/
 
... but remember to try out the nightly builds of Flex 3 SDK first
rather than using Beta 1.
 
http://labs.adobe.com/technologies/flex/sdk/flex3sdk.html
 
Thanks!
Pete
 
 
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Peter Connolly
Sent: Friday, August 24, 2007 9:09 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Flex + SOAP + AXIS support?


The Flex Developer's Guide (p. 1401) states that WSDL 1.1 is supported
and, by implication, SOAP 1.1 support is a requirement of WSDL 1.1
http://www.w3.org/TR/wsdl .



On 8/24/07, bobsandywalls [EMAIL PROTECTED] wrote: 

I know that Flex supports SOAP, however what version of SOAP
does it
support and by proxy what version of AXIS is capable of
providing?

I looked online for such a requirements list, but could not find
it.
Thanks for the assistance






 


[flexcoders] Re: Using [Event...] in Custom Classes

2007-08-25 Thread ben.clinkinbeard
Yea, I guess I am just going to have to fall in line with my
constant-naming practices for now, but I think its something that
should be fixed. The whole point (besides code hinting) of [Event]
tags (and the type attribute specifically) is to give the compiler
info on where to go look for those values isn't it?

Since this seems to be a fact of life for the time being, maybe
someone can help me with the issue that led me to use those
unsanctioned naming practices in the first place: event name
collision. I ended up changing the value of my RESIZE event (and some
others) to things like myResize because my listeners were picking up
the resize events that the framework generates during its normal
layout process and I was getting coercion errors.

What do other people do in those cases? Change your event values or
type your listeners to accept Event and check the type inside the method?

Here is a recent thread that discusses a problem I discovered of a
similar nature:
http://tech.groups.yahoo.com/group/flexcoders/message/84943

Gordon, I filed a bug in the Flex 3 prerelease system (with hopes that
someone can sneak a fix in), let me know if that was a mistake and I
should add it to the public base.

Thanks,
Ben


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

 Yeah, here's the way I think it works in the current FB 3 release anyway
 (which is the way ben described too):
 
 You put metadata in your class, something like:
 
 [Event(name=myEvent, type=com.me.MyEvent)]
 
 So then you type: myClass.addEventListener( and then the auto events
come up
 in the list that allows you to select one of the possible events.
The IDE
 knows that there is an event named myEvent, which is defined by the
 metadata. The IDE does not know what static constant myEvent is
actually
 defined by, but the IDE does try to substitute in a static constant
from the
 MyEvent class. It just converts the string that is in the metadata
tag into
 a format like MY_EVENT. It converts all characters to uppercase, and
then
 anywhere that there is a change in case in your event it adds in an
 underscore. So if you had metadata that defined an event called
 myReallyCoolEvent, then the IDE would bring up code hinting that
read like
 this: MyEvent.MY_REALLY_COOL_EVENT.
 
 So in you MyEvent class, if you don't have the event defined with that
 naming convention, then the code autocomplete isn't going to work
for you.
 You'll type .addEventListener(, get the list of events that the IDE
thinks
 should be defined in certain constants, and then you'll have to
change it
 after the fact to redefine the proper const names.
 
 I've taken to just naming my stuff based on what the IDE assumes. So
if I
 define an event of type myEvent, I know that I need to have MY_EVENT
 constant in the event class.
 
 There are actually a few cases of this not working with the framework
 classes. I don't remember where I've seen it, but some of the internal
 framework source defines events that don't conform to the proper
naming
 convention, so when you get the autocomplete for the
addEventListener call
 it actually fills in with undefined constants that won't compile.
 
 Doug
 
 On 8/25/07, Tony Alves [EMAIL PROTECTED] wrote:
 
ok, I see your point. I did not look at it that way. So, it is a bug
  then.
 
  ben.clinkinbeard wrote:
  
   Event metadata is definitely not ignored in AS. Take a look at just
   about any class in the framework and you'll see plenty [Event] tags.
   It is there specifically to provide code hinting and support for
   binding in MXML.
  
   The problem here is that the code completion engine is offering
class
   constants that don't exist. They seem to be based on the constant
   value, with some reformatting applied to convert to all
uppercase and
   inserting underscores anywhere there is a lowercase next to
uppercase.
   So MyEvtClass.FLY = flyAway appears in the completion list as
   MyEvtClass.FLY_AWAY
  
   Ben
  
   --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com
   mailto:flexcoders% flexcoders%2540yahoogroups.com, Tony Alves
  threealves@ wrote:
   
Jurgen,
I believe the problem here is that you are setting up a
metadata tag
  on
your class in actionscript which is not needed and I think it
was said
that Event meta tags are ignored by the compiler in ActionScript
classes. Someone here can clear that up for us. I am not sure why,
   but
it is only needed on MXML when setting up an event. Because
you are
extending your class as an EventDispatcher, you only just need to
dispatch the event you are setting up.
   
package components
{
import flash.events.Event;
public class MyClass extends EventDispatcher
{
public static const MY_EVENT:String = myEvent;
   
private function myFunction():void
{
dispatchEvent(new Event(MyClass.MY_EVENT));
}
}
}
   
THEN you can instantiate a MyClass variable and add an event
listener:

RE: [flexcoders] Re: Using [Event...] in Custom Classes

2007-08-25 Thread Gordon Smith
 Gordon, I filed a bug in the Flex 3 prerelease system (with hopes that
someone
 can sneak a fix in), let me know if that was a mistake and I should
add it to the public base.
 
I'm not actually sure just how that bug system works. Is there any way
to track the status of a bug you enter? If not, I suggest filing it at
http://bugs.adobe.com/flex.
 
- Gordon



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Saturday, August 25, 2007 12:08 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Using [Event...] in Custom Classes



Yea, I guess I am just going to have to fall in line with my
constant-naming practices for now, but I think its something that
should be fixed. The whole point (besides code hinting) of [Event]
tags (and the type attribute specifically) is to give the compiler
info on where to go look for those values isn't it?

Since this seems to be a fact of life for the time being, maybe
someone can help me with the issue that led me to use those
unsanctioned naming practices in the first place: event name
collision. I ended up changing the value of my RESIZE event (and some
others) to things like myResize because my listeners were picking up
the resize events that the framework generates during its normal
layout process and I was getting coercion errors.

What do other people do in those cases? Change your event values or
type your listeners to accept Event and check the type inside the
method?

Here is a recent thread that discusses a problem I discovered of a
similar nature:
http://tech.groups.yahoo.com/group/flexcoders/message/84943
http://tech.groups.yahoo.com/group/flexcoders/message/84943 

Gordon, I filed a bug in the Flex 3 prerelease system (with hopes that
someone can sneak a fix in), let me know if that was a mistake and I
should add it to the public base.

Thanks,
Ben

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Doug McCune [EMAIL PROTECTED] wrote:

 Yeah, here's the way I think it works in the current FB 3 release
anyway
 (which is the way ben described too):
 
 You put metadata in your class, something like:
 
 [Event(name=myEvent, type=com.me.MyEvent)]
 
 So then you type: myClass.addEventListener( and then the auto events
come up
 in the list that allows you to select one of the possible events.
The IDE
 knows that there is an event named myEvent, which is defined by the
 metadata. The IDE does not know what static constant myEvent is
actually
 defined by, but the IDE does try to substitute in a static constant
from the
 MyEvent class. It just converts the string that is in the metadata
tag into
 a format like MY_EVENT. It converts all characters to uppercase, and
then
 anywhere that there is a change in case in your event it adds in an
 underscore. So if you had metadata that defined an event called
 myReallyCoolEvent, then the IDE would bring up code hinting that
read like
 this: MyEvent.MY_REALLY_COOL_EVENT.
 
 So in you MyEvent class, if you don't have the event defined with that
 naming convention, then the code autocomplete isn't going to work
for you.
 You'll type .addEventListener(, get the list of events that the IDE
thinks
 should be defined in certain constants, and then you'll have to
change it
 after the fact to redefine the proper const names.
 
 I've taken to just naming my stuff based on what the IDE assumes. So
if I
 define an event of type myEvent, I know that I need to have MY_EVENT
 constant in the event class.
 
 There are actually a few cases of this not working with the framework
 classes. I don't remember where I've seen it, but some of the internal
 framework source defines events that don't conform to the proper
naming
 convention, so when you get the autocomplete for the
addEventListener call
 it actually fills in with undefined constants that won't compile.
 
 Doug
 
 On 8/25/07, Tony Alves [EMAIL PROTECTED] wrote:
 
  ok, I see your point. I did not look at it that way. So, it is a bug
  then.
 
  ben.clinkinbeard wrote:
  
   Event metadata is definitely not ignored in AS. Take a look at
just
   about any class in the framework and you'll see plenty [Event]
tags.
   It is there specifically to provide code hinting and support for
   binding in MXML.
  
   The problem here is that the code completion engine is offering
class
   constants that don't exist. They seem to be based on the constant
   value, with some reformatting applied to convert to all
uppercase and
   inserting underscores anywhere there is a lowercase next to
uppercase.
   So MyEvtClass.FLY = flyAway appears in the completion list as
   MyEvtClass.FLY_AWAY
  
   Ben
  
   --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com  flexcoders%40yahoogroups.com
   mailto:flexcoders% flexcoders%2540yahoogroups.com, Tony Alves
  threealves@ wrote:
   
Jurgen,
I believe the problem here is that you are setting up a
metadata tag
  on
your class in 

RE: [flexcoders] Memory leaks - binding to e4x XML?

2007-08-25 Thread Alex Harui
I thought it was a performance issue only.  I do expect sealed classes to 
perform better than XMLLIstCollection (which does not convert to object). I'll 
have to investigate further.
 
Always frustrating when misinformation get out there...



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy 
Spratt
Sent: Saturday, August 25, 2007 11:47 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Memory leaks - binding to e4x XML?



I came across this article, wherein the author alleges that binding to e4x XML 
objects cause memory leaks:

http://blog.fastlanesw.com/?p=14 http://blog.fastlanesw.com/?p=14 

His arguments / findings, seemed  well reasoned and supported, and I do not 
have the background to refute them.  Perhaps someone here might discuss this.

Tracy



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Alex 
Harui
Sent: Saturday, August 25, 2007 2:21 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Memory leaks

There are two major memory usage scenarios in Flex.  One involves creating a 
new instance of a component, displaying, and later destroying it.  The other 
involves bringing in one or more classes of components in a module and trying 
to get rid of that module later when its classes are no longer needed.

Honestly, I don't know of any issues of the first kind at this point.  A major 
problem with ViewStack related components was addressed in Hotfix2, and a 
DateField issue was either addressed in the same hotfix, or a workaround was 
provided and the issue fixed for Moxie.  A recent issue with Menus was fixed 
for Moxie and a workaround was provided.  I'm sure there are still issues out 
there, and they should be filed as bugs so we can investigate and fix them.  I 
also encourage you to try to isolate problems of this nature and post examples 
on this forum as often there can be a misunderstanding of how memory management 
works in Flash/Flex.

The second kind of issues is sort of a fact-of-life for Flex.  The first module 
to introduce shared code via Styles or Managers must remain in memory to serve 
all other code.  This has been explained on my 
blog.http://blogs.adobe.com/aharui/2007/03/modules.html.  The blog article 
includes an example of a way to deal with this situation, although often the 
easiest way is just to include all managers in the main app, and bring in 
styles via runtime CSS.

As you'll see in the article, browser memory management has little to do with 
it.  It simply has to do with how GC works (described further elsewhere on my 
blog) and how styles and singleton managers are shared.  Any memory changes 
when minimizing is probably due to IE releasing its own browser resources, 
although the player may release some at that time as well.

If you have further questions, this forum should be able to help you out.  In 
the future, please ask sooner before you spend time creating eloborate 
infrastructures.

-Alex



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of André 
Rodrigues Pena
Sent: Saturday, August 25, 2007 10:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Memory leaks

Hi all,

It might be a well-known that Flex has several memory issues. It doesn't 
completely free the memory of the components you add runtime, when you remove 
them from their containers, and when it comes to large-scale applications, this 
is a huge concern. The way my co-workers found to pass by it was to create a 
Javascript/Flex framework to allow Flex to load modules in separate HTML frames 
and provide communication between them. So, when a module gets out of scene, 
the browser frees the entire SWF. But this approach limits the user interaction 
like drag-n-drop support between modules. It's not natural. 

It seems that the browser may have a great part of the blame. They realized, 
for instance, that Internet Explorer releases the memory when the window is 
minimized and FireFox doesn't.

I'm here to ask what else can be done regarding memory issues. And how you 
professionals have dealt with it. 

Thanks

-- 
André Rodrigues Pena 

 


Re: [flexcoders] Re: AIR vs DLL vs. External code?

2007-08-25 Thread hank williams
 --- In flexcoders@yahoogroups.com, hank williams [EMAIL PROTECTED]
  wrote:
  
  
   So in your mind, Adobe's goal of being cross platform should be
   abandoned since there is no way to do cross-platform COM? Would you
   find it acceptable if it allowed you to do Mac only desktop stuff or
   does windows only compatible == desktop software?

  I think Adobe should provide hooks that allow extension, for instance
  by Java.  If it so happens that a third-party or homegrown extension
  *happens* not to be cross-platform, AIR itself will still be cross-
  platform.  It shouldn't be Adobe's business to enforce that
  everything that could ever be used by AIR would have to be cross-
  platform.

  For example, both Authorware and Director (Adobe's desktop
  application building programs) are both cross-platform but allow
  extension via Xtras and other means.  Not all of those Xtras are
  cross-platform, but developers still find them incredibly useful,
  either because they are only working on one platform or because they
  can work around the gap in some other way on the other platform.

You cant really compare AIR to authorware and director. These were
both very thinly deployed tools (compared to flash) and they never had
runtimes that were, essentially, built into the operating system (as
flash effectively is at 98% or 99%). The responsibility that adobe
shoulders in making tools that do things like seamlessly download,
auto update, etc and dont crash the system are substantial. They cant
afford to use their position to facilitate installation of 3rd party
DLLs that can easily crash the local system.

I think they may eventually add additional layers of access to the
system, but I doubt that they will ever go as far as you would like
because the responsibility is too great for a browser connected tool.
The good news is there are already so many alternatives if all you
really want to do is build an exe, such as Zinc, screenweaver hx, etc.
There is absolutely nothing standing in the way of making fully
functional exes. I am personally happy to trade full system level
access in return for having a pre-installed runtime that leverages the
seamless flash download and upgrade system.

Hank


Re: [flexcoders] Memory leaks - binding to e4x XML?

2007-08-25 Thread Scott - FastLane

Alex -

That is my posting, and I would hate for it to be misinformation in 
any way.  If your research turns up no evidence that I am correct then I 
will endeavor to re-create my problem in a sample application that I can 
send along to you for inspection.  If I cannot successfully demonstrate 
that binding to e4x is leaking memory I will be more than happy to 
withdraw my posting.  However, I should note, that I had a friend who 
was working on a similar application (datagrid bound directly to e4x)... 
knowing this I told him about my experiences.  He then added memory 
logging to his application.  Although his leak was less rapid than mine 
(he says with 1 minute refreshes he lost 1M or so per hour) he also saw 
the issue.  He then changed his application over to strongly typed 
objects and noted that his memory leak had also been resolved.  It was 
at this point that I decided to publish the post in case it might help 
others.


Scott

Alex Harui wrote:


I thought it was a performance issue only.  I do expect sealed classes 
to perform better than XMLLIstCollection (which does not convert to 
object). I'll have to investigate further.
 
Always frustrating when misinformation get out there...



*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Tracy Spratt

*Sent:* Saturday, August 25, 2007 11:47 AM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Memory leaks - binding to e4x XML?

I came across this article, wherein the author alleges that binding to 
e4x XML objects cause memory leaks:


http://blog.fastlanesw.com/?p=14 http://blog.fastlanesw.com/?p=14

His arguments / findings, seemed  well reasoned and supported, and I 
do not have the background to refute them.  Perhaps someone here might 
discuss this.


Tracy



*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Alex Harui

*Sent:* Saturday, August 25, 2007 2:21 PM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Memory leaks

There are two major memory usage scenarios in Flex.  One involves 
creating a new instance of a component, displaying, and later 
destroying it.  The other involves bringing in one or more classes of 
components in a module and trying to get rid of that module later when 
its classes are no longer needed.


Honestly, I don't know of any issues of the first kind at this point.  
A major problem with ViewStack related components was addressed in 
Hotfix2, and a DateField issue was either addressed in the same 
hotfix, or a workaround was provided and the issue fixed for Moxie.  A 
recent issue with Menus was fixed for Moxie and a workaround was 
provided.  I'm sure there are still issues out there, and they should 
be filed as bugs so we can investigate and fix them.  I also encourage 
you to try to isolate problems of this nature and post examples on 
this forum as often there can be a misunderstanding of how memory 
management works in Flash/Flex.


The second kind of issues is sort of a fact-of-life for Flex.  The 
first module to introduce shared code via Styles or Managers must 
remain in memory to serve all other code.  This has been explained on 
my blog.http://blogs.adobe.com/aharui/2007/03/modules.html.  The blog 
article includes an example of a way to deal with this situation, 
although often the easiest way is just to include all managers in the 
main app, and bring in styles via runtime CSS.


As you'll see in the article, browser memory management has little to 
do with it.  It simply has to do with how GC works (described further 
elsewhere on my blog) and how styles and singleton managers are 
shared.  Any memory changes when minimizing is probably due to IE 
releasing its own browser resources, although the player may release 
some at that time as well.


If you have further questions, this forum should be able to help you 
out.  In the future, please ask sooner before you spend time creating 
eloborate infrastructures.


-Alex



*From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
*On Behalf Of *André Rodrigues Pena

*Sent:* Saturday, August 25, 2007 10:44 AM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Memory leaks

Hi all,

It might be a well-known that Flex has several memory issues. It 
doesn't completely free the memory of the components you add runtime, 
when you remove them from their containers, and when it comes to 
large-scale applications, this is a huge concern. The way my 
co-workers found to pass by it was to create a Javascript/Flex 
framework to allow Flex to load modules in separate HTML frames and 
provide communication between them. So, when a module gets out of 
scene, the browser frees the entire SWF. But this approach limits the 
user interaction like drag-n-drop support 

Re: [flexcoders] Re: AIR vs DLL vs. External code?

2007-08-25 Thread Jeffry Houser

hank williams wrote:
 
 
So in your mind, Adobe's goal of being cross platform should be
abandoned since there is no way to do cross-platform COM? Would you
find it acceptable if it allowed you to do Mac only desktop stuff or
does windows only compatible == desktop software?
  
   I think Adobe should provide hooks that allow extension, for instance
   by Java. If it so happens that a third-party or homegrown extension
   *happens* not to be cross-platform, AIR itself will still be cross-
   platform. It shouldn't be Adobe's business to enforce that
   everything that could ever be used by AIR would have to be cross-
   platform.
  
   For example, both Authorware and Director (Adobe's desktop
   application building programs) are both cross-platform but allow
   extension via Xtras and other means. Not all of those Xtras are
   cross-platform, but developers still find them incredibly useful,
   either because they are only working on one platform or because they
   can work around the gap in some other way on the other platform.
 
 You cant really compare AIR to authorware and director. These were
 both very thinly deployed tools (compared to flash) 

  Shouldn't we be comparing them to AIR in this case?  I'd be willing to 
bet that AIR's deployment (at this stage) is very thinly deployed.  Yes, 
AIR has Flash Player embedded, but AIR != Flash

 I think they may eventually add additional layers of access to the
 system, but I doubt that they will ever go as far as you would like
 because the responsibility is too great for a browser connected tool.

  I wouldn't consider AIR a browser connected tool.  It does have an 
embedded browser, but...

  The ability to integrate with the local system (Via an execute type 
command) is almost mandatory for non-connected applications.  At this 
time, it does not appear that AIR fits that market very well (nor are 
they targeting the market.. )

  If you need to run DLLs / COM / etc... then AIR probably isn't a good 
choice.


-- 
Jeffry Houser, Technical Entrepreneur, Software Developer, Author, 
Recording Engineer
AIM: Reboog711  | Phone: 1-203-379-0773
--
My Company: http://www.dot-com-it.com
My Podcast: http://www.theflexshow.com
My Blog: http://www.jeffryhouser.com



Re: [flexcoders] Re: AIR vs DLL vs. External code?

2007-08-25 Thread hank williams
On 8/25/07, Jeffry Houser [EMAIL PROTECTED] wrote:







  hank williams wrote:
  
  
  So in your mind, Adobe's goal of being cross platform should be
  abandoned since there is no way to do cross-platform COM? Would you
  find it acceptable if it allowed you to do Mac only desktop stuff or
  does windows only compatible == desktop software?

 I think Adobe should provide hooks that allow extension, for instance
 by Java. If it so happens that a third-party or homegrown extension
 *happens* not to be cross-platform, AIR itself will still be cross-
 platform. It shouldn't be Adobe's business to enforce that
 everything that could ever be used by AIR would have to be cross-
 platform.

 For example, both Authorware and Director (Adobe's desktop
 application building programs) are both cross-platform but allow
 extension via Xtras and other means. Not all of those Xtras are
 cross-platform, but developers still find them incredibly useful,
 either because they are only working on one platform or because they
 can work around the gap in some other way on the other platform.
  
   You cant really compare AIR to authorware and director. These were
   both very thinly deployed tools (compared to flash)

  Shouldn't we be comparing them to AIR in this case?  I'd be willing to
  bet that AIR's deployment (at this stage) is very thinly deployed.  Yes,
  AIR has Flash Player embedded, but AIR != Flash


Actually, AIR uses special non publicly available pieces of the flash
platform to make installing totally seamless. When you click on an AIR
app to download, it it leverages this not publicly available stuff to
download the AIR runtime in the background. So they are leveraging the
presence of flash to facilitate the installation of the runtime. This
is a *big* deal and feels very different from downloading an exe in
explorer.  If it's not a big deal for your apps you can, as I said,
just use one of the many flash to exe projectors out there. Also,
Director and Authorware cant really be compared to AIR because neither
of them was based on a runtime separate from the application being
installed on the users computer. Being a completely self contained
download made it more appropriate to allow these tools to bring DLLs
or Xtras with them. Anything can be bundled in a stand-alone download,
but AIR apps are not exe's and are dependent on the AIR runtime. This
is a critical architectural difference.


   I think they may eventually add additional layers of access to the
   system, but I doubt that they will ever go as far as you would like
   because the responsibility is too great for a browser connected tool.

  I wouldn't consider AIR a browser connected tool.  It does have an
  embedded browser, but...

  The ability to integrate with the local system (Via an execute type
  command) is almost mandatory for non-connected applications.

It sounds like you are saying that there is no market for AIR. Based
on the general reaction from the developer community, I would have to
disagree. Of course perhaps you are just trying to say that given that
AIR's focus on occasionally connected applications, that there isnt
such a need for access to DLLs and such. If so I would whole heartedly
agree.

At this
  time, it does not appear that AIR fits that market very well (nor are
  they targeting the market.. )

  If you need to run DLLs / COM / etc... then AIR probably isn't a good
  choice.


This is clearly true.

Hank


RE: [flexcoders] Memory leaks - binding to e4x XML?

2007-08-25 Thread Alex Harui
Scott,
 
I don't doubt you saw what you saw, and everything you've posted could be true 
(naturally I hope it isn't cuz that'll mean we don't have a bug there).
 
My frustration comes from the following:
 
In your post you state that XMLListColleciton leaked less.  In theory, dumping 
e4x into a datagrid is the same as XMLLIstCollection since we just wrap the xml 
in a XMLListCollection.  You also state a theory that XMLListCollection convert 
xml to objects, which is misleading to post since it isn't quite true  These 
things make your whole post suspect.  You may in fact have some scenario where 
XMLListCollection behaves differently from straght e4x, but normally it 
shouldn't.
 
I often miss threads on FlexCoders since we're pretty busy and I was away for a 
couple of weeks, but did the memory leak aspect of this issue get discussed on 
this forum?  Is there a bug filed for this issue?  It might be in process and I 
haven't seen it yet.
 
Usually, these kinds of issues catch my attention.  I'm generally more than 
willing to squeeze some time out of my day to try to help with investigating 
things like this and love it when, once we figure out the issue, you post blog 
articles that help the community since it saves me time and makes one more 
person out there who can help others in similar situations.  However, I would 
much prefer to work with you before you post so we get the right information 
out there.  IMHO, memory usage is a trcky topic and easy to either misdiagnose, 
and/or offer up solutions/workarounds that either don't really work, or aren't 
optimal.
 
Sorry, if I ruffled feathers,
-Alex
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Scott - 
FastLane
Sent: Saturday, August 25, 2007 1:33 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Memory leaks - binding to e4x XML?



Alex - 

That is my posting, and I would hate for it to be misinformation in any way.  
If your research turns up no evidence that I am correct then I will endeavor to 
re-create my problem in a sample application that I can send along to you for 
inspection.  If I cannot successfully demonstrate that binding to e4x is 
leaking memory I will be more than happy to withdraw my posting.  However, I 
should note, that I had a friend who was working on a similar application 
(datagrid bound directly to e4x)... knowing this I told him about my 
experiences.  He then added memory logging to his application.  Although his 
leak was less rapid than mine (he says with 1 minute refreshes he lost 1M or so 
per hour) he also saw the issue.  He then changed his application over to 
strongly typed objects and noted that his memory leak had also been resolved.  
It was at this point that I decided to publish the post in case it might help 
others.

Scott

Alex Harui wrote: 



I thought it was a performance issue only.  I do expect sealed classes 
to perform better than XMLLIstCollection (which does not convert to object). 
I'll have to investigate further.
 
Always frustrating when misinformation get out there...



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Tracy Spratt
Sent: Saturday, August 25, 2007 11:47 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Memory leaks - binding to e4x XML?





I came across this article, wherein the author alleges that binding to 
e4x XML objects cause memory leaks:

http://blog.fastlanesw.com/?p=14 http://blog.fastlanesw.com/?p=14 



His arguments / findings, seemed  well reasoned and supported, and I do 
not have the background to refute them.  Perhaps someone here might discuss 
this.



Tracy







From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Alex Harui
Sent: Saturday, August 25, 2007 2:21 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Memory leaks



There are two major memory usage scenarios in Flex.  One involves 
creating a new instance of a component, displaying, and later destroying it.  
The other involves bringing in one or more classes of components in a module 
and trying to get rid of that module later when its classes are no longer 
needed.



Honestly, I don't know of any issues of the first kind at this point.  
A major problem with ViewStack related components was addressed in Hotfix2, and 
a DateField issue was either addressed in the same hotfix, or a workaround was 
provided and the issue fixed for Moxie.  A recent issue with Menus was fixed 
for Moxie and a workaround was provided.  I'm sure there are still issues out 
there, and they should be filed as bugs so we can investigate and fix them.  I 
also encourage you to try to isolate problems of 

[flexcoders] Re: DataGrid with labelfunction + POJO

2007-08-25 Thread simonjpalmer
what happens if you cast item to a FormasiFlex, e.g.

FormasiFlex(item).istansi;


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

 If i put one Alert to display ITEM, the value is : item : [object
FormasiFlex]
  
 This is the code i have using to see the value of the ITEM object:
 
 public function myInstansiNama(item:Object,
column:DataGridColumn):String
 { 
 Alert.show(item :  + item.toString()); 
 return item.toString();
 }
 
 In the attached file i send to you one screenshot, you will see my
problem.
 
 If someone can help me...thaks in advance.
 
 
 
 
 - Original Message 
 From: Jon Santos [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Thursday, August 23, 2007 8:13:04 PM
 Subject: Re: [flexcoders] Re: DataGrid with labelfunction + POJO
 
 My MXML file is like that :
  
 ?xml version=1.0 encoding=utf- 8?
 mx:Application xmlns:mx=http://www.adobe. com/2006/ mxml
layout=absolute xmlns:ns1=war.pruebas. * creationComplete=
ActivateEvents( )
 mx:Script
 ![CDATA[
 import bkn.pojo.InstansiPe merintah;
 import mx.core.IDataRender er;
 import mx.events.FlexEvent ;
 import mx.core.Container;
 import mx.controls. Alert;
 import mx.collections. ArrayCollection;
 import mx.containers. *;
 import mx.validators. NumberValidator;
 /* [Bindable]
 [RemoteClass( alias=bkn. pojo.JenisFormas i)]
 public class JenisFormasi
 {
 public var kode:String;
 public var deskripsi:String;
 } */
 private var AddOrEdit:String;
 private var DosActivated: Boolean = false;
 private function lihatTahun() :void
 {
 this.srv.getFormasi(this.txtTahun.text) ;
 }
 private function ActivateEvents( ):void
 {
 this.dos.addEventListen er(FlexEvent. CREATION_ COMPLETE, setValues) ;
 }
 private function setValues(e: FlexEvent) :void
 {
 this.AddEdit();
 } 
 private function ActionAdd():void
 {
 this.AddOrEdit = Add;
 this.vs.selectedChild = dos;
 if (this.DosActivated)
 {
 this.AddEdit();
 }
 }
 private function InsertFormasi ():void
 {
 }
 private function ActionEdit() :void
 {
 this.AddOrEdit = Edit;
 this.vs.selectedChild = dos; 
 if (this.DosActivated)
 {
 this.AddEdit();
 }
 }
 public function AddEdit():void
 {
 if (this.AddOrEdit != Edit) {
 this.myFormasi.tahun. text = ;
 this.myFormasi.jumlah. text = ;
 this.myFormasi.tanggalM enpan.text = ;
 this.myFormasi.Instansi Nama.text = ; 
 }
 else {
 this.myFormasi.tahun. text = this.dg.selectedItem. tahun;
 this.myFormasi.jumlah. text = this.dg.selectedItem. jumlah;
 this.myFormasi.tanggalM enpan.text = this.dg.selectedItem.
tanggalMenpan;
 this.myFormasi.Instansi Nama.text = this.dg.selectedItem. nomorMenpan; 
 }
 this.DosActivated = true;
 }
 public function ReturnToStart( ):void
 {
 this.vs.selectedChild = cero;
 }
 public function myLabelFunc( item:Object, column:DataGridColu
mn):String{
 return item[column. dataField] .toDateString( );
 //return item[column. datafield] .toDateString( );
 }
 //cliente seleccionado
 public function myInstansiNama( item:Object, column:DataGridColu
mn):String
 { 
 Alert.show(item.instansi :  + item.instansi) ; 
 return Jon;
 }
 ]]
 /mx:Script
 mx:RemoteObject id=srv showBusyCursor= true destination= pojo /
 mx:NumberValidator source={txtTahun} property=text
invalidCharError= This is not a number integerError= Masukan
Integer value
 minValue=1900 maxValue=2007 domain=int 
 trigger={btnLihatTahun} triggerEvent= click
 valid=lihatTahun( )/
 mx:ViewStack id=vs width=100% height=90% right=0 bottom=0
 mx:Canvas id=cero label=cero width=100% height=90%
 mx:TextInput width=46 top=31 id=txtTahun left=139/
 mx:Label text=Tahun Anggaran width=103 top=33 left=39/
 mx:Button id=btnLihatTahun label=Lihat top=31
icon=@Embed(source= '/war/icons/ camera_edit. png') left=193/
 mx:Label text=Jumlah Formasi width=103 left=39 top=59/
 mx:TextArea height=19 width=48 top=59 left=137/
 mx:DataGrid id=dg dataProvider= {srv.getFormasi. lastResult}
top=89 left=26 right=25 bottom=90 borderColor= #00
alternatingItemColo rs=[#f9fcb4, #d5ced3] cornerRadius= 10
borderStyle= solid
 mx:columns
 mx:DataGridColumn headerText=Tahun dataField=tahun width=60/
 mx:DataGridColumn headerText=Jumlah dataField=jumlah width=60/
 mx:DataGridColumn headerText=Instansi labelFunction=
myInstansiNama dataField=instansi width=160/
 mx:DataGridColumn headerText=Keputusan Menpan
dataField=nomorMenpan width=60/
 mx:DataGridColumn headerText=Tgl.Kep labelFunction= myLabelFunc
dataField=tanggalMenpan width=60/
 /mx:columns
 /mx:DataGrid
 mx:Button label=Lihat Data icon=@Embed(source= '/war/icons/
camera_edit. png') height=22 left=24 bottom=60/
 mx:Button label=Cari Instansi left=137 height=22 bottom=60/
 mx:Canvas height=42 bottom=10 backgroundColor= #FF
left=26 right=25
 mx:Button id=add label=Tambah width=78 borderColor= #FF
horizontalCenter= -150 bottom=10 click=ActionAdd( )/
 mx:Button id=edit y=10 label=Ubah width=78 borderColor=
#FF horizontalCenter= -46 click=ActionEdit( )/
 mx:Button y=10 label=Hapus width=78 borderColor= #FF

Re: [flexcoders] Re: AIR vs DLL vs. External code?

2007-08-25 Thread Jeffry Houser
hank williams wrote:
 
 
You cant really compare AIR to authorware and director. These were
both very thinly deployed tools (compared to flash)
  
   Shouldn't we be comparing them to AIR in this case? I'd be willing to
   bet that AIR's deployment (at this stage) is very thinly deployed. Yes,
   AIR has Flash Player embedded, but AIR != Flash
  
 
 Actually, AIR uses special non publicly available pieces of the flash
 platform to make installing totally seamless.   When you click on an AIR
 app to download, it it leverages this not publicly available stuff to
 download the AIR runtime in the background. 

  That all sounds like heresay to me, since right now you have to 
download and install the SDK separately before you can install an AIR app.

  I wonder about non-web based distribution?  It stated in an FAQ 
somewhere on the labs site that the SDK will be distributable for CD 
projects.  Obviously in such a situation you won't be going to the web.

   I wouldn't consider AIR a browser connected tool. It does have an
   embedded browser, but...
  
   The ability to integrate with the local system (Via an execute type
   command) is almost mandatory for non-connected applications.
 
 It sounds like you are saying that there is no market for AIR. 

  I'm saying that there is no market for AIR in non-connected desktop 
applications.

-- 
Jeffry Houser, Technical Entrepreneur, Software Developer, Author, 
Recording Engineer
AIM: Reboog711  | Phone: 1-203-379-0773
--
My Company: http://www.dot-com-it.com
My Podcast: http://www.theflexshow.com
My Blog: http://www.jeffryhouser.com



RE: [flexcoders] Help

2007-08-25 Thread Alex Harui
What did you change in the XML?



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Marcio Napoli
Sent: Wednesday, August 22, 2007 7:00 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Help



Hi All,

I am having problems with collection, when i change the value of one 
registry to a new value i lost the old one. For example:

[Bindable] private var DATAPACKET: XML = data 
row
date17/01/2007/date
eventEvent 01/event
userMARCOSA/user
/row
/data

((ICollectionView) (grid.dataProvider)).addEventListener
(CollectionEvent.COLLECTION_CHANGE, changeData);

public function changeData(event: CollectionEvent): void {
if (event.items.length  0) {
if (event.items[0] as PropertyChangeEvent) {
var pce: PropertyChangeEvent = event.items[0] as 
PropertyChangeEvent;
if (pce.kind == CollectionEventKind.UPDATE) {
trace(pce.source); 
trace
(pce.target); 
trace(pce.property); 
trace
(pce.oldValue); 
trace(pce.newValue);
trace(DATAPACKET.row[grid.selectedIndex]);
}
}
}
}

In my sample the attributes pce.oldValue and pce.newValue are 
null.
The pce.source is with new value and my var datapacket already 
updated.
So, how can i get the old value?

Thanks,
Marcio Napoli
[EMAIL PROTECTED] mailto:napoli%40stela.org.br