[flexcoders] Looking for AS3 developer.

2009-06-16 Thread tom93438
HeyZap is looking for an AS3 developer to build a AS/flash wrapper that rotates 
through 3rd party external SWF files, solving issues with sizing, sound, 
keyboard/mouse controls. They dont want the Flex framework used, but a pure AS 
project compiled in FB is fine. Email for more details. 

This company is run by a friend of mine - please send replies to me, and I'll 
pass them on to him.

tom saffell



[flexcoders] Re: Closures in ActionScript 3?

2009-06-05 Thread tom93438
Just a shot in the dark here... I could be completely wrong, I dont use 
closures much in AS. 

Does AS3 have block scope? (I suspect not). If not, then you're recycling the 
variable 'input' each time you loop. So each time you add a new event listener 
to 'input', you're adding it to all your TextInput instances. Just a guess - 
I've never tried it..


--- In flexcoders@yahoogroups.com, Keith Hughitt keith.hugh...@... wrote:

 Could someone please explain to me how closures work in ActionScript? I
 am attempting to create a set of Flex Form fields, and assign an
 event-handler to each of them, however, it seems that after creation,
 all of the fields have the same event handler.
 
 For example:
 
 var i:int = 0;
for each (var item:Object in this._myItems) {
  var f:FormItem = new FormItem();
  f.label = item.header;
 
  var input:TextInput = new TextInput();
 
  // Setup event-handler
  var self:MyClass = this;
 
  input.addEventListener(change, function (e:Event):void
 {
  Alert.show(Event-hanlder #:  + String(i));
   });
 
  i++;
 
  // Add text input to FormItem
  f.addChild(input);
 
  // Save a reference to the form control
  item.ui = f;
  addChild(f);
  }
 
 So I would expect that the number displayed when I change any given
 field matched the order of the field on the screen. When I run the code,
 however, no matter which field I adjust, the number is always the same
 (it is the number of the last form item to be added).
 
 It appears that what is happening is that a single function is being
 created, and each input field has a reference to that same function.
 
 Any suggestions? Any help would be greatly appreciated.
 
 Thanks!
 Keith





[flexcoders] Re: Flash Speed test - RESULTS !

2009-05-13 Thread tom93438
Wow! The penchant for tangets here is staggering. 

@Tom Chiverton - there a few scenarios where someone would be wise to ask for a 
frame rate above 30 fps (but probably not none) - but that does not mean that 
information on how browsers react to Flash apps asking for frame rates 30 FPS 
is useless. The Flex SDK allows for the frame rate to be 'set' up to 1000 FPS 
(per the documentation) so there is some value in developers knowing how a 
browser reacts to that. The tests around 24 FPS are more interesting to me. 

tom

 

--- In flexcoders@yahoogroups.com, Paul Andrews p...@... wrote:

 That's the standard refresh rate for a lot of LCD monitors..
 
   - Original Message - 
   From: Thibaud Van Vreckem 
   To: flexcoders@yahoogroups.com 
   Sent: Wednesday, May 13, 2009 6:31 PM
   Subject: Re: [flexcoders] Flash Speed test - RESULTS !
 
 
 
 
   Why on earth would you have your monitor refresh rate at 30hz ?
 
 
   On Wed, May 13, 2009 at 10:42 AM, Tom Chiverton tom.chiver...@... wrote: 
 
 Why on earth would you need to generate more frames per second than the 
 monitor can display (i.e. around 30) ? 
 
 
 
 . 
 
 __,_.__





[flexcoders] Re: Flash speed test - please participate - only 1 click required !

2009-05-07 Thread tom93438
I'll send them out by the weekend. Warning now: they won't be statistically 
significant, I didnt get enough data.

Thanks to all who took part !

tom


--- In flexcoders@yahoogroups.com, Hyder hyder_...@... wrote:

 So where are the results?!
 
 --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote:
 
  LOL, I did exactly the opposite - dumped Norton for AVG!
  
  Looking at the page source, it has javascript scraping values from the 
  navigator object and no doubt sending them back to base.
  
  I can't see that it does anything else.
  
  Paul
  - Original Message - 
  From: Cato Paus cato1@
  To: flexcoders@yahoogroups.com
  Sent: Monday, April 13, 2009 12:16 PM
  Subject: [flexcoders] Re: Flash speed test - please participate - only 1 
  click required !
  
  
   After a hit, I did stop using the AVG.. and are now using Norton Internet 
   Security, it uses Insigth and is much faster then AVG ..
  
   here is the link to the Trojan 
   http://securityresponse.symantec.com/security_response/writeup.jsp?docid=2004-021914-2822-99
  
  
   --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote:
  
   How did you find the trojan Cato - AVG reports nothing.
  
   What trojan is it?
  
   Paul
   - Original Message - 
   From: Cato Paus cato1@
   To: flexcoders@yahoogroups.com
   Sent: Monday, April 13, 2009 11:58 AM
   Subject: [flexcoders] Re: Flash speed test - please participate - only 1
   click required !
  
  
DO NOT TEST THIS... Trojan Horse Detected on page!
   
   
   
   
   
   
--- In flexcoders@yahoogroups.com, tom93438 tcs2201@ wrote:
   
One other test that would also be useful:
Please hit:
   
http://flatim3000.appspot.com/?fps=24
   
Does the same as before, but tests for 24 fps.
   
thanks
   
tom
   
   
--- In flexcoders@yahoogroups.com, tom s tcs2201@ wrote:

 Hi All,

 I'm doing some tests to see how 'fast' the Flash Player is in a 
 variety
 of
 environments.
 Please click the link to take part: (you don't have to do anything
 other
 than click the link)

 http://flatim3000.appspot.com


 It's totally malware free. If you're interested, see below for 
 details.
 Please hit it as many times as you like, from as many different
 environments
 as you can :)
 I'll share the results when I'm done.

 cheers

 tom

 details
 =
 The SWF:
 1. attempts to set the frame rate to 1000
 2. listens for enter_frame 10,000 times
 3. records how long (2) takes
 4. computes the actual FPS
 5. send the data to a server, along with details on OS, Browser, FP
 version,
 IP

 Any suggestions/improvements - let me know...

   
   
   
   
   

   
