Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Christoffer Enedahl

Piers Cowburn skrev:

That way, if I forget to remove the event listener in a destroy method or 
whatever, it should still end up eligible for GC.

Cases where the event doesn't fire because a weak reference was used only 
happen if there are no strong references anywhere else, so the object rightly 
gets GC'd
  
One cannot be sure that the object get GC'd right away or at all. lets 
say you have a movieclip with a weak ENTER_FRAME listener on itself. the 
movieclips references are all removed. The ENTER_FRAME could still be 
dispatched, and is out of your control. However i think it's a good 
practice to use weak eventlisteners.


/Christoffer
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Cor
Oooh, OK, it is also the way I do it.
I didn't understand the difference between strong and weakly.

Not my native language, I am Dutch. 

Thanks for clearing it to me!



-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven Sacks
Sent: zondag 7 februari 2010 23:34
To: Flash Coders List
Subject: Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

function onComplete(event:Event):void
{
 event.target.removeEventListener(Event.COMPLETE, onComplete);
}

Easy peasy.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2673 - Release Date: 02/07/10
08:22:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] [JOB] e-Learning Programmer (Newport News, VA)

2010-02-07 Thread Charles Parcell
This is a job posting that we have currently open for a position in my
office. This person will be working directly with me.  Please pass this on
to anyone you may know with these skills or may know someone with these
skills.

The three skills that I think are most important are...

   1. Flash (ActionScript 2.0 and 3.0)
   2. JavaScript (JQuery or MOOTools are a plus)
   3. SCORM (any exposure is considered good but 2004 3rd Ed is what we use
   mostly)

Please send resumes to me at my work e-mail (charles.w.parcell at lmco.com)
so I can enter them into the HR database directly. FYI, I am not the hiring
manager for this position.

Here is the job information copied directly from the LM job web site. (
http://www.lockheedmartinjobs.com/jobsearch_all.asp)

=
Req ID146249BRIndustry Job TitleMultimedia Design EngrStandard Job
Code/TitleE1362:Multimedia Design EngrRequired skillsAbility to use HTML,
JavaScript, ASP, and other web technologies in the development of online
courseware. Ability to program in C+, C++ and C#. Flash development
experience and proven Action Script knowledge. Ability to develop SCORM and
Section 508 compliant courseware. Understanding of different types of LMSs,
to include Instructor Operator Station in Closed Classroom Environment.
Ability to work in propriety tool to create and edit courseware development
templates.Desired skillsWorking in courseware development teams and previous
experience developing to Army ATSC and Navy NKO standards strongly
desired.Specific
Job DescriptionThe position will support curriculum development (both
instructor-led training and distributed learning) in conjunction with
instructional designers in the development of animations, templates, and
other multimedia requirements. Candidate will work directly with
instructional designers to create new programming templates, in the
proprietary tool, to meet customer requirements. Programmer will be expected
to keep abreast of new software/technologies in developing programming needs
and multimedia, such as LMSs, SCORM, Flash, Action Script, and programming
languages.Standard Job DescriptionDesigns and develops multimedia
applications, systems and products involving computer graphics and
interactive computing such as computer-based systems for personal computers
or CD-ROM applications. Incorporates software applications in multiple
technology media systems, such as graphics, animation, text, and sound.Security
ClearanceNoneTypical MinimumsBachelors degree from an accredited college in
a related discipline, or equivalent experience/combined education, with 2
years of professional experience; or no experience required with a related
Masters degree. Considered experienced, but still a learner.LMCareers
Business UnitESS0806 SIMULATION TRAINING AND SUPTBusiness AreaElectronic
SystemsDepartmentR450:TSI Global CCD ExemptJob ClassInformation TechnologyJob
CategoryExperienced ProfessionalStateVirginiaRelocation AvailableNoReq Type
Full-Time
=

Charles P.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] hs_err_pid WAS: E4X, it's just not my day.

2010-02-07 Thread Dave Watts
> I seem to have a bigger problem now: I have a mysterious hs_err_pid12334.log 
> file that's been created next to my flp.  I've never
> seen this before, so I searched for it.  It's some sort of java runtime error 
> log, but I don't get why it would appear with Flash.  Flash
> now won't let me debug, not even a breakpoint on a one line Flash file.  
> Anyone seen this before?

