Re: [Flashcoders] Text area focus

2010-06-30 Thread Karl DeSaulniers
Just an update, I found that Safari has a nice resource tracking  
feature on it that helps with evaluating performance of your website  
and all the elements in it. separately even.
You can right click on a site and in the menu you should have  
inspect element. A bottom window will raise up with all the info  
you need. Well.. almost all.

You can track load times, view scripts and css and many other things.

Hope that helps someone like it did me.

Best,

Karl


On Jun 17, 2010, at 9:50 AM, Juan Pablo Califano wrote:

Karl, I'm not sure how to benchmark memory in AS 2. I think that  
what you

might want to benchmark here is cpu performance, anyway.

In this particular case, I don't think you can benchmark much, though.
Basically, all performance benchmarks I've seen are based on  
getTimer (two
simple calls to getTimer, one before running the code you're  
interested in,
and one after; the difference is very roughly how much your code  
took to
run; there are more sophisticated suites (like Grant Skinner's),  
but to my

knowledge, all are based on the same principle).

The problem here is that what seems to be taking too long is an  
internal
mechanism of the player (managing and dispatching onChanged, for  
instance).

Can't think of a way of timing that off the top of my head.

If one the methods runs your fan wild and the other one doesn't,  
though, you

have a clear winner already!

Cheers
Juan Pablo Califano


2010/6/16 Karl DeSaulniers k...@designdrumm.com


On that note, what would be a good way to get a benchmark for this?
Any pointers?

Karl


On Jun 16, 2010, at 3:47 PM, Karl DeSaulniers wrote:

Ahh.. let me try that.

I am sure you are correct.
That way it only checks to see if that textField is changing when  
focus is

on it.
And being that onChanged was less memory intensive than onEnterFrame
that makes sense. But my tests are not finite.
I do not have a benchmark result or anything stating
how much memory my swf is using while in the browser.
But it would seem the onSetFocus/onKillFocus keeps any extra  
memory from

being used in either case.
Thanks again Juan.


Karl


On Jun 16, 2010, at 8:09 AM, Juan Pablo Califano wrote:

Not really. In theory, onChanged should be less intensive, I  
think. But,

from your description it seems it isn't, so go figure...

I'd go with the onSetFocus / onKillFocus then, but I'd do  
another test,

just
out of curiosity. Instead of setting an enterframe when you get  
focus and
nulling it when focus is lost, what happens is you use the  
onChanged

event
instead?

I mean, something like:

textbox.onSetFocus = function() {
  textbox.onChanged = etc...;
};
textbox.onKillFocus = function() {
  textbox.onChanged = null;
}
Cheers
Juan Pablo Califano

2010/6/16 Karl DeSaulniers k...@designdrumm.com

Hi Juan,
Interesting enough, it seems your solution also runs my fan a  
bit wild

too.
Not as bad, I'd say about half as much.
I know its the form because I have tested many times. Every  
time I close
the browser window that has the form, my fan slows to a stop  
almost

immediately.
I chose the onFocus mainly because I knew that it was the  
onEnterFrame

that
was taking up memory, so I wanted it to fire only when someone was
typing.
It looks like my suggestion does just that. The fan never kicks  
on.


My purpose for this is to set up a flash site that takes little  
to no

memory usage.
Am I right in assuming that this is memory usage by the code  
that makes

my
fan kick in.
I've been nulling any onEnterFrames, removing listeners, etc.
Any thoughts as to why the onChanged eats memory too?
TIA

Karl


On Jun 15, 2010, at 9:56 PM, Juan Pablo Califano wrote:

 It seems like you don't really need to bother about gaining or  
losing



focus
here. Just listening to the change event will do the job and  
you could

remove the enter_frame.


commentxt_mc.onChanged = function(tf:TextField):Void {
 var numChar:Number = 650 - tf.length;
 if (numChar == 0) {
 maxChar = Max Characters Reached;
 } else {
 maxChar = Max Char:  + numChar.toString(); //Have
another
text box with the var maxChar to display the results while  
typing.

 }
};

The equivalent in AS 3.0 is very similar, though a bit more  
verbose (as

usual!):

commentxt_mc.addEventListener(Event.CHANGE,handleTextChange);

function handleTextChange(e:Event):void {
var tf:TextField = e.target as TextField;
if(!tf) {
return;
}
var numChar:Number = 650 - tf.length;
var maxChar:String = ;
if (numChar == 0) {
maxChar = Max Characters Reached;
} else {
maxChar = Max Char:  + numChar.toString(); //Have another  
text box

with
the var maxChar to display the results while typing.
}
}

Cheers
Juan Pablo Califano

2010/6/15 Karl DeSaulniers k...@designdrumm.com

PERFECTO!



Thanks Amol,

For anyone who might want this. I have made a script that  
will read

the
length of a text field and display the number of characters  
left while

someone was typing.
The reason for the code 

[Flashcoders] Flash - Django interaction

2010-06-30 Thread Paul Andrews
I'm working on a project where my flash UI needs to interact with a 
server running django. I'm not going to do the django work and normally 
i'd just suggest a simple http service endpoint using a single URL with 
a command pattern returning XML results. Apparently this isn't the usual 
django interaction.


Any pointers?

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


RE: [Flashcoders] Flash - Django interaction

2010-06-30 Thread David Hunter

Hi there,I work with guys who build all their CMS using python and django and 
their preferred method is to send everything as JSON format. There is a JSON 
decoder in the AS3 core lib ( http://code.google.com/p/as3corelib/ ) to help 
extract the data which I use. Its always me receiving data from them although 
we are looking at a project where I would send them data, but we haven't 
discussed the technicalities much.
Hope that is of some help,
David

 Date: Wed, 30 Jun 2010 11:20:05 +0100
 From: p...@ipauland.com
 To: flashcoders@chattyfig.figleaf.com
 Subject: [Flashcoders] Flash - Django interaction
 
 I'm working on a project where my flash UI needs to interact with a 
 server running django. I'm not going to do the django work and normally 
 i'd just suggest a simple http service endpoint using a single URL with 
 a command pattern returning XML results. Apparently this isn't the usual 
 django interaction.
 
 Any pointers?
 
 Paul
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
_
http://clk.atdmt.com/UKM/go/19780/direct/01/
Do you have a story that started on Hotmail? Tell us 
now___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Flash - Django interaction

2010-06-30 Thread Paul Andrews

On 30/06/2010 11:50, David Hunter wrote:

Hi there,I work with guys who build all their CMS using python and django and 
their preferred method is to send everything as JSON format. There is a JSON 
decoder in the AS3 core lib ( http://code.google.com/p/as3corelib/ ) to help 
extract the data which I use. Its always me receiving data from them although 
we are looking at a project where I would send them data, but we haven't 
discussed the technicalities much.
Hope that is of some help,
David
   


Thanks  david, though it looks like the traditional http service URL is 
going to be OK after all.


Paul


Date: Wed, 30 Jun 2010 11:20:05 +0100
From: p...@ipauland.com
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Flash - Django interaction

I'm working on a project where my flash UI needs to interact with a
server running django. I'm not going to do the django work and normally
i'd just suggest a simple http service endpoint using a single URL with
a command pattern returning XML results. Apparently this isn't the usual
django interaction.

Any pointers?

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


_
http://clk.atdmt.com/UKM/go/19780/direct/01/
Do you have a story that started on Hotmail? Tell us 
now___
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


[Flashcoders] Adding listener

2010-06-30 Thread Lehr, Theodore
Is it possible to add a listener to a multitude of mcs through a loop? so 
instead of

mc1.addEventListener
mc2.add
mc3.add
...
...
..

maybe I have an array with each mc name and then loop through it to add the 
event listeners?

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


RE: [Flashcoders] Adding listener

2010-06-30 Thread Merrill, Jason
Easy:

var myMovieClips:Array = [mc1, mc2, mc3, mc4];

for each (var mc:MovieClip in myMovieClips)
{
mc.addEventListener(WhateverEvent.WHATEVER, onWhateverEvent);
}


Jason Merrill 

Instructional Technology Architect
Bank of America   Global Learning 

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Wednesday, June 30, 2010 10:36 AM
To: Flash Coders List
Subject: [Flashcoders] Adding listener

Is it possible to add a listener to a multitude of mcs through a loop?
so instead of

mc1.addEventListener
mc2.add
mc3.add
...
...
..

maybe I have an array with each mc name and then loop through it to add
the event listeners?

___
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] Adding listener

2010-06-30 Thread Lehr, Theodore
These are mcs that are created on the stage - not in code How would I refer 
to them in this:

var myMovieClips:Array = [mc1, mc2, mc3, mc4];

??


From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason 
[jason.merr...@bankofamerica.com]
Sent: Wednesday, June 30, 2010 10:45 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Adding listener

Easy:

var myMovieClips:Array = [mc1, mc2, mc3, mc4];

for each (var mc:MovieClip in myMovieClips)
{
mc.addEventListener(WhateverEvent.WHATEVER, onWhateverEvent);
}


Jason Merrill

Instructional Technology Architect
Bank of America   Global Learning

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Wednesday, June 30, 2010 10:36 AM
To: Flash Coders List
Subject: [Flashcoders] Adding listener

Is it possible to add a listener to a multitude of mcs through a loop?
so instead of

mc1.addEventListener
mc2.add
mc3.add
...
...
..

maybe I have an array with each mc name and then loop through it to add
the event listeners?

___
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
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Adding listener

2010-06-30 Thread Lehr, Theodore
nevermind - user error


From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason 
[jason.merr...@bankofamerica.com]
Sent: Wednesday, June 30, 2010 10:45 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Adding listener

Easy:

var myMovieClips:Array = [mc1, mc2, mc3, mc4];

for each (var mc:MovieClip in myMovieClips)
{
mc.addEventListener(WhateverEvent.WHATEVER, onWhateverEvent);
}


Jason Merrill

Instructional Technology Architect
Bank of America   Global Learning

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Wednesday, June 30, 2010 10:36 AM
To: Flash Coders List
Subject: [Flashcoders] Adding listener

Is it possible to add a listener to a multitude of mcs through a loop?
so instead of

mc1.addEventListener
mc2.add
mc3.add
...
...
..

maybe I have an array with each mc name and then loop through it to add
the event listeners?

___
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
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Adding listener

2010-06-30 Thread Henrik Andersson
Yes, just use the dynamic property syntax if it is timeline instances. 
Otherwise, just add the listener when you create each object.

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


RE: [Flashcoders] Adding listener

2010-06-30 Thread Merrill, Jason
On the stage, give them instance names in the property inspector and
then put those names into the array.


Jason Merrill 

Instructional Technology Architect
Bank of America   Global Learning 

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Wednesday, June 30, 2010 11:20 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Adding listener

These are mcs that are created on the stage - not in code How would
I refer to them in this:

var myMovieClips:Array = [mc1, mc2, mc3, mc4];

??


From: flashcoders-boun...@chattyfig.figleaf.com
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Merrill, Jason
[jason.merr...@bankofamerica.com]
Sent: Wednesday, June 30, 2010 10:45 AM
To: Flash Coders List
Subject: RE: [Flashcoders] Adding listener

Easy:

var myMovieClips:Array = [mc1, mc2, mc3, mc4];

for each (var mc:MovieClip in myMovieClips) {
mc.addEventListener(WhateverEvent.WHATEVER, onWhateverEvent); }


Jason Merrill

Instructional Technology Architect
Bank of America   Global Learning

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)





-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Wednesday, June 30, 2010 10:36 AM
To: Flash Coders List
Subject: [Flashcoders] Adding listener

Is it possible to add a listener to a multitude of mcs through a loop?
so instead of

mc1.addEventListener
mc2.add
mc3.add
...
...
..

maybe I have an array with each mc name and then loop through it to add
the event listeners?

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


[Flashcoders] as/papervision3D question

2010-06-30 Thread DONALD TALCOTT
I have a 3D portfolio built with papervision that works great. It opens with a 
category image (cube). On mouseOVER, a matrix of thumbnail images 
(categoryClicked) opens.

I would like to have the gallery of thumbnails open automatically without a 
mouseEvent. I've tried using a TimerEvent and EnterFrame with no luck.
Any ideas?

Thanks. 

code section:



env.scene.addChild(cube);
// interactive

cube.addEventListener(InteractiveScene3DEvent.OBJECT_OVER, categoryClicked, 
false, 0, true);


// loaded complete
if (++count == totalCategory)
{
// hide preloader
loadText0.visible = false;
// fade in viewport and move camera
dLayer.activate(true);
//addChild(goFull);
TweenMax.to(env.viewport, 2, { alpha:1, 
startAt: { alpha:0 } });
TweenMax.to(env.camera, 2, {x:0, 
y:0, z: -env.camera.zoom * env.camera.focus, ease:Quint.easeOut});
TweenMax.to(this, 0, {  
delay:1, 

onComplete:function():void

{

// start looking around

PV3DShortcut.startLookAroundStyle2(env, 
configObject.lookAroundDelta);

dLayer.deactivate();

}
});
env.startRendering();
}
}
}

// Category Interactive
private function categoryClicked(e:InteractiveScene3DEvent):void
{
if (gridMode) return;
env.keepRendering = true;
cCategory = Cube(e.target);
// fade out other cube
var i:Number;
var c:Cube;
for (i = 0; i  totalCategory; i++)
{
c = Cube(env.scene.getChildByName(category + 
i));
if (i != e.target.extra.index)
{
TweenMax.to(c, 0.75, { scale:0, 
ease:Quint.easeOut, visible:false } );
}
}
// move selected cube to center
TweenMax.to(e.target, 1, { x:0, ease:Quint.easeOut } );
// rotate cube - start load or display asset
rotateCube = new TweenMax(e.target, 5, { delay:0.5, 
rotationY:360, loop:0, ease:Linear.easeNone } );
currentCategory = e.target.extra.index;
dLayer.activate(true);
//addChild(goFull);
// load asset or display
if (!category[currentCategory].assetLoaded) 
loadCategoryAsset(); 
else 
{
maxPage = 
Math.floor(category[currentCategory].TOTAL / 
category[currentCategory].matrix.num) + (category[currentCategory].TOTAL % 
category[currentCategory].matrix.num != 0);
displayCategoryAsset();
}
}

DON TALCOTT

404.538.1642
dtalc...@mindspring.com




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