--
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
   
   
   
  
  
  
  
  
   
  
   --
   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
  
  
  
 





[flexcoders] Re: Flash speed test - please participate - only 1 click required !

2009-04-13 Thread tom93438
Wow !

There is some serious paranoia here. This page does exactly what I described in 
my original email, and nothing more. I created it to learn something, which I 
plan on sharing back with this community. 

I've been posting to this list for a while, so I would sort of hope that there 
could be a little more trust. 

Feel free to inspect the page, etc. But everything you need to know is in my 
original post (at bottom of this email).

@Cato - I hope you realize that this kind of scare mongering will seriously 
diminish the number of testers, and hence the quality of the data that I will 
be able to share back with you all... :(

cheers

tom




--- In flexcoders@yahoogroups.com, Cato Paus ca...@... wrote:

 DO NOT TEST THIS... Trojan Horse Detected on page!
 
 
 
 
 
 
 --- In flexcoders@yahoogroups.com, tom93438 tcs2201@ wrote:
 
  One other test that would also be useful:
  Please hit:
  
  http://flatim3000.appspot.com/?fps=24 
  
  Does the same as before, but tests for 24 fps. 
  
  thanks
  
  tom
  
  
  --- In flexcoders@yahoogroups.com, tom s tcs2201@ wrote:
  
   Hi All,
   
   I'm doing some tests to see how 'fast' the Flash Player is in a variety of
   environments.
   Please click the link to take part: (you don't have to do anything other
   than click the link)
   
   http://flatim3000.appspot.com
   
   
   It's totally malware free. If you're interested, see below for details.
   Please hit it as many times as you like, from as many different 
   environments
   as you can :)
   I'll share the results when I'm done.
   
   cheers
   
   tom
   
   details
   =
   The SWF:
   1. attempts to set the frame rate to 1000
   2. listens for enter_frame 10,000 times
   3. records how long (2) takes
   4. computes the actual FPS
   5. send the data to a server, along with details on OS, Browser, FP 
   version,
   IP
   
   Any suggestions/improvements - let me know...
  
 





[flexcoders] Re: Flash speed test - please participate - only 1 click required !

2009-04-13 Thread tom93438
I don't know what Symantec is smoking, but we as developers all know how wrong 
software can be. I suspect it's objecting to the JS, which is lifted directly 
from an Adobe sample, which can be inspected here:

http://livedocs.adobe.com/flex/3/html/help.html?content=18_Client_System_Environment_7.html

If that's a trojan then I'll eat my hat. 

Please don't turn this thread into a discussion of anti virus software. Please 
let's stay on topic..

tom




--- In flexcoders@yahoogroups.com, Cato Paus ca...@... wrote:

 After a hit, I did stop using the AVG.. and are now using Norton Internet 
 Security, it uses Insigth and is much faster then AVG .. 
 
 here is the link to the Trojan 
 http://securityresponse.symantec.com/security_response/writeup.jsp?docid=2004-021914-2822-99
  
 
 
 --- In flexcoders@yahoogroups.com, Paul Andrews paul@ wrote:
 
  How did you find the trojan Cato - AVG reports nothing.
  
  What trojan is it?
  
  Paul
  - Original Message - 
  From: Cato Paus cato1@
  To: flexcoders@yahoogroups.com
  Sent: Monday, April 13, 2009 11:58 AM
  Subject: [flexcoders] Re: Flash speed test - please participate - only 1 
  click required !
  
  
   DO NOT TEST THIS... Trojan Horse Detected on page!
  
  
  
  
  
  
   --- In flexcoders@yahoogroups.com, tom93438 tcs2201@ wrote:
  
   One other test that would also be useful:
   Please hit:
  
   http://flatim3000.appspot.com/?fps=24
  
   Does the same as before, but tests for 24 fps.
  
   thanks
  
   tom
  
  
   --- In flexcoders@yahoogroups.com, tom s tcs2201@ wrote:
   
Hi All,
   
I'm doing some tests to see how 'fast' the Flash Player is in a 
variety 
of
environments.
Please click the link to take part: (you don't have to do anything 
other
than click the link)
   
http://flatim3000.appspot.com
   
   
It's totally malware free. If you're interested, see below for details.
Please hit it as many times as you like, from as many different 
environments
as you can :)
I'll share the results when I'm done.
   
cheers
   
tom
   
details
=
The SWF:
1. attempts to set the frame rate to 1000
2. listens for enter_frame 10,000 times
3. records how long (2) takes
4. computes the actual FPS
5. send the data to a server, along with details on OS, Browser, FP 
version,
IP
   
Any suggestions/improvements - let me know...
   
  
  
  
  
  
   
  
   --
   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
  
  
  
 





[flexcoders] Re: Flash speed test - please participate - only 1 click required !

2009-04-12 Thread tom93438
One other test that would also be useful:
Please hit:

http://flatim3000.appspot.com/?fps=24 

Does the same as before, but tests for 24 fps. 

thanks

tom


--- In flexcoders@yahoogroups.com, tom s tcs2...@... wrote:

 Hi All,
 
 I'm doing some tests to see how 'fast' the Flash Player is in a variety of
 environments.
 Please click the link to take part: (you don't have to do anything other
 than click the link)
 
 http://flatim3000.appspot.com
 
 
 It's totally malware free. If you're interested, see below for details.
 Please hit it as many times as you like, from as many different environments
 as you can :)
 I'll share the results when I'm done.
 
 cheers
 
 tom
 
 details
 =
 The SWF:
 1. attempts to set the frame rate to 1000
 2. listens for enter_frame 10,000 times
 3. records how long (2) takes
 4. computes the actual FPS
 5. send the data to a server, along with details on OS, Browser, FP version,
 IP
 
 Any suggestions/improvements - let me know...





[flexcoders] Re: is it possible to track visitors / the page an swf is embedded on

2009-02-18 Thread tom93438
 ...not the url of the document within which the app is embedded.
 For that, the only way is to use Javascript and ExternalInterface

If you're looking for the url in the browser address bar then look at
IBrowserManager:

http://livedocs.adobe.com/flex/3/langref/mx/managers/IBrowserManager.html

URL property is: 'The current URL as it appears in the browser address
bar.'

tom




--- In flexcoders@yahoogroups.com, Laurent Cozic pogopix...@... wrote:

 Application.application.url will give you the url of the *swf file*,
not the url of the document within which the app is embedded. For
that, the only way is to use Javascript and ExternalInterface. I think
the syntax is:
 
 var docURL = ExternalInterface.call(location.href);
 
 or it might be document.location.href - not sure which one is right.
 
 --
 Laurent Cozic
 
 Flash, Flex and Web Application development
 http://pogopixels.com
 
 --- On Wed, 2/18/09, kuntamayu kuntam...@... wrote:
 From: kuntamayu kuntam...@...
 Subject: [flexcoders] Re: is it possible to track visitors / the