If you're using Flex Builder, Flex Builder is an Eclipse plugin;
Eclipse is a Java application, and you can get HotSpot errors like the
one in your log file. You might try upgrading the JVM you're using
with Flex Builder, or editing the flexbuilder.ini file to fix the
specific problem indicated in the HotSpot error file.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsite.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Piers Cowburn
I use a strong listener only when I know I'm not holding a reference to the 
dispatcher anywhere else. In all other cases, i.e. if I know I'm going to be 
keeping the dispatcher on the display list (if it's a DisplayObject) until I no 
longer need it, or if I know I'm storing a reference the dispatcher somewhere 
in a parent class or a dictionary or something, I always use a weak reference. 
That way, if I forget to remove the event listener in a destroy method or 
whatever, it should still end up eligible for GC.

Cases where the event doesn't fire because a weak reference was used only 
happen if there are no strong references anywhere else, so the object rightly 
gets GC'd

Piers


On 7 Feb 2010, at 13:27, Cor wrote:

> Could you give an example of the way you use the strong listener?
> 
> TIA
> 
> -Original Message-
> From: flashcoders-boun...@chattyfig.figleaf.com
> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven Sacks
> Sent: zondag 7 februari 2010 4:32
> To: Flash Coders List
> Subject: Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?
> 
> function loadImage():void
> {
> var loader:URLLoader = new URLLoader();
> loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
> loader.load(new URLRequest(url));
> }
> function onComplete(event:Event):void
> {
> trace(event);
> }
> 
> Guess what never fires?  If you guessed "onComplete", you win the prize.
> 
> Now imagine that it defaulted to true and you wrote the same thing leaving
> off 
> the false, 0, true.  You would have no idea why it didn't work.
> 
> It didn't work because the loader was cleaned up by GC as soon as the 
> loadImage() function reached the end.
> 
> Generally, I only use weak listeners with Timers and enter frame listeners. 
> Everything else I use strong listeners and write a remove listener for them
> when 
> they're expected to unload or be garbage collected at some point.
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 9.0.733 / Virus Database: 271.1.1/2673 - Release Date: 02/07/10
> 08:22:00
> 
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Steven Sacks

function onComplete(event:Event):void
{
event.target.removeEventListener(Event.COMPLETE, onComplete);
}

Easy peasy.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] hs_err_pid WAS: E4X, it's just not my day.

2010-02-07 Thread Mendelsohn, Michael
Thanks for still thinking about this over the weekend Jason.  :-)  I've also 
been thinking about the aso files.  I deleted them and it didn't make much 
difference.

I seem to have a bigger problem now: I have a mysterious hs_err_pid12334.log 
file that's been created next to my flp.  I've never seen this before, so I 
searched for it.  It's some sort of java runtime error log, but I don't get why 
it would appear with Flash.  Flash now won't let me debug, not even a 
breakpoint on a one line Flash file.  Anyone seen this before?

There won't be any  E4X tinkering without my debugger...

- Michael M.



>> that can cause problems too if the .aso files.  

What I meant to type was , "that can cause problems too if the .aso
files have a timestamp inconsistency with the .as files."


Not sure if this is the problem but it never hurts to also try deleting
your .aso files as well, to be sure flash isn't trying to compile an old
file.  If it still seems to be doing this - check the timestamps on the
.as files - that can cause problems too if the .aso files.  Also, if you
have another .swf used in your project that uses the same class, that
can mean your project will use the other .swf's older version instead of
your new one.  If all else fails, see this:
http://stackoverflow.com/questions/2193953/flash-cs4-refuse-to-let-go  -
pretty humorous read.


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread wdb
Yes, I am doing the same because the trouble weak event listeners can
cause.

> function loadImage():void
> {
>  var loader:URLLoader = new URLLoader();
>  loader.addEventListener(Event.COMPLETE, onComplete, false, 0,
true);
>  loader.load(new URLRequest(url));
> }
> function onComplete(event:Event):void
> {
>  trace(event);
> }
> 
> Guess what never fires?  If you guessed "onComplete", you win the prize.
> 
> Now imagine that it defaulted to true and you wrote the same thing
leaving
> off 
> the false, 0, true.  You would have no idea why it didn't work.
> 
> It didn't work because the loader was cleaned up by GC as soon as the 
> loadImage() function reached the end.
> 
> Generally, I only use weak listeners with Timers and enter frame
> listeners. 
> Everything else I use strong listeners and write a remove listener for
> them when 
> they're expected to unload or be garbage collected at some point.
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Cor
Could you give an example of the way you use the strong listener?

TIA

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven Sacks
Sent: zondag 7 februari 2010 4:32
To: Flash Coders List
Subject: Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

function loadImage():void
{
 var loader:URLLoader = new URLLoader();
 loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
 loader.load(new URLRequest(url));
}
function onComplete(event:Event):void
{
 trace(event);
}

Guess what never fires?  If you guessed "onComplete", you win the prize.

Now imagine that it defaulted to true and you wrote the same thing leaving
off 
the false, 0, true.  You would have no idea why it didn't work.

It didn't work because the loader was cleaned up by GC as soon as the 
loadImage() function reached the end.

Generally, I only use weak listeners with Timers and enter frame listeners. 
Everything else I use strong listeners and write a remove listener for them
when 
they're expected to unload or be garbage collected at some point.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 9.0.733 / Virus Database: 271.1.1/2673 - Release Date: 02/07/10
08:22:00

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Re: is it ever ideal to NOT use weak references?

2010-02-07 Thread Henrik Andersson

Steven Sacks wrote:

Guess what never fires? If you guessed "onComplete", you win the prize.



You do realize that this is not guaranteed, right? It might not fire, 
but it may also do fire.

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders