RE: [Flashcoders] Object Detection AS3

2007-07-19 Thread Douglas Pearson
If you want to check first whether the object is on the display list you can
use the contains method of DisplayObjectContainer:

// Won't throw any errors
if (myObject != null  parent.contains(myObject))
   parent.removeChild(myObject)

Doug

-Original Message-
From: Michael Trim [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 19, 2007 9:08 AM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] Object Detection AS3

Thanks for the solution, that's neat. Agree that try-catch is not an ideal
solution (but thank you too Sunil).

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Johannes Nel
Sent: 19 July 2007 16:40
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Object Detection AS3

it should be fine, but i come from a background where catching an error is
not considered a sollution.
its an error and you should deal with it, not a very real and potential use
case

On 7/19/07, Sunil Jolly [EMAIL PROTECTED] wrote:

 If you use the try, catch method that shouldn't be a problem.

 ---
 try {
 removeChild(myObject);
 } catch (e:Error) {
 //object doesn't exist as a child, do nothing }
 -

 That should fail unless myObject has been added to the stage.

 Or am I missing something here?

 Sunil


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
Johannes
 Nel
 Sent: 19 July 2007 15:40
 To: flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] Object Detection AS3

 the problem with your approach is that if the object does exist but is 
 not on the display tree it will fail


 On 7/19/07, Sunil Jolly [EMAIL PROTECTED] wrote:
 
 
  This works for me:
 
  -
 
  var myObject:Object;
 
  if (myObject) {
  removeChild(myObject);
  }
 
  ---
 
  Another method would be to catch the error:
 
  -
 
  try {
  removeChild(myObject);
  } catch (e:Error) {
  //do nothing
  }
 
  --
 
  Or you can compare it to null:
 
  --
 
  if (myObject != null) {
  removeChild(myObject);
  }
 
  --
 
  Sunil
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
 Michael
  Trim
  Sent: 19 July 2007 13:58
  To: flashcoders@chattyfig.figleaf.com
  Subject: [Flashcoders] Object Detection AS3
 
  Hi Flashcoders,
 
  Learning AS3 in the deep end at the moment, so excuse the questions
if
  too newb for this list.
 
  In AS2 I may have done something like the following.
 
  _1___
 
  if(myObject){
 
  myObject.removeMovieClip();
 
  }
 
  this.attachMovie(MyObject,myObject,1);
  _
 
 
  What would similar code look like in AS3? As
 
 
  _2
 
  removeChild(myObject);
  _
 
  fails if myObject doesn't exist yet as does
 
 
  _3___
 
  if(myObject)
  _
 
  Which I don't think you can do anyway?
 
  It's the last one I'm really interested in, how do you detect if 
  something exists?
 
  Thanks
 
  Michael
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training 
  http://www.figleaf.com http://training.figleaf.com 
  ___
  Flashcoders@chattyfig.figleaf.com
  To change your subscription options or search the archive:
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
  Brought to you by Fig Leaf Software
  Premier Authorized Adobe Consulting and Training 
  http://www.figleaf.com http://training.figleaf.com
 



 --
 j:pn
 http://www.memorphic.com/news/
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training 
 http://www.figleaf.com http://training.figleaf.com 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training 
 http://www.figleaf.com http://training.figleaf.com




-- 
j:pn
http://www.memorphic.com/news/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:

[Flashcoders] RE: obfuscation swf !

2007-07-18 Thread Douglas Pearson
Since we're talking about obfuscation/encryption does anyone know of a tool
that works for AS3 yet?

All the standard tools seem to stop with Flash 8/AS2.

Doug

-Original Message-
From: Sunil Jolly [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 18, 2007 2:09 AM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] RE: obfuscation swf !

I agree with JC that it wasn't really necessary to be quite so spiteful
about defeating his code.

I think the problem may have come from a here's my solution, try and break
it attitude instead of simply giving details of how it (was supposed to)
work.

Everyone here shares their knowledge to help other people, where in this
case it didn't seem like it.

As far as I know, any flash file (.swf) is downloaded to a client's computer
to be played, so its impossible to stop people from downloading your swf
files.

Sunil

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hans Wichman
Sent: 18 July 2007 05:56
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] RE: obfuscation swf !

Hi,
I might be wrong but like Bart said, I think SWFEncrypt does all this
already. At least I haven't had any problems with this andits fast too AND
usable from a build file. But I'm sure some of you will be able to crack it.

What I do have problems with is the attitude displayed towards Jimbo by some
of the responders for trying to come up with a nice and easy solution, even
it isn't foolproof. Putting a donkey sign over someones head is less than
motivating. He offered us a challenge, some of us took it and won. No need
to get all nasty about it imo.

greetz
JC




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Automated test tools?

2007-06-12 Thread Douglas Pearson
Can anyone recommend any good automated test tools for Flash?

Thanks,

Doug

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] AS3 Mouse suggestions?

2007-05-17 Thread Douglas Pearson
How about

if (not blocked by mushroom)
 playerSpeedX = this.mouseX - previousX ;
else
 playerSpeedX = 0 ;

thisPlayer.x += playerSpeedX ;

Same for playerSpeedY.  This should behave like #1 in the open field and #2
when you run into a mushroom.

Not blocked by mushroom would be something like looking to the left/right
of previousX depending on where the mouse is now.

Doug

-Original Message-
From: Martin Scott Goldberg [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 17, 2007 2:39 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] AS3 Mouse suggestions?

Hey all, back again. 

I'm doing a remake of centipede, and am looking for suggestion on the mouse
tracking routine (in as3).

The enivronment:  The player is of course at the bottom of the screen, and
can only move up a specific distance.  He may be blocked by mushrooms in
this area as well.

Speficially, I have two ways of player motion with the mouse I've tried and
neither one is 100% accurate:

1) Set the player graphic equal to the mouse reading:


   thePlayer.x = this.mouseX;
   thePlayer.y = this.mouseY;

   This is the same as thePlayer.startDrag(), just chose to go this route.
   Player tracks the mouse motion perfectly this way of course.
   Then the code checks for mushroom collision, which stops the player
   motion.

   The issue I'm having is, whenever the player comes in contact with
   a mushroom in the lower player movement area, it's supposed to stop
   dead, forcing the player to move around it.  With this method though,
   it stops for a second, but then skips over the mushroom once the mouse
   moves past it.  Likewise, it creates a sticking at the upper, lower
   right, and left boundries since it sits there until the mouse enters
   back in to the player zone.

2) Record previous mouse motion in x and y, and compare it to current.  If
   its moving right, move the player right 1 place.  Mouse moving left,
   moving player left one space, etc.:

   if (previousMouseX  this.mouseX)
   {
thePlayer.x += playerSpeed;
   }
   else
   {
thePlayer.x -= playerSpeed;
   }

   And similar for y direction.  Now, this code works perfect with the
   mushroom obstruction dectection.  But I'm having the opposite issue
   from the first code: The mouse tracking makes it harder to move in a 
   straight line, and the mouse moves out of the stage very quickly,
   being out of proportion to the rate of the player motion.  Upping the
   playerSpeed of course doesn't help, that just makes the player graphic
   jump around to quick.

If anyone on this list that's played around with these types of issues
before has an suggestions, I'd greatly appreciate it.



Marty


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] How to call a global method like trace--not the class method?

2007-04-28 Thread Douglas Pearson
We have a class used in a lot of code that has a trace method in it:
 
class Debug {
public function trace(str:String):void { .. }
}
 
Now we'd like to call the regular trace method from within that class, but
all of our efforts call to the class's trace method.
 
In C++ you use :: to indicate a global method so it would be ::trace().
 
Is there anyway to do something similar in ActionScript?  Obviously, we
could rename our method to something else but that would mean changing a lot
of existing code.
 
Thanks,
 
Doug
 
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Javascript SetVariable -- when does Flash seethechange?

2007-04-25 Thread Douglas Pearson
Thanks JD.   That helps to explain the behavior we're seeing.

Doug

-Original Message-
From: John Dowdell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 24, 2007 10:33 PM
To: flashcoders@chattyfig.figleaf.com; flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] Javascript SetVariable -- when does Flash
seethechange?

The browser is a big variable in latency of message-passing. You can confirm
that many SWF will run at different rates in different browsers. The
NPRuntime API is now implemented pretty well in today's popular browsers,
but the size and timing of permissible messages may vary among
implementations.
http://www.mozilla.org/projects/plugins/npruntime.html

In this case, though, it looks like you're using the old javascript:
pseudo-URL, and then polling immediately for a result. It may be better to
wait a frame or two, or an interval, before checking whether the
plugin-to-browser and browser-to-plugin communication cycles have finished.
I don't know how many browsers would stop the plugin's execution during the
attempted cross-app communication.

jd/adobe


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Javascript SetVariable -- when does Flash see the change?

2007-04-24 Thread Douglas Pearson
We have a piece of JavaScript like this:

swf.SetVariable(_level1.myvar,myvalue) ;

This JS code is triggered by a piece of Flash code that is executed when the
SWF loads.  However, it appears that the variable is not immediately set:

// Called at load time for the SWF
getURL(javascript:doSet()) ;
trace(_level1.myvar);// Reports nothing

But waiting and tracing the variable's value later seems to work:

this.onEnterFrame = function() {
   trace(_level1.myvar) ;// This prints correct value
}

Can anyone confirm this behavior?  Is there some delay here (e.g. JS takes
100ms to respond) or is that the value is set when the movie clip's timeline
starts up and not until then?

It's all just a bit mysterious...

Doug

P.S. This is Flash 6 code, running in Flash player 9.  Browser is Firefox or
IE 7, both behave the same.

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] One more AS3 question!

2007-04-04 Thread Douglas Pearson
Ben you're doing the right thing by having MyClass contain the clip you load
rather than extend it.  You can't cast a MovieClip (or any object) to a new
type that's lower in the class hierarchy than the original object.

Doug

-Original Message-
From: ben gomez farrell [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 02, 2007 9:11 AM
To: Flashcoders mailing list
Subject: [Flashcoders] One more AS3 question!

So, I was wondering if there's anyway to do this

I have some graphics in my SWF.  I'm embedding them and compiling with the
Flex SDK.  The graphics are coming in as MovieClips, but I want a little
more functionality, so I'd like to extend the clip and encapsulate that
additional functionality in a class.

I've discovered the magic of typing something as I can bring in a
movieclip and do a var mynewsprite:Sprite = mymovieclip as Sprite.

But I actually want to type something up.  With type as I can only type
something as something the object extends from.  I can type a movieclip as a
sprite or a display object.

I want to take my movieclip instance from the library (I don't want to
specify a class name, because I'd prefer to avoid the Flash alpha compiler
and just do everything in the Flex SDK).  I want to bring that movieclip
onto the stage and magically make it a MyClass movieclip (where MyClass
extends movieclip).

For now I'm just working around it by passing it into MyClass, and not
making MyClass extend anything, just keeping the movieclip as a variable to
use in the class.

Anyway, I know I'm being really picky (don't want to specify a class, don't
want workarounds), it's really for learning purposes rather than  I
need this done right now!!!

So anybody know how to turn a movieclip into an extended movieclip through
code?


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Confused about accessing nested movieclips in AS3

2007-03-29 Thread Douglas Pearson
Ben,

We ran into the same problem with Embedded clips and couldn't find a
solution.  However, if you save as an AS3 SWF through Flash 9 alpha, and
then load the clip dynamically you will get a MovieClip back.  Then use
getChildren to pull out any subclips you need access to, as you described.

If you save it as a Flash 8 SWF (AS2) and load that you get a AVM1Movie.
Still a display object but very restricted what you can do with it.  It
seems basically you can play it and that's all--so it's more like an
animated GIF than something from Flash.

Best to stick to Flash 9 (AS3) SWF's.

Doug

-Original Message-
From: ben gomez farrell [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 29, 2007 1:03 PM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Confused about accessing nested movieclips in AS3

I just figured it out, but now I have a new question.  There's actually no
code except for stop(); and the instantiation code in the actual Flash file.
I took all this out, and it doesn't seem like a big deal to just convert the
code.  It's also a small project, so it's not going to be a big deal to
change some of the syntax and type all my variables.  I actually am
upgrading because I want to use the byteArray class to save out a JPG.

Anyway, I've gotten so far as to finally figure out that I need to access
the nested clips through the displayobject class by using getChildren, or
getChildAt, or getChildByName.

My battle now is that I can't figure out why things are embedding the way
they are.

I'm embedding the assets through a compiler directive:  
[Embed(source=assets.swf, symbol=gui_mc)] Even though it's a movieclip
in the Flash Alpha, it won't type in the Flex SDK as a movieclip.  The error
says it's displayobject.  I can actually get away with typing it as a
Sprite.

And then I can access it's children if I say if I type the main movieclip as
a sprite.

The nested clips on the other hand I can't type as anything but a display
object unfortunately, which means I can't access it's frames.

So that's what I'm clueless on now!  I've tried exporting out of Flash Alpha
as AS2 and AS3, but I can't type things as a movieclip no matter what I do.

Thanks!
ben

Steven Sacks | BLITZ wrote:
 If you're not using absolute strict typing and everything that AS3 has 
 (display, addChild, etc.), then you're gaining no benefit because 
 Flash will just kick down to VM1.

 IMO, you should either rebuild it from scratch in AS3 style (using 
 sprites, display objects, etc.) or leave it as AS2 and save yourself 
 the headache.




   
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of ben 
 gomez farrell
 Sent: Thursday, March 29, 2007 11:32 AM
 To: Flashcoders mailing list
 Subject: [Flashcoders] Confused about accessing nested movieclips in 
 AS3

 Hey everyone, I've been working with AS3 for a bit, and been kind of 
 avoiding this problem till now, but I've converting an AS2 project 
 which has some nested clips, and I'd rather not change things!

 So basically the question is how do I access nested clips?  
 Before in AS2, I'd say myclip.nestedclip.othernestedclip.

 But now the problem I have is that once I get a clip on stage I can't 
 drill down to it's children with dot syntax.  It gives an error that 
 the nested MC is an undefined property.
 I suppose I could create a class for myclip that exposes it's nested 
 clips as public variable - and do that for each nesting level, but 
 that's a lot of work.

 I also tried declaring it in my main class as private var 
 myclip.nestedclip:MovieClip, but of course that's bad syntax.

 If it matters, I'm exporting my assets out of the Flash 9 Alpha as a 
 Flash 9 AS2 movie. (I tried AS3, but the ability to specify a linkage 
 ID went away). Then I'm embedding the movieclips I need with the 
 [Embed] tag through FlashDevelop and sending it over to the Flex 2 
 SDK compiler for output.

 Anyway, this all works, and my stuff appears on stage, but I just 
 can't get access to the nested clips!

 thanks!
 ben
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training 
 http://www.figleaf.com http://training.figleaf.com

 
 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training 
 http://www.figleaf.com http://training.figleaf.com

   


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf 

[Flashcoders] Anyway way to capture a SWF as a bitmap?

2007-03-21 Thread Douglas Pearson
Anyone know if there's a way to draw the contents of a SWF to a
Bitmap/BitmapData object within Flash?

I have a SWF that involves lots of complex rendering steps and I want to be
export it as a bitmap.  The export part should be fine (using a server to
actually save the file) if I can figure out how to get it into a BitmapData
object so I can call getPixels() on it.

Anyone have any ideas?

Doug

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Anyway way to capture a SWF as a bitmap?

2007-03-21 Thread Douglas Pearson
Thanks to everyone who pointed out the bitmapData.draw() method!

I had seen that in passing but didn't realize that IBitmapDrawable supported
all display objects.

Thanks folks--that should do nicely.

Doug

-Original Message-
From: Hans Wichman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 21, 2007 8:48 AM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Anyway way to capture a SWF as a bitmap?

Hi,
you mean something like this:
var bitmapData1:BitmapData =
new BitmapData(200, 200, false, 0x00); bitmapData1.draw(myMC,new
Matrix());

?
greetz
JC


On 3/21/07, Douglas Pearson [EMAIL PROTECTED] wrote:

 Anyone know if there's a way to draw the contents of a SWF to a 
 Bitmap/BitmapData object within Flash?

 I have a SWF that involves lots of complex rendering steps and I want 
 to be export it as a bitmap.  The export part should be fine (using a 
 server to actually save the file) if I can figure out how to get it 
 into a BitmapData object so I can call getPixels() on it.

 Anyone have any ideas?

 Doug

 ___
 Flashcoders@chattyfig.figleaf.com
 To change your subscription options or search the archive:
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 Brought to you by Fig Leaf Software
 Premier Authorized Adobe Consulting and Training 
 http://www.figleaf.com http://training.figleaf.com



___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] AS3 ApplicationDomain example fails to compile

2007-03-16 Thread Douglas Pearson
Does anyone have a simple example of compiling AS3 classes into one SWF and
loading and accessing them from a second SWF?

The example from Programming ActionScript 3.0 showing how to do this
doesn't seem to compile:
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.htm?hr
ef=Part5_ProgAS_155_1.html

With Error: Type was not found or was not a compile-time constant: Greeter
as soon as the loaded class is referenced.

Doug

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Number -- how good for use as an integer?

2007-03-06 Thread Douglas Pearson
Thanks guys for the responses.

I'm actually not concerned with arbitrary precision just storing a 32-bit
int (like a database key) and retrieving it accurately.  I guess the only
safe way in AS1/AS2 is to do the whole Math.round(value+0.01) thing.

Doug

-Original Message-
From: Jim Cheng [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 05, 2007 4:35 PM
To: flashcoders@chattyfig.figleaf.com
Subject: Re: [Flashcoders] Number -- how good for use as an integer?

Douglas Pearson wrote:
 Can someone clarify whether Number is actually just a simple wrapper 
 round a double precision floating point value?

 Is this a problem with Flash?  If so, any solutions?

Internally, it's a 32-bit single precision float and doesn't play well if
you need arbitrary precision integer manipulations.  You can see the link
that Mick recommended for a longer discussion of this from Adobe.

This is a fairly common problem across many programming languages.  As such,
most developers needing such functionality (e.g. for financial, scientific
or cryptographic usages) resort to libraries providing for arbitrary
precision integer storage and operations.

While I don't know of any ActionScript specific libraries for this, there
are several that have been written for Javascript and shouldn't be too
difficult to port if you're so inclined.  Among others, see:

http://www.leemon.com/crypto/BigInt.html

http://www-cs-students.stanford.edu/~tjw/jsbn/

Jim Cheng
effectiveUI


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Number -- how good for use as an integer?

2007-03-05 Thread Douglas Pearson
Can someone clarify whether Number is actually just a simple wrapper round a
double precision floating point value?

The reason I'm asking is I'd like to know how accurately Flash can store
integers.  With AS3 there's a true int type added but in AS2 how reliable
is Number at storing and retrieving integer values?

The problem here, of course, is that a floating point value can't exactly
represent integers (you get a lot of 1025.01 values instead of
1025).

Is this a problem with Flash?  If so, any solutions?

Doug

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Flash 9 AS3 Resource Management

2007-02-28 Thread Douglas Pearson
I'd be interested in tools for monitoring this too.

To avoid holding onto objects through addEventListener, have you tried the
weak reference option?  We've been using that increasingly as the default
way to add listeners, so objects don't hang around when we think we're
finished with them.

Doug 

-Original Message-
From: Kalani Bright [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 28, 2007 2:56 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Flash 9 AS3 Resource Management

Hi everyone,
 
Does anyone have some tips or tutorials on how to handle resources and
performance issues in flash.
 
I have more of an application than a flash file and things start to slow
down after a while.  I'm thinking the garbage collection mechanism in flash
isn't deleting the objects which aren't needed anymore.
I was able to improve performance somewhat by overriding addEventListener to
put the event listener into an array of objects which I then reference
values from.  When a SuperMovieClip object is removed from the stage an
event listener for that event goes through the array and removes each of the
listeners.  If it is added to the stage again all the listeners are re-added
from the array.
 
Theres some other slow downs I can't account for.  It would be nice if there
was a debugging tool or something so I could see what types of objects are
in memory at any time so I can see whats not getting deleted and what keeps
taking up resources.  I am especially interested in however strategies for
dealing with the issues of instantiation, deletion, events, for resource
optimization.
 
Thank you, thank you, (thank you)
 
Kalani


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com