page an swf is embedded on
 To: flexcoders@yahoogroups.com
 Date: Wednesday, February 18, 2009, 12:31 PM
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 Try to track
 
 
 
 Application. application. url
 
 
 
 This may help you. :)
 
 
 
 --- In flexcod...@yahoogro ups.com, Tracy Spratt tspratt@  wrote:
 
 
 
  Look into the BrowserManager, perhaps it will help.
 
  
 
   
 
  
 
  Tracy Spratt 
 
  Lariat Services 
 
  
 
  Flex development bandwidth available 
 
  
 
   _ _ __
 
  
 
  From: flexcod...@yahoogro ups.com [mailto:flexcod...@yahoogro
ups.com] 
 
 On
 
  Behalf Of uclamerrick
 
  Sent: Wednesday, February 18, 2009 12:24 AM
 
  To: flexcod...@yahoogro ups.com
 
  Subject: [flexcoders] is it possible to track visitors / the page an 
 
 swf
 
  is embedded on
 
  
 
   
 
  
 
  Lets say I run a video site like youtube, how can I capture the url 
 
 of
 
  the page where my swf object is embedded.
 
  
 
  For example someone takes the embed code from
 
  http://youtube. com/videoid123 http://youtube. com/videoid123  and
 
  places it onto the page at
 
  http://myblog. wordpress. com/this_ video_rocks
 
  http://myblog. wordpress. com/this_ video_rocks 
 
  
 
  I know how to use HTTPService to report this information back to my
 
  server and store it in the database, but I don't know how to use 
 
 Flex
 
  3 / Actionscript 3 to determine the URL of the page that embeds an
 
  swf. In the example above I would want to capture:
 
  
 
  http://myblog. wordpress. com/this_ video_rocks
 
  http://myblog. wordpress. com/this_ video_rocks 
 
  
 
  Thanks.
 
 





[flexcoders] Re: Using Python with Flex

2009-02-17 Thread tom93438
The pyamf.org (that has already been linked to) is great. 

An alternative (if you dont need the unserialized data server side) is
to use byteArray. I pasted below a very scrappy example of how to get
this working using Google App Engine (in python). Incidentally, the
same GAE had a pyamf example in it, which I have left, but which is
commented out. (The MXML/AS is first, then the python)

tom

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
creationComplete=initApp()

mx:Script
![CDATA[

import flash.net.*;
import flash.utils.*;

private var fileID:int

public function initApp():void{

var args1:Array = new Array
var args2:Array = new Array
var ba:ByteArray = new ByteArray

args1[0] = [1, 3, 10]
args1[1] = [4,3,3,4,5]
args2 = [0,1]   
ba.writeObject(args1);
ba.writeObject(args2);
trace(ba position:  + ba.position)
ba.position = 0;
trace(ba position:  + ba.position)
var args3:Array = ba.readObject();
trace(ba position:  + ba.position)
var args4:Array = ba.readObject();
trace(ba position:  + ba.position)
for each (var e:* in args3){
trace(args 1 :  + e)
}
for each (var f:* in args4){
trace(args 2:  + f)
}

fileID = 1002
var loader:URLLoader = new URLLoader();
var request:URLRequest = new
URLRequest(http://localhost:8080/byte?fileID=+fileID);
request.method = URLRequestMethod.POST
request.data = ba
request.contentType = 
'application/octet-stream';
loader.addEventListener(Event.COMPLETE, 
onWriteComplete);
configureListeners(loader);
loader.load(request)


}

private function getData():void{

var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY
var request:URLRequest = new
URLRequest(http://localhost:8080/byte?fileID=+fileID);
request.method = URLRequestMethod.GET
request.contentType = 
'application/octet-stream';
loader.addEventListener(Event.COMPLETE, onData);
configureListeners(loader);
loader.load(request)



}


private function 
configureListeners(dispatcher:IEventDispatcher):void {
//dispatcher.addEventListener(Event.COMPLETE,
completeHandler);
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS,
progressHandler);
   
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS,
httpStatusHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR,
ioErrorHandler);
}

private function onData(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
trace(completeHandler:  + loader.data);
trace(class: + getQualifiedClassName(loader.data))
trace(ba position:  + loader.data.position)
var b1:Array = loader.data.readObject()
for each (var b:* in b1){
trace(args :  + b)
}
trace(ba position:  + 

[flexcoders] Re: Warning: CheckVisibility is not a function ?

2009-01-20 Thread tom93438
Thanks Tracy and Clumpywheel (it's good to know I'm not alone..)

Is this causing you any problems?
Only in so much as I have gone from a situation where my flashlog is
100% useful trace statements and critical errors to a situation where
it is now 90% noise (and flash tracer's Display warnings control
seems not to work). :(

Call me a stickler maybe, but I like my warnings to be real and
noteworthy..:) If we ignore warnings then don't we just invite future
problems? (I'm an electronic engineer by training, and fairly new to
SW, so maybe I'm taking the wrong approach?)

Most importantly: is this the sort of thing that warrants a bug report
to Adobe? If so, I'll put one in.

cheers

tom
 

--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 Is this causing you any problems?  Warnings can often be ignored, and 
 this sounds like an issue in the framework.  In past versions of 
 flex, I have seen dozens of warnings from internal objects, but not 
 seen any of them result in a problem for my app.
 
 Tracy Spratt 
 Lariat Services 
 Flex development bandwidth available
 
 
 --- In flexcoders@yahoogroups.com, clumpywheel clumpywheel@ 
 wrote:
 
  I tried to reply to this earlier but it didn't show up.
  
  I have the exact same warnings in my flashlog and it's very 
 annoying.
   Flex 3, Flash 10, and it happens when I hit allow on the 
 microphone
  access box.
  
  --- In flexcoders@yahoogroups.com, tom93438 tcs2201@ wrote:
  
   Hi Erik, 
   
   That is the problem. I don't define or call it anywhere in my 
 code (to
   the best of my knowledge). I have searched my entire codebase for
   'CheckVisibilty' and it doesn't show up anywhere.
   
   I know this makes it a hard problem to diagnose..
   
   Any idea what might be wrong?
   
   thanks
   
   tom

   
   --- In flexcoders@yahoogroups.com, Thomas, Erik erik_thomas@ 
 wrote:
   
Can you share some source code where you define/call 
 CheckVisibilty?



From: flexcoders@yahoogroups.com
  [mailto:flexcod...@yahoogroups.com] On
Behalf Of tom93438
Sent: Friday, January 16, 2009 10:16 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Warning: CheckVisibility is not a 
 function ?



A few more bits of information to add:

This warning starts being generated immediately after 
 the 'Adobe Flash
Player Settings' box is closed (once the user selects 'Allow' OR
'Deny') for microphone / camera access. 
The warning is written continuously and indefinitely (or at 
 least,
until Flash Tracer reaches its warning limit). 

Any ideas how to make this warning go away?

thanks

tom

--- In flexcoders@yahoogroups.com
  mailto:flexcoders%40yahoogroups.com
, tom s tcs2201@ wrote:

 Hi,
 I have an application running in Flash Debug Player 10.0 r12 
 for
Firefox.
 It keeps writing 'Warning: CheckVisibility is not a function' 
 to the
 flashlog.txt
 I am running FF 3.0.5 and Flash Switcher.
 
 Any ideas what might be causing this?
 
 thanks
 
 tom

   
  
 





[flexcoders] Re: Warning: CheckVisibility is not a function ?

2009-01-16 Thread tom93438
A few more bits of information to add:

This warning starts being generated immediately after the 'Adobe Flash
Player Settings' box is closed (once the user selects 'Allow' OR
'Deny') for microphone / camera access.  
The warning is written continuously and indefinitely (or at least,
until Flash Tracer reaches its warning limit). 

Any ideas how to make this warning go away?

thanks

tom



--- In flexcoders@yahoogroups.com, tom s tcs2...@... wrote:

 Hi,
 I have an application running in Flash Debug Player 10.0 r12 for
Firefox.
 It keeps writing 'Warning: CheckVisibility is not a function' to the
 flashlog.txt
 I am running FF 3.0.5 and Flash Switcher.
 
 Any ideas what might be causing this?
 
 thanks
 
 tom





[flexcoders] Re: Warning: CheckVisibility is not a function ?

2009-01-16 Thread tom93438
Hi Erik, 

That is the problem. I don't define or call it anywhere in my code (to
the best of my knowledge). I have searched my entire codebase for
'CheckVisibilty' and it doesn't show up anywhere.

I know this makes it a hard problem to diagnose..

Any idea what might be wrong?

thanks

tom
 

--- In flexcoders@yahoogroups.com, Thomas, Erik erik_tho...@... wrote:

 Can you share some source code where you define/call CheckVisibilty?
 
 
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of tom93438
 Sent: Friday, January 16, 2009 10:16 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Warning: CheckVisibility is not a function ?
 
 
 
 A few more bits of information to add:
 
 This warning starts being generated immediately after the 'Adobe Flash
 Player Settings' box is closed (once the user selects 'Allow' OR
 'Deny') for microphone / camera access. 
 The warning is written continuously and indefinitely (or at least,
 until Flash Tracer reaches its warning limit). 
 
 Any ideas how to make this warning go away?
 
 thanks
 
 tom
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , tom s tcs2201@ wrote:
 
  Hi,
  I have an application running in Flash Debug Player 10.0 r12 for
 Firefox.
  It keeps writing 'Warning: CheckVisibility is not a function' to the
  flashlog.txt
  I am running FF 3.0.5 and Flash Switcher.
  
  Any ideas what might be causing this?
  
  thanks
  
  tom
 





[flexcoders] Re: How to get an object to delete itself?

2008-11-28 Thread tom93438
Thanks Paul and Haykel. 

That works (it removes the child from the display), but one curious
thing remains: 

When I uic.addChild then uic.numChildren increments by 1.
But when call this.owner.removeChild(this) then uic.numChildren does
not decrement by 1. 

(uic is my UIComponent to which I'm adding these graphics)

Is this behavior to be expected?

thanks

tom



--- In flexcoders@yahoogroups.com, Haykel BEN JEMIA [EMAIL PROTECTED]
wrote:

 Setting lifeTimer to null shouldn't be necessary as lifeTimer is a
private
 variable of DrawingTool and will not be referenced somewhere else
thus the
 references between DrawingTool and lifeTimer are circular and the
garbage
 collector handles these cases correctly (during the mark and sweep
 process).
 
 To remove the control from its parent's display list, you should use:
 this.parent.removeChild(this);
 
 Another method could be to dispatch an event when the timer fires,
listen
 for it in the parent and remove the control in the event handler.
 
 Yet another suggestion: You could also implement a
DrawingToolsManager which
 would create DrawingTool objects on demand, add them to a container and
 remove them when a timer event fires.
 
 
 Haykel Ben Jemia
 
 Allmas
 Web  RIA Development
 http://www.allmas-tn.com
 
 
 
 
 On Fri, Nov 28, 2008 at 12:25 PM, Paul Andrews [EMAIL PROTECTED] wrote:
 
 Tom,
 
  Setting alpha=0 won't make the object available for garbage
collection. If
  you don't want the oject any more you need to remove all
references to it.
  This will require that you remove it from the Display list and
remove any
  other references to it. You also need to remove the timer.
 
  So your destruct method needs (at least):
 
  this.owner.removeChild(this);   // remove this instance from the
parent
  container in the display list
  lifeTimer = null;  //remove the reference to it
 
  Paul
 
 
  - Original Message -
  *From:* tom s [EMAIL PROTECTED]
  *To:* flexcoders@yahoogroups.com
  *Sent:* Friday, November 28, 2008 11:08 AM
  *Subject:* [flexcoders] How to get an object to delete itself?
 
  I have custom class that extends UIComponent which I use for putting
  graphics on to the stage (I add them as children of a seperate
UIComponent).
  In the constructor I create a Timer and watch for the
TIMER_COMPLETE event,
  at which point I want the graphic to dissapear, which I do by
setting alpha
  = 0.
  However, I am concerned that it will not be garbage collected, and
I could
  end up with quite a few of these, which may be bad for memory.
 
  Question: Can i get the object to delete itself? (or atleast be in
a state
  suitable for grabage collection)
 
  e.g. this.selfDestruct() ;)
 
  The relevant code is shown below.
 
  thanks
 
  tom
 
 
  *
 
  public
  **class* DrawingTool *extends* UIComponent
 
  {
 
  *private* *var* lifeTimer:Timer = *new* Timer(8000,1);
 
   *public* *function* DrawingTool():*void*{
 
  *super*();
 
  lifeTimer.addEventListener(TimerEvent.TIMER_COMPLETE,onLifeTimer);
 
  lifeTimer.start();
 
  }
 
 
 
  *private* *function* onLifeTimer(e:Event):*void*{
 
  *this*.alpha = 0
 
  *trace*(*time out*);
 
  }
 
  }