[Flashcoders] setChildIndex

2010-06-30 Thread Lehr, Theodore
How can I change depths of a movie - I found setChildIndex - but they are not 
children of anything...

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


Re: [Flashcoders] setChildIndex

2010-06-30 Thread Henrik Andersson

Yes. they are. They are childs on multiple levels.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] setChildIndex

2010-06-30 Thread Eric E. Dolecki
They would be a child of the DisplayList, no? ie. stage (this) potentially.

On Wed, Jun 30, 2010 at 4:04 PM, Lehr, Theodore
ted_l...@federal.dell.comwrote:

 How can I change depths of a movie - I found setChildIndex - but they are
 not children of anything...

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




-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] setChildIndex

2010-06-30 Thread Merrill, Jason
Doing addChild() in the right order is the easiest way, but to control
depths specifically, see this:

http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/disp
lay/DisplayObjectContainer.html#setChildIndex()



Jason Merrill 

Instructional Technology Architect
Bank of America   Global Learning 

Join the Bank of America Flash Platform Community  and visit our
Instructional Technology Design Blog
(Note: these resources are only available for Bank of America
associates)






-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr,
Theodore
Sent: Wednesday, June 30, 2010 4:05 PM
To: Flash Coders List
Subject: [Flashcoders] setChildIndex

How can I change depths of a movie - I found setChildIndex - but they
are not children of anything...

___
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