Re: [Flashcoders] encrypt string (fast)

2007-08-18 Thread Tyler Wright
I would think the built-in ByteArray.compress would be much faster than 5-10
seconds for a simple 100k string. But if it doesn't work, a really simple
method of encrypting a string is doing a bit-flip on each character ...

// your original string (try this out with large files)
var str:String = 123456789;
var newStr:String = ;

// some random number between 0 and 255
var bitFlip:uint = 76;
for(var i:uint = 0; i  str.length; i++)
{
// using the bitFlip value do an XOR on the character
newStr += String.fromCharCode( str.charCodeAt(i) ^ bitFlip );
}
// new string is un-readable
trace(newStr);
// to translate back to the original string, simply flip
// the character back using the same bitFlip value
str = ;
for(i = 0; i  newStr.length; i++)
{
str += String.fromCharCode( newStr.charCodeAt(i) ^ bitFlip );
}
// once again you have the original
trace(str);


Even if it's not real security, it's always a heap of fun. Good luck!

Tyler


On 8/16/07, Mick G [EMAIL PROTECTED] wrote:

 I've tried different compressions classes - they're just too slow (even
 with
 some I tried that throw chunks of data at the class in intervals, it
 still
 took 5 - 10 seconds.

 And yes the purpose is to make it unreadable.

 I've written a very simple function that replaces the numbers 1 - 20 with
 custom characters using split.join. It performs this in 170 milliseconds
 to
 encrypt (and takes about 10% off the file size since in some instances I'm
 replacing 2 characters with 1).

 I guess using split and join is much faster than I thought.



 On 8/16/07, elibol [EMAIL PROTECTED] wrote:
 
  Why do you need to encrypt it? If you just need it unreadable, then why
  not
  kill two birds with one stone and compress it?
 
 
 
 http://www.razorberry.com/blog/archives/2004/08/22/lzw-compression-methods-in-as2/
 
  On 8/16/07, Mick G [EMAIL PROTECTED] wrote:
  
   I need a way to encrypt a LARGE string (up to 100k of text) - my data
 is
   mostly xy coordinates so 90% numbers.
  
   I've tried a few AS encryption classes that I've found online and
   considering I have such a large string, they're all too slow. It
 doesn't
   need to be too secure - decryption speed is more import than security.
  
   I was thinking of just doing a simple custom character replace with
   split.join replacing each numeral 0-9 with a character, but does
 anyone
   have
   any other ideas on a efficient/fast way of doing this?
  
   - Mick
   ___
   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 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


Re: [Flashcoders] swf and referring domain

2006-11-18 Thread Tyler Wright

Mick,

You don't need the import (in AS2) if you type out the full package name:
flash.external.ExternalInterface(...);

Tyler

On 11/17/06, Mick G [EMAIL PROTECTED] wrote:


Two lines...

*import* flash.*external*.*ExternalInterface
*var thisDomain:String = flash.external.ExternalInterface(eval, 
location.href);

I always forget that damn import and it kills me wasting time debugging it
;)





On 11/17/06, Tyler Wright [EMAIL PROTECTED] wrote:

 Dave,

 If you were just using Flash8 ... it's beautiful.

 var thisDomain:String = flash.external.ExternalInterface(eval, 
 location.href);

 one line, so sweet.

 Tyler

 On 11/15/06, Dave Segal [EMAIL PROTECTED] wrote:
 
  Is there a way to find the domain of the page that loads my swf. For
  example, someone embeds an swf served from my server on their
  www.myspace.com http://www.myspace.com/  page. Is there is way for
me
 to
  determine that the request is coming from myspace.com at runtime?
 
  A search of the archive revealed this thread that describes exactly
the
  problem that I am facing but I didn't see any solution.
 
 

http://chattyfig.figleaf.com/pipermail/flashcoders/2006-October/175064.html
 
  I have the option of using AS 3 if it provides a solution.
 
  Thanks.
 
  ___
  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 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


Re: [Flashcoders] swf and referring domain

2006-11-17 Thread Tyler Wright

Dave,

If you were just using Flash8 ... it's beautiful.

var thisDomain:String = flash.external.ExternalInterface(eval, 
location.href);

one line, so sweet.

Tyler

On 11/15/06, Dave Segal [EMAIL PROTECTED] wrote:


Is there a way to find the domain of the page that loads my swf. For
example, someone embeds an swf served from my server on their
www.myspace.com http://www.myspace.com/  page. Is there is way for me to
determine that the request is coming from myspace.com at runtime?

A search of the archive revealed this thread that describes exactly the
problem that I am facing but I didn't see any solution.

http://chattyfig.figleaf.com/pipermail/flashcoders/2006-October/175064.html

I have the option of using AS 3 if it provides a solution.

Thanks.

___
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


Re: [Flashcoders] Find item in array

2006-09-20 Thread Tyler Wright

He's right, and declaring the variable i inside of the loop rather than
before actually (weirdly) runs faster. I don't know what pcode it produces,
but I know CPU doesn't care about pcode. I think the only way to test speed
is timing the thing. It's all very interesting, but I doubt even 10 ms of
difference over 10,000 iterations could ever be noticable to the user. It
certainly won't be the difference between a script timeout or not. I like
the for..in for its simplicity ... also it helps avoid endless looping and
other unexpected behavior if you're adding to or taking away from the array
while the loop is running.

I agree, AS3 rocks! I'm done with 275 ms if I can have 7 ms. Thats 39 times
faster! geesh

Tyler

On 9/19/06, JOR [EMAIL PROTECTED] wrote:


Actually, Tyler's tests proved that var a in is faster with today's
player.  I tried his test out myself and my results were even wider than
his.  I published for AS2 and ran in Flash Player 9.  I was averaging
roughly 265ms for var a in and 275ms for (--a -(-1)).

Then I compiled for AS3 and it ran too fast for testing at 7ms for
both  AS3/Player 9 rocks!!!

So, I added another 9 to the loop counter making it 9 iterations.
Then var a in ran at 70ms, (--a -(-1)) and (a--) ran the same at 77ms.

Then I added another 9 making the loops 99.  var a in ran at
740ms, (--a -(-1)) ran 765ms and (a--) at 770ms.

I'm satisfied that for (var a in array) is faster than while (--a
-(-1)).  Perhaps in the past that wasn't always the case, but with
player 9 it is the case and that's what I'll be basing my decisions on.

James O'Reilly
http://www.jamesor.com



Steven Sacks | BLITZ wrote:
using a for..i..in loop will always be faster


 It's been proven before here on flashcoders that for in is not faster
 than --a -(-1) because it compiles to more lines of pcode.  I guess it's
 time to use Flasm to bust out some pcode and post it here on the list
 instead of making claims based on hunches and past posts in the
 archives.

 ___
 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Find item in array

2006-09-19 Thread Tyler Wright

for (var i:String in myArray)
{
   if (myArray[i] == value)
   return Number(i);
}

using a for..i..in loop will always be faster. Even more then --a -(-1)
iteration. Unless you can guarentee that your element will always be near
the beginning of a large array, as the for..i..in starts from the back. I
recommend using this loop anywhere you need the most speed and order doesn't
matter, as in this case.

Tyler



On 9/19/06, Steven Sacks | BLITZ [EMAIL PROTECTED] wrote:


I guess what it depends on is what you're doing with that for loop.

If you're using it to attach or create or animate movieclips, or parse
through xml or a recordset, or anything that would make Flash
unresponsive during the loop, then the benefits of while (--a -(-1))
outweigh the readability compared to while (a--).

As a result, I use it pretty often.  ;)

So, now I just end up using it for everything since it's become a habit.
The flipside is that sometimes I need to do forward loops for
reiterating to maintain proper order.  However, I would have to do that
anyway regardless of which backwards looping method I used.

___
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


Re: [Flashcoders] Find item in array

2006-09-19 Thread Tyler Wright

:)

So, for the sake of another one of those big arguments over what's better
where no one ever test, I wrote some code to find out exact results:

The following code executes one particular test on my Windows XP machine.
For results I got an averate of 347 miliseconds executeing the --i -(-1) and
343 ms with the for..in loop. I was surprised at how close they were. Now
that being the difference over 10,000 iterations, I can't really say for..in
is much faster, if at all. Perhaps the results are different on someone
else's machine, or perhaps different results from a different type of array.
Now iterating through the entire array the for..in did seem to be faster,
but for the test I chose a value directly in the middle so each method had
the same amount of value's to cover. anyway, I conclude nothing. ;)

except that we should always test our results.

Tyler

var myArray:Array = [a, b, c, d, e, f, g, h, i, j, k,
l, m, n, o, p];

var time:Number = getTimer();
var loop:Number = ;
while (loop--)
{
   /*/
   var j:Number = myArray.length
   while (--j -(-1)) {
   if(myArray[j] == h){
   break;
   }
   }
   /*/
   for (var j in myArray)
   {
   if (myArray[j] == h)
   break;
   }
   //*/
}
trace(getTimer() - time);

// 347
// 343

On 9/19/06, Merrill, Jason [EMAIL PROTECTED] wrote:


using a for..i..in loop will always be faster. Even more then --a
-(-1)

I'm ducking and running for cover.

Jason Merrill
Bank of America
Learning  Organization Effectiveness - Technology Solutions





___
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


Re: [Flashcoders] |:::| can you write dynamic meathods in a class?

2006-08-14 Thread Tyler Wright

If you're already using a custom Delegate, why not modify the thing to
handle what you've just provided?

var clickHandler:Function = MyClass.staticMethod;
var args:Array = ['Can', 'pass', 'in', 'any', 'amount'];
newBtn.addEventListener(click, Delegate.create2(this, clickHandler, args
));
// (I'm sure you could think of a better name than 'create2' though)

that's all a Delegate is doing is an apply. It's not magic, not really.

Tyler

On 8/13/06, Bjorn Schultheiss [EMAIL PROTECTED] wrote:


Hey Guys, check this out


Var clickHandler:Function = MyClass.staticMethod;
var args:Array = ['Can', 'pass', 'in', 'any', 'amount'];
newBtn.addEventListener(click, Delegate.create(this,
function(evt:Object,
meth:Function, args:Array) { meth.apply(null, args) }, clickHandler, args
)
);



Regards,

Bjorn Schultheiss
Senior Flash Developer
QDC Technologies

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of dnk
Sent: Monday, 14 August 2006 5:17 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] |:::| can you write dynamic meathods in a
class?

Ramon Miguel M. Tayag wrote:
 Sometimes some events pass their own args and you dont even see them..

 Try changing your function to this:

 function onHit1(o:Object, n:Number) //the o object is passed by the
 listener {
trace(it was hit with the number:  + n); }

That worked perfect!!!


Thanks sooo much!

d
___
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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Possible Challenge: AS 3.0 Compiler :)

2006-08-08 Thread Tyler Wright

It would be great to have the specs for AS3 just to modify current swfs in
other ways (not necessarily compile from scratch). Obfuscation comes to mind
...

Someone will do really well with an AS3 compiler ... so, who wants to start
an AS3 compiler in AS3?! I'd be interested.

Tyler


On 8/6/06, SWF Coder [EMAIL PROTECTED] wrote:



 Can flex compiler run inside the Flash 9 plugin?

No Way!

No need to be snappy. I didn't understand. I suppose
you could write
it using the new byte array stuff, but I don't
understand why it would
be of any use to anyone. If you want something
compiled it would make
a lot more sense to get a serverside language to call
the compiler.

It makes more sense as an interpretur to execute some
scripts on the client-side.
I wonder if there is a parser generator that could be
used with AS3?
Anyway, what the new byte array has to do with it?

 Possibly for geek points?
A compiler is a lot of work. If you have time to
kill, why not spend
it on something worthwhile.

Not if you used a parser generator. Plus, it's fun ;)

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Possible Challenge: AS 3.0 Compiler :)

2006-08-04 Thread Tyler Wright

There is an attempt underway to document the SWF 9 bytes for a disassembler.
I'm sure this could be the start of a compiler as well. And unfortunately I
don't think Adobe will release the specs any time soon.

http://osflash.org/swf9dis

Tyler

On 8/2/06, John Giotta [EMAIL PROTECTED] wrote:


It maybe too soon for anyone to have a full grasp on AMF or SWF specs
of an AS3.0 SWF but I wonder if its possible to create a crude
compiler from AS3.0.

AS3.0 ouroboros of sorts.
___
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


Re: [Flashcoders] AS3 faster ??

2006-07-10 Thread Tyler Wright

ActionScript 3.0 overview
http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html

Programming ActionScript 3.0
http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part5_ProgAS.html

ActionScript 3.0 Language Reference
http://livedocs.macromedia.com/flex/2/langref/index.html

I've found these to be great references, and I believe they're really the
only ones available.
Colin Moock is writing an AS3 reference as well, though I don't know when
it's scheduled to come out.

Tyler

On 7/10/06, Tom Jackson [EMAIL PROTECTED] wrote:


hey andreas you say AS3 isn't a difficult language to learn for as2'ers,
is
there any comprehensive books or courses out yet I could dive into?

On 10/07/06, Andreas Rønning [EMAIL PROTECTED] wrote:

 Hardly benchmarks, but you can get a quick comparison in flashplayer 9:

 http://andreas.rayon.no/AS2.swf

 Press the 3-key on your keyboard to load the most complex system,
 observe the BREAKNECK SPEED at which Flash player 8 handles it.

 http://andreas.rayon.no/AS3.swf

 I rest my case :)

 - Andreas


 Nick Weekes wrote:
  Andreas, you got any links to your benchmarking?  Id be interested to
 see
  them (Im not planning on migrating to AS3 just yet).
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
Andreas
  Rønning
  Sent: 10 July 2006 14:59
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] AS3 faster ??
 
  I did an l-system implementation in AS2 recently. In FP8 i could only
do
  simple systems with a couple of recursions before the player choked,
and
  playback was slow as well (i animated the growth with perlin noise for
a
  wind effect). Porting to AS3 let me quadruple the l-system complexity,
 still
  get instantaneous results and far, far better playback speed.
 
  Not hard numbers, i know, but pretty mindblowing for me to watch as a
  developer.
 
  AS3 doesn't wrap AS2, this is important to remember. AS2 was pretty
much
  AS1 with knobs on, AS3 is a new language to learn (albeit not a tough
 one to
  learn if you're used to AS2).
 
  - Andreas
 
  neo binedell wrote:
 
 Of course it will be faster only if you port the code over to AS3
 (otherwise it will still use the old AS2/1 VM1).
 
 I posted about the 3D engine I wrote and the speed increase I got when
 I converted it to AS3 a few days ago so you can check that out as an
 example of just how much faster it is ;p
 
 ~neo
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Patrick Matte
 Sent: 06 July 2006 05:47 PM
 To: Flashcoders mailing list
 Subject: [Flashcoders] AS3 faster ??
 
 Hi people, they say that AS3 is 10 times faster than AS2 but what does
 that really means ? Does that mean that my movies will play faster
 even if I have a few dozens movieclips with graphics flying all over
 the screen? Or does it just mean that my .swf will be compiling 10
times
 
  faster?
 
 
 ___
 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
 
 

 --

 - Andreas Rønning

 ---
 Flash guy
 Rayon Visual Concepts, Oslo, Norway
 ---
 ___
 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Re: Programmatically instantiating a class thatextends MovieClip

2006-07-05 Thread Tyler Wright

There's a really light class called Prototype which is free to download at
http://codext.com/code/9. It does the same thing except with full
constructor support. It also has a really simple/clean API:

mc = createEmptyMovieClip(mc, 1);
Prototype.makeInstanceof(mc, MyMovieClipClass);

thats it! I've loved it ... works on extending other elements too, like
TextFields or _root (I use that one constantly).

Tyler


On 7/3/06, Bernard Visscher [EMAIL PROTECTED] wrote:


I've tested the following a while ago and it works perfectly.
It uses the acme ClassUtilities class.

MovieFactory:

import com.acme.ClassUtilities;

class nl.debit.util.MovieFactory {

private static var instance : MovieFactory;

public static function getInstance() : MovieFactory
{
if (instance == null)
instance = new MovieFactory();
return instance;
}

private function MovieFactory()
{
ClassUtilities.registerPackage();
}

public static function
createMC(target:MovieClip,id:String,className:Function):MovieClip
{
if (instance == null)
instance = new MovieFactory();

if(!className.symbolLinked)
{
var classPath:String = ClassUtilities.getPath(className);
className.symbolName = __Packages. + classPath;
className.symbolLinked =
Object.registerClass(className.symbolName,className);
}

return
target.attachMovie(className.symbolName,id,target.getNextHighestDepth());
}
}


MyClass:

class MyClass extends MovieClip{

public function MyClass() {
beginFill(0x00);
moveTo(0,0);
lineTo(100,0);
lineTo(100,100);
lineTo(0,100);
lineTo(0,0);
endFill();
}
}

Then use in your code:

var mClip:MovieClip = MovieFactory.createMC(_root,test,MyClass);


Greetz,

Bernard

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens
 Costello, Rob R
 Verzonden: maandag 3 juli 2006 17:05
 Aan: flashcoders@chattyfig.figleaf.com
 Onderwerp: [Flashcoders] Re: Programmatically instantiating a
 class thatextends MovieClip

 As a variant on the __proto__ method (which I gather is what
 the compiler actually uses behind the scenes anyway) I also
 bundle the code into a static method





  Class A {

 ...



 // dynamicMc (no library symbol) will be added and subclassed
 to mcSubClass

 dynamicMc:MovieClip  = McSubClass.addInstance(baseMC);

 }





 class McSubClass extends MovieClip{



 function McSubClass {

   //empty constructor

 }



 function init(){



   //initialize mc - add dynamic graphics etc



 }



 static function addInstance (base_mc) {



 var newMc;

 var nd = base_mc.getNextHighestDepth();

 newMc= base_mc.createEmptyMovieClip(mcSubClass+nd,nd);

 newMc.__proto__ = new McSubClass ();

 newMc.init();

 return newMc;

 }





 }



 maybe mc.__proto__ == MyClass.prototype (below) is better
 than my  newMc.__proto__ = new McSubClass ()

 my method (i picked up on this list) does have the side
 effect that the constructor can't initialize the mc, hence
 the separate init call after the __proto__ / constructor; all
 wrapped in one method so I don't forget

  Rob





  Subject: Re: [Flashcoders] Programmatically instantiating a
 class that

  extends MovieClip.

  To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com

  Message-ID:

  [EMAIL PROTECTED]

  Content-Type: text/plain; charset=UTF-8; format=flowed

 

  Hello :)

 

  it's easy, you must use __proto__

 

  AS2 - MyClass extend MovieClip !!!

 

  MyClass extends MovieClip {

 

   // o Constructor

 

   public function MyClass() {

 

   }

 

  }

 

  

 

  var mc = createEmptyMovieClip(myInstance, 1) ;

  mc.__proto__ == MyClass.prototype ;

  MyClass.call(mc) ;

 

  EKA + :)

 

 

 

 

  2006/6/29, Scott Hyndman [EMAIL PROTECTED]:

  

   That's exactly what I mean. As a result you can do cool
 things like

   reparenting -- like moving a button from one window to another. It

   handles the MovieClip creation itself.

  

   A code example really isn't too easy, because the framework that

   allows this to be possible is quite large. If you were really

   interested, you could look at the code. Here's a link:

  

   http://tinyurl.com/jqtwv

  

   It's a gigantic class...so it might be difficult to work through.
   The

   important method is createMovieClips(), which is called
 when a view

   (the type of object that encapsulates movieclips) moves to a new

   superview.

  

   Scott

  

   On 29/06/06, Jim Kremens [EMAIL PROTECTED] wrote:

Why not subclass object instead? Both ActionStep and
 ASwing work

Re: [Flashcoders] Tabbed Browsing support? htmlText, contextMenu, Javascript?

2006-07-05 Thread Tyler Wright


Note: For those from Adobe that read this list ... With IE7's release and
it's support for tabbed browsing, if Flash Player provides no support for
opening links in tabs it will be increasing apparent that Flash Player is
essentially unaware of tabbed browers.)



I believe JavaScript is also fully unaware of tabs in any browser, and
JavaScript is the browsers own language. I am sorry but tabs are still very
browser specific and not exposed yet to any programatic API's available to
Flash. The only solution currently is to implement browser-specific plugins
that can communicate with the webpage through JavaScript. Good luck
convincing internet users that they'll need such a plugin.

If I find anything more that might look like a possibility I'll post it to
the list, but I think you're out of luck.

Tyler
___
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] Ajax and ActionScript 2.0

2006-07-02 Thread Tyler Wright


Could somebody share with me 1 example where AJAX/XMLHttpRequest
succeeds where Flash fails ?



The term AJAX is thrown around loosly these days to sometimes mean
anything JavaScript.
I've seen both Flash using JavaScript and JavaScript using Flash (FJAX) for
server communication. I can't say how much either solution makes sense, but
at least they're working together instead of succumbing to the old Flash vs.
JavaScript and Which is Better? debate. There are so many useful things they
can do together. Look for the Browser Power for Flash session at the next
FlashForward. It is all about Flash and JavaScript and some really cool
stuff they can do ... well worth your time. There will also be some previews
on the subject coming soon to uFlash.org.

Tyler


ps. don't mind this email if you've received it before. It's being resent
because of an initial failure to send.
___
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] Ajax and ActionScript 2.0

2006-06-28 Thread Tyler Wright


Could somebody share with me 1 example where AJAX/XMLHttpRequest
succeeds where Flash fails ?



The term AJAX is thrown around loosly these days to simply mean anything
JavaScript. For those interested in learning more about Flash and JavaScript
drawing on one anothers strengths look for the Browser Power session at the
next FlashForward. It will be well worth your time.

Tyler
___
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] is extending TextField usable with AS2?

2006-06-16 Thread Tyler Wright

it would seem manuals are written by people. People can be wrong, and are in
this case.

TextFields, MovieClips and Buttons are all AS classes that can be extended.
Each class ships with set of methods and properties that are present in the
subclass. However, most of those props/methods will only work if the
instance object happens to be a display object instance with which the super
class is associated.

Understanding this gives you the ability to do some cool things. Did you
know that you can give the TextField class the getBounds, swapDepths, and
other useful functions that only the MovieClip class has and it works like a
charm:

TextField.prototype.swapDepths = MovieClip.prototype.swapDepths;

Also, you can take any TextField already in existance and make it an
instance of your subclass. The docs are wrong, you can subclass a TextField,
it just doesn't do you much good without a method of instantiation:

mc.createTextField(tf, 0, 0, 0, 100, 20);
Prototype.makeInstanceof(mc.tf);

Prototype is the class I've created to make such a process feel less dirty
to OO purists who still don't realize that all AS2 is AS1 in the end.

This class is available on http://codext.com and will be a core class of the
Flight component set. There are always solutions.

Tyler


On 6/16/06, Michael Stuhr [EMAIL PROTECTED] wrote:


Merrill, Jason schrieb:
 Peter O'Brien schrieb:
 title says it all really, I'd prefer not to use prototype, is there
 anyway I
 can make an instance of my AS2 extension of TextField?

 RTFM where it says all about classes.

 micha

 Come on now micha, play nice.  It's not like the manual has a section
 in classes about extending TextFields -
now you got me: no, it hasn't but creating subclasses is in there.

 You cannot extend the TextField class or static classes
(from: http://livedocs.macromedia.com/flash/8/main/1359.html)

took me 1 minute to find.

search the archives is an option too:

http://chattyfig.figleaf.com/mailman/htdig/flashcoders/2005-March/134251.html


don't we have a nettiquette ?

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


Re: [Flashcoders] FlashVars + OOP, Best Practices?

2006-06-07 Thread Tyler Wright

I never really understood how making an anonymous object and it's properties
into a dynamic class suddenly made it object oriented. Singleton especially
seems to be a vice for that type of thing.

The reason you would abstract the FlashVars is to 1) avoid naming conflicts
and 2) to make changes as easy as possible -- all in one place. With the
dynamic Singleton if the naming of the specific FlashVars change you still
have to search through all of your code and update those references. If,
however, your main Application class (specific to your app) should take
those variables and store them by some application-specific name, you now
have a single place for all of your classes to access and one place to make
changes should a backend developer decide mid-project to mix things up.
Singleton or any class are instantly useless as soon as they perform exactly
as an anonymous object (usually involving dynamic and resolve). I agree that
FlashVars should be limited to receiving config information only at which
point an application can gather further information if needed.

It needs to make sense, not just seem more correct. OOP is a tool for change
and reuse of code. It was never meant to be something for blind faith.

The suggestions I have for your current class:
1) create a hash table coded to the specific FlashVar class for your
particular app. It should have the FlashVar name as well as a reserved name
given for application use. These can be the same, but if the FlashVar name
were to change it could be updated here and the application would continue
using the value by the app name.

ex.
var hashVars =
{
   fv_url:baseURL,
   fv_uid:userID
}

2) (what you've got with naming convention is really good, good standard to
have, so this is just an alternative, not a better way) have the class
initiate from a static constructor (so it will happen before frame1 and
before everything really gets going). At this point you can scrub _level0
for each var in your hash table (everything that isn't a MovieClip,
TextField, Button, or the $version property will be a FlashVars). You can
then store them and delete them from _level0 promptly. This will help your
class not be dependant on an arbritrary naming convention.

Tyler


On 6/6/06, Morten Barklund [EMAIL PROTECTED] wrote:


Hi Steve,

 1. Use static methods/properties instead of singleton. Gets rid of
 '.getInstance().' cruft.

Well. In this case I prefer it used as a singleton - don't know why
really, but it just seems more correct to me.

 2. Remove the setVar() method since these properties really should be
 read only. Move this into your settings class if you need it.

But it's private anyways. Is made to be used by subclasses.

 3. Use composition in the SomeSettingsClass class rather than
 inheritance since this isn't an 'is a' relationship.

That would require more code, and the ability to overturn dynamicness
through inheritance makes this seem preferable to me.

And I actually find the relationship as being an is a - as the
settingsclass would be used only for FlashVars-variables. Other settings
(read from XML and more) could of course be read in as well, in which
case composition would be preferable.

But I do follow your concerns on all three matters.

 It's also worth noting that the Flex 2 framework has a nice method of
 abstracting FlashVars via the Application.application.parameters array.

Those will be the days... :)

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


Re: [Flashcoders] FlashVars + OOP, Best Practices?

2006-06-07 Thread Tyler Wright

Oops, I didn't read your full article. You solve those problems with
your extend
FlashVars suggestion! Singleton still doesn't make sense in this situation.
If you make the class a static that automatically parses _level0 you'll be
set (FlashVars will never be found anywhere but _level0 and they'll be
available right from the beginning. I know there are some who will want to
argue that this is a dependency but that could be similar to arguing that
the MovieClip is a dependency -- it's a documented and supported feature)

Tyler

On 6/7/06, Tyler Wright [EMAIL PROTECTED] wrote:


I never really understood how making an anonymous object and it's
properties into a dynamic class suddenly made it object oriented. Singleton
especially seems to be a vice for that type of thing.

The reason you would abstract the FlashVars is to 1) avoid naming
conflicts and 2) to make changes as easy as possible -- all in one place.
With the dynamic Singleton if the naming of the specific FlashVars change
you still have to search through all of your code and update those
references. If, however, your main Application class (specific to your app)
should take those variables and store them by some application-specific
name, you now have a single place for all of your classes to access and one
place to make changes should a backend developer decide mid-project to mix
things up. Singleton or any class are instantly useless as soon as they
perform exactly as an anonymous object (usually involving dynamic and
resolve). I agree that FlashVars should be limited to receiving config
information only at which point an application can gather further
information if needed.

It needs to make sense, not just seem more correct. OOP is a tool for
change and reuse of code. It was never meant to be something for blind
faith.

The suggestions I have for your current class:
1) create a hash table coded to the specific FlashVar class for your
particular app. It should have the FlashVar name as well as a reserved name
given for application use. These can be the same, but if the FlashVar name
were to change it could be updated here and the application would continue
using the value by the app name.

ex.
var hashVars =
{
fv_url:baseURL,
fv_uid:userID
}

2) (what you've got with naming convention is really good, good standard
to have, so this is just an alternative, not a better way) have the class
initiate from a static constructor (so it will happen before frame1 and
before everything really gets going). At this point you can scrub _level0
for each var in your hash table (everything that isn't a MovieClip,
TextField, Button, or the $version property will be a FlashVars). You can
then store them and delete them from _level0 promptly. This will help your
class not be dependant on an arbritrary naming convention.

Tyler



On 6/6/06, Morten Barklund [EMAIL PROTECTED] wrote:

 Hi Steve,

  1. Use static methods/properties instead of singleton. Gets rid of
  '.getInstance().' cruft.

 Well. In this case I prefer it used as a singleton - don't know why
 really, but it just seems more correct to me.

  2. Remove the setVar() method since these properties really should be
  read only. Move this into your settings class if you need it.

 But it's private anyways. Is made to be used by subclasses.

  3. Use composition in the SomeSettingsClass class rather than
  inheritance since this isn't an 'is a' relationship.

 That would require more code, and the ability to overturn dynamicness
 through inheritance makes this seem preferable to me.

 And I actually find the relationship as being an is a - as the
 settingsclass would be used only for FlashVars-variables. Other settings
 (read from XML and more) could of course be read in as well, in which
 case composition would be preferable.

 But I do follow your concerns on all three matters.

  It's also worth noting that the Flex 2 framework has a nice method of
  abstracting FlashVars via the Application.application.parametersarray.

 Those will be the days... :)

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


Re: [Flashcoders] More on shared fonts and embedding

2006-06-05 Thread Tyler Wright

You're right, unless the font is embedded Flash will render it as a system
font which means it will hopefully look as good as other aliased fonts in
the browser, but not better.

My suggestion is to take a look at Rob Taylor's Fontastic, it's pretty
ingenious. You might have to subscribe to his site.

http://FlashExtensions.com

Tyler

On 6/5/06, Danny Kodicek [EMAIL PROTECTED] wrote:


Okay, I'm back after the weekend and ready to get this sorted out.

Thanks to various help, mostly Tom, I've got to the stage where objects in
one movie are managing to share a font in another, which at least is what
shared fonts are supposed to do (and is in itself something of a
breakthrough for me). But it's still not right. The problem is that for
dynamic fields, unless I embed the font, it doesn't appear antialiased.
This
means that my 'client' movie has to embed my shared font, but as soon as I
do that, the linkage breaks (quite reasonably). Meanwhile, I'm still
concerted about the low filesize in the 'Official' version: I can't see
how
this can contain all the font information.

I really would appreciate some more thoughts on this. Am I just missing a
trick on how to get these fonts antialiasing correctly?

Danny

___
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


Re: [Flashcoders] Conditional Import Statements

2006-06-05 Thread Tyler Wright

The only way is to compile the classes into a seperate SWF's and at runtime
when you make the check load in the appropriate SWF. Not a very simple
solution.

I've found that a good solution, if you can afford to combine the classes
into one, is making a runtime check on functionality.

jsConnection = (ExternalIntervace != null) ? callEI : callGetURL;

function callEI()
{ ... }

function callGetURL()
{ ... }

make sense?
Tyler


On 6/5/06, Janis Radins [EMAIL PROTECTED] wrote:


no there is no way
improts are executed at compile time all you can do is to define which
class
to use depending on player version

2006/6/5, Christian [EMAIL PROTECTED]:

 Hey Guys,

 So i'm in the process of writing a class that does a lot of JavaScript
 handling.  The tricky part is, I want to use External Interface for
 those files published in 8 and simple getURL calls for those published
 in 7 or below.

 For all intents and purposes, this is a private class that won't be
 exposed to the public, so I can't simply require the user to import
 version 8 of class or version 7 of class.

 Is there a way to do a conditional import based on published version,
 instead of runtime version?  I often use $version to detect major
 version of play to handle other functionality, but as you all know
 External Interface breaks if not published in 8.

 OR better yet, could I simply just copy the file to the FP7 folder and
 fake it?

 Does this make sense or am I smoking crack here?

 Christian
 ___
 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] maxDepth for dynamic movieclips?

2006-06-04 Thread Tyler Wright

You'll love using the XT DepthManager - plus if you read the comments on the
classes static properties there are exact (verified) numbers for max and min
depths supported by the Flash player.

You'll find the class at http://codext.com/code/6

Tyler

On 6/1/06, Zimmen [EMAIL PROTECTED] wrote:


Well, when you have a slideshow that shows clips one after the other then
you only really need 2 depths don't you ...
If not, perhaps some sort of depth manager that keeps track of used and
unused depths...


- Original Message -
From: grimmwerks [EMAIL PROTECTED]
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Sent: Thursday, June 01, 2006 3:40 PM
Subject: [Flashcoders] maxDepth for dynamic movieclips?


 I've got an app that's a glorfied slideshow, slowly adding mc's and
 gettingNextHighestDepth() -- at some point I'm assuming it will get to
 the maxDepth; what would be the best way of resetting this?
 ___
 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] create an object of type defined with a string

2006-06-04 Thread Tyler Wright

If you need an object that already exists to be converted into an instance
of the class you can use the XT Prototype class

Prototype.makeInstanceof(obj, Array);

and using Zimmen's suggestion

Prototype.makeInstanceof(obj, _global[tType]);

good luck! you'll find the class at
http://codext.com/code/9

Tyler

On 6/1/06, Zimmen [EMAIL PROTECTED] wrote:


Yes it is... so you could use

function makeObject(tType){
   return (new _global[tType]())
}
test = makeObject(Array)

as well (this is what the findClass method does eventually. :)

On 6/1/06, Danny Kodicek [EMAIL PROTECTED] wrote:
 Thanks, Zimmen and Ian, that's helpful. I'll probably go with Ian's
 solution, which seems a bit more robust (I've been caught out before by
 clever tricks using eval()...)

 Danny

 - Original Message -
 From: Zimmen [EMAIL PROTECTED]
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Sent: Thursday, June 01, 2006 5:33 PM
 Subject: Re: [Flashcoders] create an object of type defined with a
string


  This actually works:
 
  function makeObject(tType){
  var tVar = eval(tType)
  return (new tVar())
  }
  test = makeObject(Array)
  test.push(foo)
  test.push(bar)
  trace(test[0])
  trace(test[1])
  trace(test.length)
 
  Output:
 
  foo
  bar
  2
 
  On 6/1/06, Danny Kodicek [EMAIL PROTECTED] wrote:
  I want to have a function makeObject(tType:String) which returns an
  object
  of class tType. So makeObject(Array) should return a new Array
object.
  Any
  good way to do this? I'm sure it's something simple.
 
  And before you ask, yes, there is a reason why I need to do it this
  way...
 
  Danny
 
  ___
  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 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] SetInterval vs. onEnterFrame

2006-05-24 Thread Tyler Wright

setInterval's use up next to nothing on processor, even if you have 20 of
them going. I find that the best judgement of which to use is the task at
hand.

Because framerate is for animation, I find it best to use onEnterFrame when
doing coded animation. Flash will cause an automatic screen redraw each
frame and because the onEnterFrame executes precisely before this redraw
it's the perfect chance to make display changes and scripted tweens. To keep
processor to a minimum it is good to use only one onEnterFrame because many
of them will make a processor difference. The way to do this is set up an
enterFrameBroadcaster ... basically have one onEnterFrame running and
dispatching an enterFrame event each cycle. Then many objects can listen.
This was first used by Robert Penner I believe and is built in to the
Macromedia tween classes. I also have a version if you can't find one
suitable.

To have a smooth animation using setInterval you must call
updateAfterEvent() in the interval, forcing a redraw. Each additional screen
redraw you make is additional processor - the framerate redraw will happen
regardless. The best time to use setInterval is when you want to achieve a
specific interval of time. For example, when the user clicks a scrollbar
arrow it shouldn't move faster and slower based on the framerate a designer
sets the movie at. It will always depends on your context and the behavior
you want.

Tyler



On 5/24/06, Adam Pasztory [EMAIL PROTECTED] wrote:


I've found anecdotally the onEnterFrames are less CPU intensive than a
setInterval running at a similar rate.

The cons of setInterval are worth noting, but if you're using a good OOP
code design, and you're strict about tracking your interval IDs, then you
don't have to be too afraid of setInterval.  I usually define a single
member variable in a class to track a particular interval.  Any time I
want
to call set interval, I first make sure the interval is cleared.

...
if(this.intervalId)
   clearInterval(this.intervalId);
this.intervalId = setInterval(this, someMethod, time);

Seems to work pretty well.

There is also a gotcha related to onEnterFrame that's worth mentioning: A
MovieClip can only have a single onEnterFrame handler, so when you assign
an
event handler to some MovieClip you'd better make sure it doesn't already
have a  different onEnterFrame already assigned to it.  I've run into this
kind of thing when working with animations from artists who like to put a
lot of Actionscript functionality into their MovieClips.

-Adam

On 5/24/06, Rifled Cloaca [EMAIL PROTECTED] wrote:

 Flashcoders,

 I'm building a modular system that contains various programmatic
 animations
 within seperate modules, coordinated by a central wrapper class.  I've
 opted
 to use empty movieclips with onEnterFrame functions to manage timing in
 animations and presentation playback, as opposed to setInterval.  Reason
 being is that I don't want to have to worry about scoping my intervals,
 and
 most of all, losing track of intervals and eventually having them stack
 up,
 interfere with eachother, and cause memory leaks.

 Question is, isn't it more processor intensive to use a series of
 onEnterFrames like this?  Can anyone think of any other cons to the
method
 I've chosen?

 Thanks in advance!
 -g
 ___
 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] hitTest vs onRollOver/onRollOut

2006-05-22 Thread Tyler Wright

The main thing that can really add up in processor is the number of
MovieClips at the same level (sharing the same parent). You'll save
processor best if you don't have any on-event events as well, such as
onPress, etc. It's because Flash spends a lot on keeping up with it.

It's really fun to play with ... I had a system that used _droptarget to get
the topmost movieclip and dispatch events up it's parent chain much like AS3
does now. However, the processor was not too friendly, but I know I could do
a lot more viable solution now-days. Let us know how it goes!

Tyler

On 5/22/06, phaedrus [EMAIL PROTECTED] wrote:


Thanks a bunch for the info! I'm surprised to hear that the hitTest
actually
performs better, although I agree that the things I may have to add will
more than balance it out.

Basically, I'm trying to grow my own button class which has disabled and
on/off states in addition to rollover and press.  I'd like to be able to
use
hitTests rather than rollover and rolloff because I frequently run into
situations where I want to put a button inside a movie which itself may
have
rollover or rolloff event handlers and the event doesn't reach my button.

I like the hit test approach, but if there was a significant performance
concern, I was going to have to consider another way of going about it.

I've found some AS2.0 classes at
http://www.senocular.com/flash/actionscript.php which may do part of what
I
need.  The main trick now is to figure out how to make a nice packaged
component that allows a designer to modify the look without having to do
too
much work.

I hope to figure out how to deliver them similar to Elvis Mehmedovic's
work
(http://chq.emehmedovic.com/) where all the elements are readily available
in the flash movie for tweaking if necessary.

- phaedrus

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tyler
Wright
Sent: Friday, May 19, 2006 11:02 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] hitTest vs onRollOver/onRollOut

phaedrus,

You will find that, in the beginning, the hitTests will use up less
processor (better performance). The examples you have below, for example.
However, if you program all the logic you'd need to behave exactly as the
other method (keeping track of all the details, etc) you'll quickly begin
to
match the performance and it may end up not being worth the time and bugs
anymore. I still want to build a hitTest solution, mostly for my own
enjoyment, that will at least have equal performance if not better. But it
becomes harder for other developers to work with non-standard inventions,
cool as they may be, and eventually people just get frustrated with your
code.

If it's just for you or you don't plan and building a full mouse-behavior
replacement, try experimenting with _dropTarget ... there's some
possibilities there ;)


good luck,
Tyler


On 5/17/06, phaedrus [EMAIL PROTECTED] wrote:

 Does anyone know if there is a performance difference between hitTest
and
 onRollOver/onRollOut?

 For instance, if I had 100 movie clips on a lower-spec computer, would
 there
 be a notable processing difference between these two approaches:

 myMC.onMouseMove = function() {
 if(this.hitTest(_root._xmouse,_root._ymouse,true)) {
 trace(Roll Over);
 } else {
 trace(Roll Out);
 }
 }

 Or

 myMC.onRollOver = function() {
 trace(Roll Over);
 }
 myMC.onRollOut = function() {
 trace(Roll Out);
 }

 I've also got some concerns regarding using _root._xmouse (etc) based on
 the
 comments at:



http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.ht
 m?href=Part4_ASLR2.html
 but I've not yet looked to deeply into working around it (presumably by
 not
 using _root).  However, if anyone knows that the situation is
 unresolvable,
 that'd be good to know.

 - phaedrus


___
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


Re: [Flashcoders] Re: [Off List Response] for (var i in ..) loop interupted by frame change

2006-05-10 Thread Tyler Wright

It wasn't a targeting issue. Even though the for..i..in loops were being
stopped the frames still changed appropriately. Don't try and make excuses,
it's just a mean thing for Flash to do. ;)

I'm just happy to know the fix.

Tyler

On 5/9/06, Michael Bedar [EMAIL PROTECTED] wrote:


If I remeber correctly, goToAndStop() and MoviClip.gotoAndStop() are
completely separate functions, and even have different behavior on
the root timeline.


On May 9, 2006, at 5:47 PM, Tyler Wright wrote:

 This is Great! What a horrible thing to have to know, it just
 doesn't make
 sense that the keyword this would fix it. I can't imagine what
 other scope
 gotoAndStop would effect in this way.

 Thanks Elibol. It fixes the problem for both situations, endless
 looping
 for..i..in and the for..i..in's that end prematurely.

 Browser Power for Flash
 http://www.flashforwardconference.com/sessions?sid=158

 Tyler

 On 5/9/06, elibol [EMAIL PROTECTED] wrote:

 Hey that's great man! Congratulations, I'm very happy for you =]
 So what
 is it you're going to speak about?

 Weird... Try this:


 for (var i in list){
 trace(i);
 this.gotoAndStop (i);
 }
 }

 Seems that you need to explicity refer to this. I remember there
 being
 problems with certain MovieClip functions when they weren't
 refered to with
 the this object. I think that in the object stack there might be two
 definitions of the function and 'this' makes sure that the actual
 movieclip
 is the first one that is examined...

 Extending MovieClips is always full of suprises man...

 This is interesting, I'm wondering if it's gonna fix your problem
 though?

 M

 On 5/9/06, Tyler Wright [EMAIL PROTECTED] wrote:

  Hello Elibol!
 
  I apologize, I mislead you. My EventDispatcher is no longer a
 problem
  and the issue I face now seems to be different. I can only
 duplicate it
  making a component class that extends MovieClip. The issue is
 that the
  for..i..in loop stops after a gotoAndStop.
 
  class Test extends MovieClip
  {
  var list:Object;
 
  function Test()
  {
  list =
  {
  one:one,
  two:two,
  three:three,
  four:four,
  five:five
  };
 
  for (var i in list)
  {
  trace(i);
  gotoAndStop(list[i]);
  }
  }
 
  }
 
  If you define this class and set it up as a component in the
 Library you
  will see that only one is traced out. Then you can comment out
 the
  gotoAndStop(); and it loops through all 5. It behaves the same
 whether or
  not these frames actually exist. I think I'll post this to the
 list as well,
  but thanks for responding so quickly. Did I tell you I got
 accepted to speak
  at FlashForward in September? On Flash and JavaScript.
 
  Tyler
 
 
  On 5/9/06, elibol [EMAIL PROTECTED] wrote:
  
   Nevermind my former message. You can also use the
 AsBroadcaster class.
   I find it's very solid, however, it doesn't seem to be your
 problem at all.
  
   If you are coding in frames, and frames with function calls and
   variable definitions are called more than once, then this can
 mislead your
   assumptions about how many times a piece of code is executed.
 It might just
   be that you are adding the same object to a broadcaster more
 than once.
  
   I'm not sure but it seems like this is a possibility. Again
 though, an
   ends to what you've mentioned on object enumeration, the for
 in should never
   go into an infinite loop.
  
   M
  
 
 

 ___
 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright

I have sevaral for (var i in .. ) loops running looping through objects that
get thrown (interupted OR actually go forever) when I change the frame of a
movieClip where one exists.

Just as an example:

for (var i in listeners)
{
 dispatch(listeners[i].event);
{

// the listener
function setState()
{
 this.gotoAndStop(over);
}

or so, produced and endless loop (when the listeners object was defined on
the movieClip using the for .. i .. in)

Anyone have any ideas on fixes? I changed my listener to loop through it as
an Array (which isn't as fast and doesn't allow you to remove listening
objects halfway through the process). I've run into a circumstance where I
can't use an Array.

Tyler
___
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] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright

thanks for the quick response.

If you view the source for MM's EventDispatcher you'll see that it traverses
the event listeners array with a for..i..in.  This is so that one of the
listening methods can removeEventListener and not screw up the array
mid-process. A for..i..in simply hits every uniqe property despite order or
number.

The code I sent is an illustritive example. I've resolved my
EventDispatcher, but I'm finding this issue is the case in other
circumstanced (states, for example, are changing the frames while a
for..i..in loop is running on that object).

Tyler

On 5/9/06, Kevin Newman [EMAIL PROTECTED] wrote:


Logically it seems as though a list of listeners should be in an array,
instead of a collection of object properties, but to each his own :-)

You seem to have a small typo in here:

for (var i in listeners)
{
dispatch(listeners[i].event);
{

The second curly bracket is backwards. I don't know if that is causing
your problem though, could you give information?

Also, there is an mx object that can do event
dispatching/management/delegation:

mx.events.EventDispatcher


http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004file=2443.html


Kevin N.


Tyler Wright wrote:
 I have sevaral for (var i in .. ) loops running looping through
 objects that
 get thrown (interupted OR actually go forever) when I change the frame
 of a
 movieClip where one exists.

 Just as an example:

 for (var i in listeners)
 {
  dispatch(listeners[i].event);
 {

 // the listener
 function setState()
 {
  this.gotoAndStop(over);
 }

 or so, produced and endless loop (when the listeners object was
 defined on
 the movieClip using the for .. i .. in)

 Anyone have any ideas on fixes? I changed my listener to loop through
 it as
 an Array (which isn't as fast and doesn't allow you to remove listening
 objects halfway through the process). I've run into a circumstance
 where I
 can't use an Array.

 Tyler


___
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


Re: [Flashcoders] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright

I apologize, I mislead you. My EventDispatcher is no longer a problem and
the issue I face now seems to be different. I can only duplicate it making a
component class that extends MovieClip. The issue is that the for..i..in
loop stops after a gotoAndStop.

class Test extends MovieClip
{
   var list:Object;

   function Test()
   {
   list =
   {
   one:one,
   two:two,
   three:three,
   four:four,
   five:five
   };

   for (var i in list)
   {
   trace(i);
   gotoAndStop(list[i]);
   }
   }

}

If you define this class and set it up as a component in the Library you
will see that only one is traced out. Then you can comment out the
gotoAndStop(); and it loops through all 5. It behaves the same whether or
not these frames actually exist.

Tyler

On 5/9/06, Thomas Fowler [EMAIL PROTECTED] wrote:


I would love to help on this but I need a little more context. From what I
can gather it looks as if you're trying to dispatch an event a series of
events and have the corresponding listener/handler do something? Is that
correct?

As Kevin stated, it would be better to have a class backing these
different
movie clips that dispatch events that trigger another clip to do something
when said events occurs.

On 5/9/06, Kevin Newman [EMAIL PROTECTED] wrote:

 Logically it seems as though a list of listeners should be in an array,
 instead of a collection of object properties, but to each his own :-)

 You seem to have a small typo in here:

 for (var i in listeners)
 {
 dispatch(listeners[i].event);
 {

 The second curly bracket is backwards. I don't know if that is causing
 your problem though, could you give information?

 Also, there is an mx object that can do event
 dispatching/management/delegation:

 mx.events.EventDispatcher



http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004file=2443.html


 Kevin N.


 Tyler Wright wrote:
  I have sevaral for (var i in .. ) loops running looping through
  objects that
  get thrown (interupted OR actually go forever) when I change the frame
  of a
  movieClip where one exists.
 
  Just as an example:
 
  for (var i in listeners)
  {
   dispatch(listeners[i].event);
  {
 
  // the listener
  function setState()
  {
   this.gotoAndStop(over);
  }
 
  or so, produced and endless loop (when the listeners object was
  defined on
  the movieClip using the for .. i .. in)
 
  Anyone have any ideas on fixes? I changed my listener to loop through
  it as
  an Array (which isn't as fast and doesn't allow you to remove
listening
  objects halfway through the process). I've run into a circumstance
  where I
  can't use an Array.
 
  Tyler


 ___
 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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Re: [Off List Response] for (var i in ..) loop interupted by frame change

2006-05-09 Thread Tyler Wright

This is Great! What a horrible thing to have to know, it just doesn't make
sense that the keyword this would fix it. I can't imagine what other scope
gotoAndStop would effect in this way.

Thanks Elibol. It fixes the problem for both situations, endless looping
for..i..in and the for..i..in's that end prematurely.

Browser Power for Flash
http://www.flashforwardconference.com/sessions?sid=158

Tyler

On 5/9/06, elibol [EMAIL PROTECTED] wrote:


Hey that's great man! Congratulations, I'm very happy for you =] So what
is it you're going to speak about?

Weird... Try this:


for (var i in list){
trace(i);
this.gotoAndStop (i);
}
}

Seems that you need to explicity refer to this. I remember there being
problems with certain MovieClip functions when they weren't refered to with
the this object. I think that in the object stack there might be two
definitions of the function and 'this' makes sure that the actual movieclip
is the first one that is examined...

Extending MovieClips is always full of suprises man...

This is interesting, I'm wondering if it's gonna fix your problem though?

M

On 5/9/06, Tyler Wright [EMAIL PROTECTED] wrote:

 Hello Elibol!

 I apologize, I mislead you. My EventDispatcher is no longer a problem
 and the issue I face now seems to be different. I can only duplicate it
 making a component class that extends MovieClip. The issue is that the
 for..i..in loop stops after a gotoAndStop.

 class Test extends MovieClip
 {
 var list:Object;

 function Test()
 {
 list =
 {
 one:one,
 two:two,
 three:three,
 four:four,
 five:five
 };

 for (var i in list)
 {
 trace(i);
 gotoAndStop(list[i]);
 }
 }

 }

 If you define this class and set it up as a component in the Library you
 will see that only one is traced out. Then you can comment out the
 gotoAndStop(); and it loops through all 5. It behaves the same whether or
 not these frames actually exist. I think I'll post this to the list as well,
 but thanks for responding so quickly. Did I tell you I got accepted to speak
 at FlashForward in September? On Flash and JavaScript.

 Tyler


 On 5/9/06, elibol [EMAIL PROTECTED] wrote:
 
  Nevermind my former message. You can also use the AsBroadcaster class.
  I find it's very solid, however, it doesn't seem to be your problem at all.
 
  If you are coding in frames, and frames with function calls and
  variable definitions are called more than once, then this can mislead your
  assumptions about how many times a piece of code is executed. It might just
  be that you are adding the same object to a broadcaster more than once.
 
  I'm not sure but it seems like this is a possibility. Again though, an
  ends to what you've mentioned on object enumeration, the for in should never
  go into an infinite loop.
 
  M
 




___
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] System.as error ?

2006-05-08 Thread Tyler Wright

I've also had this error, several times. It's simply a Flash IDE bug --

Save your work, close and restart Flash, and the error will go away.

Tyler

On 5/8/06, MBDI ICSC Rodrigo E. Curiel Salazar [EMAIL PROTECTED] wrote:


I am working on a local drive,

I have some classes, in them I have this:

code
this.resX = System.capabilities.screenResolutionX;
/code

but I don't think that's the problem, since I remove this line, but I have
the same error


On 5/8/06, Jim Tann [EMAIL PROTECTED] wrote:

 I have had trouble with this kind of thing when working on a network
 drive. Are you working on one? Can you switch to a local drive?

 Jim

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of MBDI
 ICSC Rodrigo E. Curiel Salazar
 Sent: 08 May 2006 11:28
 To: Flashcoders mailing list
 Subject: [Flashcoders] System.as error ?

 Hi, I have a issue here, I don't have a clue of what's happening, when I
 test my movie in flash, everything goes well, but if I clear the ASO and
 test the movie, I get the following error:


  **Error** C:\...\System.as: Line 5: The name of this class, 'System',
  conflicts with the name of another class that was loaded.
   intrinsic class System {
 
  Total ActionScript Errors: 1   Reported Errors: 1
 
 But, if I remove the System.useCodepage = true; no error is displayed, I
 don't know what to do, any ideas ?

 Thanks,

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


Re: [Flashcoders] window.onClose - Flash

2006-04-30 Thread Tyler Wright

If you're using Flash 8 you can skip using the modal dialog box. Because
ExternalInterface and JavaScript communicate synchronously the JavaScript
waits for Flash to return a value and the window waits for JavaScript. It's
a great setup. You gotta love Flash8!

Tyler

On 4/30/06, g. wygonik [EMAIL PROTECTED] wrote:


If you dig in the list archives (if they are still around), i wrote a bit
about how i used onBeforeUnload to trigger Flash and i know other people
chimed in. In IE-only situations, i found it best to catch the
onBeforeUnload event, tell Flash via setVariable, open a modal dialog box
(so the main browser won't close) then either have the modal box close
itself after a few seconds, or have a localConnection or sharedObject
setup
to let a Flash movie in the modal dialog know the main Flash was done and
it
could close itself, which would in turn close the first, main window.
whew!
:-)

There are ways to have a modal box in other browsers, but i don't know the
details off the top of my head.

fwiw
g.

On 4/25/06, erixtekila [EMAIL PROTECTED] wrote:


 Le 25 avr. 06, à 23:31, David Rorex a écrit :

  window.onbeforeunload
 Never knew that one.

 I'l check for its availability across platforms. Thanks.

 ---
 erixtekila
 http://blog.v-i-a.net/
 ___
 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




--
weblog: broadcast.artificialcolors.com
blazePDF: www.blazepdf.com
band: www.cutratebox.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 Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] press hold

2006-04-26 Thread Tyler Wright
enjoy!

Tyler

// modified code snippet from my scroll class

scrollPause = Delegate.create(this, scrollPause);
upArrow.onPress = Delegate.create(this, upArrowPress);
upArrow.onRelease = upArrow.onReleaseOutside = Delegate.create(this,
arrowRelease);

private function scrollUp():Void
{
scrollPosition -= lineScrollSize;
}
private function upArrowPress():Void
{
scrollUp();
scrollInterval = setInterval(scrollPause, 300, scrollUp);
}

// these two methods are shared between arrowUp and arrowDown
private function scrollPause(scrollMethod:Function):Void
{
clearInterval(scrollInterval);
scrollInterval = setInterval(scrollMethod, 30);
}
private function arrowRelease():Void
{
clearInterval(scrollInterval);
}

On 4/25/06, eric dolecki [EMAIL PROTECTED] wrote:

 What I am currently doing: ( works, just doesn't seem like the right thing
 to do )

 var nScrollIntervalMS :Number = 70;
 some_mc.onPress = function(}{
 clearInterval( foobar );
 delete foobar;
 someFunction();
 var nTime = 0;
 // Repeat if held down
 this.onEnterFrame = function(){
 nTime++;
 // Click and Hold detected
 if( nTime  20 ){
 foobar = setInterval( stationUp, nScrollIntervalMS );
 this.onEnterFrame = null;
 }
 };
 };
 some_mc.onRelease = function(}{
 this.onEnterFrame = null;
 clearInterval( foobar );
 delete foobar;
 }


 On 4/25/06, Lee McColl-Sylvester [EMAIL PROTECTED] wrote:
 
  I have one that sets a date onPress and a date onRelease, then compares
  the date's getTime() to see how long it was pressed.  Works for me,
  though if you want to set a time during the press, an interval is
  required.
 
  Lee
 
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of eric
  dolecki
  Sent: 25 April 2006 13:55
  To: Flashcoders mailing list
  Subject: [Flashcoders] press  hold
 
  wondered if anyone had an elegant press  hold function before I wrote
  one
  using enterFrame/interval stuff.
  ___
  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 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


Re: [Flashcoders] Not all MCs get onEnterFrame

2006-04-26 Thread Tyler Wright
 you don't need that, it will be availible because its an anon function
 inside another function, therefore all variables inside the containing
 function will be availible.


 Right, because of this every MovieClip is sharing the same variables --
which is why it behaves unexpectedly.

That worked perfectly.  Thanks, Geoff.


This is usually the cue that the right answer has been found. Good work
Geoff.

Tyler
___
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] PrintJob causes Abort Script error message.

2006-04-03 Thread Tyler Wright
 I have over 20 years of programming experience including at assembler
 level, advanced Java, etc, but thanks for trying to put me in my place :-)


There is no error. There is no timeout. Not in the PrintDialog object.

I think the FlashCoders list in general has a silly habbit of saying
something like:

does mc._xscale = 50 change the width? does anyone know this answer?

and then half a week later, after pages of theoretical discussion, someone
actually tries out the half-minute test.

Try and do anything advanced (such as a stock exchange trading system) and
it [breaks] ... That ain't an error with my code!  is a DailyWTF-worthy
comment. What does a stock exchange trading system have to do with the OS
print dialog?

I've never seen this error, in any version of Flash since 7 when it was
created. I've created complex (2-year) systems where the sole product is a
printed page from Flash.

simple test. just a simple test

Tyler
___
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] Wherefore the evils of _global?

2006-03-23 Thread Tyler Wright
On 3/23/06, ryanm [EMAIL PROTECTED] wrote:

 Because global variables are contrary to the basis of OOP, which is
 all
 about abstraction and encapsulation. If you need to store variables
 somewhere so that they can be reached anywhere, use a singleton, or a
 static
 class, or an application object, and so on.


Uh, a singleton can be just a round-about method of the global namespace,
but is exactly the same thing (or at least the way I've seen it used with a
__resolve).

_global is a perfect place to store application meta data, the stuff you
might load from an XML file. Such as urls, configurations, etc. However, I
do agree that if you're building anything of significance (in size) you
should have a class (as you mentioned classes are global) that can act as a
singleton or a static; but the trick is it has each property it will hold
defined in it. This way every thing thrown the way of global vars is
documented, type checked, and follows some sort of API. This is easy to
track and debug. That is the hard thing about straight global, finding where
in the world the thing got set or changed when it's being messed up.

 Tyler
___
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] Z sorting multiple overlapping movie clips

2006-03-10 Thread Tyler Wright
:)   uh, a bit of code I've failed to remove.

Taken care of, thanks ... have you used it yet? Is it useful or would there
be any changes I could make to make it more so? I haven't actually had
anyone else use it before so any feedback (good or bad) would be
appreciated.

Tyler

On 3/8/06, eric dolecki [EMAIL PROTECTED] wrote:

 That class imports:

 import xt.core.*;

 which is nowhere to be found in the release :/



 On 3/8/06, Tyler Wright [EMAIL PROTECTED] wrote:
 
  Take a look at the XT DepthManager ( http://codext.com/code/6 ). It
 makes
  messing with depths like this really simple.
 
  Tyler
 
 
  On 3/2/06, Scott Pobiner [EMAIL PROTECTED] wrote:
  
   Karthik, Ramon, and all...
  
   When doing complex z-sorting ESPECIALLY when using V2 components, you
   should use the DepthManager class.  it makes life much easier.
   Essentially the DepthManager provides you with functionality for
   rearranging depths without explicitly stating the depth numbers...
   HOW you ask?!  Well it just so happens that DepthManager comes
   complete with a nifty, handy, dandy set of constants (i.e.
   DepthManager.kTop)  These constants place your chosen MC on a single
   level and consequently shifts all of the prior classes (up or down
   depending on the constant used).  BUT THAT'S NOT ALL!!  You also get
   free sorting algorithms for moving groups of MC's and components
   ABSOLUTELY FREE!
  
   The thing to keep in mind is that you can't use traditional
   attachMovie calls to move things to the stage dynamically, nor can
   you use items already on the stage with DepthManager.  The reason is
   because the DepthManager needs to know what it is sorting at loadtime.
  
   Here is a snippet example from one of my apps...
  
  
   /**CODE HERE**/
   import mx.managers.DepthManager;
   /*clipped for brevity*/
   // Create a container movie clip.
   _tools_mc = target.createChildAtDepth(_tools_mc,
   DepthManager.kTop);
   //
   //create a name label for this users screen
  
   _name_lbl = target.createClassChildAtDepth(Label,
   DepthManager.kBottom, {styleName:myStyle, color:0xDD, fontSize:
   72});
   //_name_lbl = _tools_mc.createClassObject
   (Label,_name_lbl,_tools_mc.getNextHighestDepth(),
   {styleName:myStyle, color:0x33, fontSize:72});
   _name_lbl.autoSize = left;
   _name_lbl.text =  ;
   _name_lbl.move(55,30);
   //
   //create _menuBar to show and hide color _dropDown
   _menuBar = _tools_mc.createClassChildAtDepth(MenuBar,
   DepthManager.kTop);
   _menuBar.setSize(Stage.width,_menuBar.height);
   /**CODE HERE**/
  
   Now to move these guys around all I have to do is call the depth
   modifiers to change things around...
  
   # DepthManager.setDepthAbove()
   # DepthManager.setDepthBelow()
   # DepthManager.setDepthTo()
  
   see the documentation for more info... http://livedocs.macromedia.com/
   flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?
   context=LiveDocs_Partsfile=3458.html
  
   Also, see this chattyfig thread...  http://chattyfig.figleaf.com/
   pipermail/flashcoders/2004-May/111796.html
  
   More info on managers from macromedia...  http://www.macromedia.com/
   devnet/flash/articles/component_architecture_06.html
  
  
   Hope this helps..
  
   S
  
--
   
Message: 4
Date: Thu, 2 Mar 2006 11:46:23 +0530
From: Karthik [EMAIL PROTECTED]
Subject: Re: [Flashcoders] Z sorting multiple overlapping movie
 clips
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1
   
why not mc.swapDepths(getNextHighestDepth() ) ?  Do you have that
many
movieclips?
   
That's what I'm doing.. but without getNextHighestDepth which is
 (was)
buggy when used with v2 components.
   
-K
   
   
--
   
Message: 5
Date: Thu, 2 Mar 2006 14:56:46 +0800
From: Ramon Miguel M. Tayag [EMAIL PROTECTED]
Subject: Re: [Flashcoders] Z sorting multiple overlapping movie
 clips
To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
Message-ID:
  [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1
   
mc.swapDepths(getNextHighestDepth() ) works with me.  It puts it
above the rest.
   
Parameters
   
target:Object - This parameter can take one of  two forms:
- A Number that specifies the depth level where the movie clip is to
be  placed.
- A String that specifies the movie clip instance whose depth is
swapped with  the movie clip for which the method is being applied.
Both movie clips must have  the same parent movie clip.
   
--
Ramon Miguel M. Tayag
Managing

Re: [FlashCoders] textfield swapDepths

2006-03-08 Thread Tyler Wright
I have a DepthManager that will take care of this. It adds the .swapDepths()
method to TextField and Button. More specifically, it replaces the
MovieClip.removeMovie() and TextField.removeTextField() methods so that they
work at whatever depth.

The DepthManager is self-instantiating, but you have to refer to is
somewhere in your code or Flash won't include it when you publish. So
instead of just doing an import (which doesn't force the class to be
included) you can refer to it directly: var dmClass =
xt.core.managers.DepthManager;

These methods aren't dirty, they're just necessary to overcome some of
Flash's shortcommings.
See http://codext.com/code/6

Tyler
___
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] Can you extend the _y and _height setters of amovie clip?

2006-02-08 Thread Tyler Wright
No, there is no way to do this by extending the MovieClip class.
Unfortunately the _x and _y are unique beasts, along with all the other
MovieClip properties from the Flash 4 days (such as enabled). You can't
watch them, create getters/setters for them, or even over-ride them. You
have to have a getter/setter x and y and inside those set the _x and _y.

If you're feeling creative and absolutely have to have _x and _y as the
properties to watch, then you're class can't be attached to the actual
sprite. You'd have to have a real sprite-based MovieClip referenced inside
the class that you manipulate. I know that probably doesn't make sense, and
it's a programming project you don't want to undertake, with a lot of
potential for problems and failure (I know). You'll have to use the x and y,
which always looks better anyway.

Tyler


On 2/8/06, Scott Hyndman [EMAIL PROTECTED] wrote:

 You could try watching _y and _height with Object.watch(), and adding the
 extra code in the observing functions.

 Scott

 -Original Message-
 From:   [EMAIL PROTECTED] on behalf of Morten
 Barklund TBWA\Play
 Sent:   Wed 2/8/2006 11:46 AM
 To: Flashcoders mailing list
 Cc:
 Subject:Re: [Flashcoders] Can you extend the _y and _height
 setters of amovie   clip?

 David Lochhead wrote:
  Hi,
 
  I've got a movieclip that can have it's _y and _height properties
  altered by various scripts. Is there a way I can extend the movieclip
  class so that the setter for these properties can be extended so I can
  act when the clip gets updated?
 
  Any advice appreciated.

 I've tried extending the enabled-property without luck. super.enabled
 = my_enabled doesn't really work. It would expect the same from _x and _y.

 I do hope someone can give other advice, but until then, I believe it is
 undoable. :(

 --
 Morten Barklund - Information Architect - TBWA\Play
 Gothersgade 49, 4th floor - DK-1123 Copenhagen K, Denmark
 Phone: +45 7027 2227 - Fax: +45 3369 1174
 ___
 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] How do you code your Flash applications?

2006-02-06 Thread Tyler Wright
 Why not pick a good, standardized
 way to manage depths that works in every scenario?


...tag, you're it!

Anyway, this has gone on long enough. If you haven't gotten the point
 yet you're never going to.


...I don't feel like playing anymore.


ok, let's not talk down to others who have good coding practices, even if
they're not your coding practices. It's a good discussion.

Managing the depths the way Ryan does it allows for a lot of control.
getNextHighestDepth can be limiting as you have to predict the appropiate
order of display items which can be problematic in a larger application. But
the manual method sounds even more limiting, labeling depths that not only
are now hard-coded in, but have to be understood and kept track of. I said
it before, order matters, relational depths and not numbers.

This is something that everyone has to deal
 with, and I genuinely thought that others would make more use of
 getNextHighestDepth()


I have my own solution, but everyone else I know of uses getNextHighestDepth.
Those who don't are the proud exception.

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


Re: [Flashcoders] Re: Setting the last pressed key in the Key class

2006-02-06 Thread Tyler Wright
Define your own static MyKey class and have it subscribe as a listener to
Flash's Key. It can then be your applications Key class. Meaning your
objects listen to MyKey while MyKey listens to Key. Then MyKey can at
anytime listen to something else that feeds it input. There's nothing magic
about the Key class you can't use the MyKey class for. MyKey can then also
store the last key pressed (whether it was a real key from the Key class or
a virtual key from somewhere else).

Good luck,
Tyler

On 1/25/06, elibol [EMAIL PROTECTED] wrote:

 I have another idea, would it be possible to delegate Key class functions
 to
 a custom class I've built?

 I've tried

 _global.ASSetPropFlags(Key,null,6,true);

 It still doesn't allow me to delegate the functions. Does anyone know of a
 way around this?

 H
 ___
 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] How do you code your Flash applications?

2006-02-04 Thread Tyler Wright
 The whole idea is that you keep
 things at *predictable*, and whenever possible explicitly defined, depths
 so
 that things are easy to manage. If you need getNextHighestDepth, that
 means
 you don't know what the current highest depth being used is, and that
 means
 you aren't in control of the z-depth of your objects. That's a bad thing.


Yes, keep things predictable, and easy to manage.  There are only two
reasons you need control over the z-depth of your display object:

1) to visually layer your objects for appropiate overlapping of the
items relative
to each other.  (usually after you z-position your objects to begin with you
don't touch them again except in the case of floating windows or similar,
which requires a 'put me on top' behavior)

2) to keep from accidently removing a display object through duplicate
depths.

I've also always had to know exactly what depths my display objects were, as
I am generally more of the control friek.  But I realized that I also lay
out a lot of my visual elements in the Flash IDE and never seemed to care
about the actual depth # in that setting.  It was enough to know how
everything was z-ordered the way I wanted in relationship to each other.

I finally made my own DepthManager, which provides for extreme depths for
cursors and tool-tips like MM's vs2 components, but without screwing up
getNextHighestDepth() for those who would still use it. (

API:
MovieClip.bringToFront();
MovieClip.bringForward();
MovieClip.sendBackward();
MovieClip.sendToBack();

where
MovieClip.bringForward();
MovieClip.sendBackward();
can have one parameter, either of type MovieClip or type Number
MovieClip:  brings the calling MC directly in front of the argument MC, or
sends directly behind
Number:  brings or sends calling MC forward or backward x number of steps.
In the case of a 0, bringForward(0) would bring the MC to the front,
sendBackward(0) to the back.  In the case of a negative number,
bringForward(-2) would bring the MC to the front minus two, or 3rd from the
top of the visual stacking order.

this provides for complete control in arranging visual objects in any order,
relative to each other by name and/or by stacking order.

I've never needed to know or care about keeping track of depth numbers
since, though that doesn't mean I don't keep track of z-order (relational).
And frankly I don't have the time or patience anymore to always be managing
depth details when there's so much more to worry about.  I would hate having
all of my classes cluttered with two properties for every one visual object.

private var vScroll:ScrollBar;
private var vScrollDepth:Number;

I'll try and get my code cleaned up a bit (I've been bad and not fully
commented the class) for anyone interested.  It will still allow you to set
depths explicitly, as well as a padding that is currently at 2 or 3, but
could be changed to 10.  To be honest, I haven't yet found an instance where
I've needed the depth number explicitly, but it's available.  This and other
classes that simplify implementation are one of the best ways to keep your
code clean.

Tyler

ps oops, didn't realize I wrote so much.
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] using MCL to keep track of total bytes loaded.

2006-02-04 Thread Tyler Wright
 No, you will have problems with that implementation.


True.  To make it work, just change up a few things:

mainMclListener.onLoadProgress = function( targetMC, loadedBytes,
totalBytes)
{
   // loadedWeight will increment only once per MC, after it is fully
loaded

   // currentLoaded will tell us the loadedWeight from previous SWFs
combined with this ones progress
   var currentLoaded = loadedWeight + loadedBytes;
  // then do a test to find out the percentage currentLoaded is of
totalWeight. i need to know when it's reached 10%, 20%, 30%, etc...
}

mainMcListener.onLoadComplete = function( targetMC )
{
   var progress = mainMcListener.getProgress( targetMC );
   loadedWeight += progress.bytesTotal;
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How to alter all movieClips with as2

2006-02-04 Thread Tyler Wright
 ?


hmmm, we all seem to be speaking in short half sentences, or punctuation.

The prototype property is fully accessible in AS2, and because of general
shortcommings in Flash.

(MovieClips, for example, are a cross-breed of the common prototype-based
class and a sprite of magic underscored properties carried over from the ver
beginnings of Flash)

Macromedia uses the prototype for their vs 2 components' DepthManager class:

function DepthManager()
{
MovieClip.prototype.createClassChildAtDepth = createClassChildAtDepth;
MovieClip.prototype.createChildAtDepth = createChildAtDepth;
...
_global.ASSetPropFlags(MovieClip.prototype,
createClassChildAtDepth,1);
_global.ASSetPropFlags(MovieClip.prototype, createChildAtDepth,1);
...

I suggest using it sparingly.  Make sure adding it to the prototype is the
only thing that makes sense.  This because it's always hard to track down
bugs added to the prototype when they could have been added from anywhere.

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


Re: [Flashcoders] How to alter all movieClips with as2

2006-02-04 Thread Tyler Wright

 The prototype property is fully accessible in AS2, and because of general
 shortcommings in Flash.


uh, it might help to finish my own sentences.  correction:

...and because of general shortcomings in Flash it is sometimes necessary,
even if not recomended.

...continue

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


Re: [Flashcoders] Binary IO ?

2005-12-27 Thread Tyler Wright
Reading yes, in ActionScript 3.0 which is currently in public Alpha and
private Beta.  In fact, the new DOM for AS3 offers the same power of
streaming in files that the player uses for SWF's.  So you can ask for a
file, stream in a small portion (whatever you need) close the connection,
and start up again where you left off when you need more!  This is very
exciting for situations that require large amounts of data to be transfered,
the user doesn't have to wait for the whole thing to be able to benefit from
it.

Writing, not without an additional script or application.  If you embed
Flash in a standalone application (exe) it can do the writing for you.
Server side all you need is a simple script that Flash sends the binary data
to that writes it to disk.  For writing Flash forces you to couple with
other technologies.

Prior to AS3 binary handling has been hard to work with and slow.
Everything has to be read into a string and it can get messy with
null-terminating characters.  Hope this helps.

Tyler


On 12/27/05, Mark Ribau [EMAIL PROTECTED] wrote:

 Is it possible to do either local computer or local website binary file
 reading and writing in Flash?
 --
 Mark Ribau
 Lead Windows Developer | My Tech Blog
 http://www.redbugtech.com/blogs/mark.php
 Redbug Technologies, Inc. http://www.redbugtech.com - www.redbugtech.com
 ___
 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] SWF 2 PNG

2005-12-27 Thread Tyler Wright
Easiest solution for me would be to import the swfs into the Flash Authoring
Environment which has an export image option.  It ususally does a decent job
from what I remember.  If you're talking about batching thousands of these
things, perhaps someone has a JSFL script that can tell Flash to do this for
you.  The JSFL is just javascript that gives instructions to the Flash
Authoring Environment to do the same tasks you'd do by hand.  It's been a
lifesaver to me in the past.

Tyler

On 12/26/05, D_C [EMAIL PROTECTED] wrote:

 hi -

 with Flash8 is it possible to screenshot an area of the screen and
 output it to a bitmap file?

 If not, would appreciate recommendations for tools that can do this
 automatically, or from command line. i need to create a GIF catalog of a
 whole bunch of SWF files...

 /dc
 ___
 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] Javascript + flash

2005-12-27 Thread Tyler Wright
 Is there security issue?



Flash security is a blessing and a curse.  It's often difficult to work
around for developers.  Try setting the allowScriptAccess in both the object
and embed tags to always and see if that helps.

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


Re: [Flashcoders] Who wants MIDI in the Flash Player?

2005-12-14 Thread Tyler Wright
I should be the one to thank you guys.

Anyone also know the link the the MM wish list?

Tyler

On 12/13/05, Weyert de Boer [EMAIL PROTECTED] wrote:

 Yeah, looks nice!
 ___
 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] Who wants MIDI in the Flash Player?

2005-12-14 Thread Tyler Wright

 I haven't checked various pocket devices on MIDI recently, but the
 problem on desktops has been when you get varying capabilities on
 various platforms, so that the same MIDI file can sound different on
 different machines.

 jd


I understand that there are various complications, especially when building
a cross platform browser plugin like Flash.  What else do you need from us
to decide if this is a worthy investment?  Some of the developers on this
list could perhaps build a viable solution for you but in the end it has to
be the Flash Player team that makes any sort of commitment.  Maybe in a
seperate forum some of the more experienced developers (I'm not one of them)
could help advise/consult on more in-depth technicalities.

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


Re: [Flashcoders] Who wants MIDI in the Flash Player?

2005-12-09 Thread Tyler Wright
I know people who know what they're talking about.  ;)

I've been fortunate enough to work on a project with some amazing developers
and experience the difficulty it is to get Flash to communicate with other
applications.

Thank you everyone for the great response.  I will put together a summary of
this conversation and respond or post it to my blog for your approval.  I
want to make sure it's a fair and unbias (as much as possible)
representation of the developer community before I send it off.

Thanks again!

Tyler

On 12/8/05, hank williams [EMAIL PROTECTED] wrote:

 Well, its basically what tyler describes but using binary sockets
 instead of xml sockets. The binary socket is just more efficient. I am
 not sure what the issues are in implementing any of this since I am
 not a midi guru, so I cant provide to much detail. Sounds like tyler
 knows what he is talking about.

 Regards
 Hank

 On 12/8/05, Jason Cunliffe [EMAIL PROTECTED] wrote:
  Hank
 
  Can you expand on that idea please. Sounds interesting...
 
  thanks, Jason
 
  - Original Message -
  From: hank williams [EMAIL PROTECTED]
  To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
  Sent: Thursday, December 08, 2005 3:26 PM
  Subject: Re: [Flashcoders] Who wants MIDI in the Flash Player?
 
 
  Of course, in thinking about this, with the new binary socket
  functionality, midi control could all be done by just writing a simple
  localhost to midi gateway. This would be pretty simple to do, and is
  probably what is needed anyway to deal with different drivers etc. And
  it makes total sense that if you want to control some local hardware
  that you need to download a piece of software.
 
  problem solved!!  :)
 
  Regards
  Hank
 
 
  ___
  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] Who wants MIDI in the Flash Player?

2005-12-08 Thread Tyler Wright
We built a MIDI sequencer for the PC that talks to Flash through an
XMLSocket (though we just send smaller strings, not XML).  On both Mac and
Windows versions the code to make a sequencer capable of changing
instruments, transposing, changing tempo, and indivudual volume of
instruments, etc. was less than 70K.  There are API's for each OS that
abstract the different hardware and allow for such small implementation.

The great thing about Alexis Isaac's MIDI Sequencer is that you can
buildmusic on the fly based on user interaction.  We could have easily
streamed
MP3's from the server with a better sound if we wanted to be static.  We
even looked into building MP3's on the server dynamically, but the smallest
process we could find would be at least 3% processor per song.  That sounds
small, but it means 33 users geting sound simultaneously is 99% processor.
It absolutely has to be on the client.  It would be a great solution to
avoid requiring an additional download from a less-known source than
Macromedia/Adobe and immediately integrate dynamic sound into your
applications.

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


Re: [Flashcoders] where and how can I learn actionscript bytecode

2005-12-07 Thread Tyler Wright
It's not going to delete because somewhere else in your code you have a
reference to that object.  For example:

var myObj = new A();

myObj.destory(); // won't be deleted until myObj no longer points to the
class.

If you really have your heart set on following something a little more OOP,
try this.

class A
{
public static var instance:A = new A();

private function A()
{
// construct
}

public function destroy()
{
delete instance;
}
}

a singleton that will destroy it's own reference.  Then the code is within
the class.  The problem now is that you're required to always reference this
class through the static class

A.instance.doSomething();
A.instance.destroy();

Flash is getting better (garbage collection model changes) with AS 3.0, but
for AS 2.0 you're stuck.

Tell me what you want to do in destroy and Ill bet there's a better
solution that is still OOP.  If it's just to delete the object then there's
no reason to have the method.  Sorry.

Tyler

On 12/4/05, Alias [EMAIL PROTECTED] wrote:

 Hi Boon,

 Good luck with learning bytecode.

 However, I suspect that the reason your first delete statement doesn't
 work is because of the way flash's garbage collection works. When you
 call delete on an object, it is marked for deletion by the garbage
 collector. It uses reference counting to decide whether to actually
 delete something, so I suspect that if you try to delete an object
 from within itself, it most likely will not actually do so, until that
 object has finished up. I'd say you should probably always try to
 delete objects from outside of their own scope.

 It's likely that if this is indeed the case, the problem will look
 exactly the same at the bytecode level.

 Hope this sheds some light on your problem,
 Alias
 On 12/3/05, Boon Chew [EMAIL PROTECTED] wrote:
 
  Is there any tools or documentation out there that
  will aid in learning actionscript bytecode?
 
  I ran into this the other day, and it seems like only
  reading the bytecode can help me understand why it
  doesn't work?
 
  class A
  {
 function destroy()
 {
delete this;  // doesn't delete itself
 }
  }
 
  var a = new A();
  delete a;  // delete works here
 
  - boon
 
 
 
  __
  Start your day with Yahoo! - Make it your home page!
  http://www.yahoo.com/r/hs
  ___
  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] How to make a class instance self-destructible?

2005-12-06 Thread Tyler Wright
mc.onEnterFrame = function() {
trace(hit);
delete this.onEnterFrame;
}

Try this one on for size.  You'll only get one (1) hit trace out to the
output window.  If you have actions following the delete they'll still get
called before the method is deleted.

mc.onEnterFrame = function() {
delete this.onEnterFrame;
trace(hit);
}

you still get hit traced out once in the output window.

Cicak you're right: if they have reference counting in place, they can
delete object the moment its ref count is zero

This is the Flash Player garbage collection right now.  Gary Grossman gave a
great talk at the MAX conference explaining the difference between the
reference counting GC in the current player and the new GC coming in FP 8.5.
Because it's the reference counting system I'm afraid you can't delete an
object this way if there's other references to it.  The reason onEnterFrame
can delete itself is because it's deleting the single reference the system
has to it.

Solution:

since Flash takes care of garbage collection, you don't need special
clean-up procedures (this is why other languages have something like
destroy)  Forget about OOP usuals and garner the strength provided by a
dynamic language (ie just say delete myObj; instead of the OOP required 
myObj.destroy();).

The more I develop the more I find that OOD (object oriented design,
designing your system well) is much more important than OOP (following all
the rules, applicable or not, for the sake of being as much like Java as
possible)

Tyler

On 12/4/05, Hans Wichman [EMAIL PROTECTED] wrote:

 ps boon, one fast way to verify on windows:
 - repeat your action 10 times in a for lus with the taskmanager open

 If the memory you use is being recollected you will see your application
 eat memory and release it, eat it and release it etc if not, it will just
 be hogging memory until it hangs...
 quick and dirty ;)


 At 02:12 AM 12/4/2005, Boon Chew wrote:
 Good stuff Steven, I am glad I asked this question (and David's reply is
 great).
 
Is there a way to verify that the onLoad is indeed orphaned in the VM
  memory pool?
 
 
- boon
 
 
 Steven Sacks [EMAIL PROTECTED] wrote:  Here is something more for you
 to chew on:
 
 If you assign say an onLoad method to an object, and don't delete the
 onLoad
 before you delete the object, the onLoad method is orphaned and since the
 reference to the object is gone, it does not get cleaned up by the
 garbage
 collector, and remains in memory with no way to get to it.
 
 For example (AS1 code used here):
 
 foo = new XML();
 foo.onLoad = function(valid) {
   if (valid) {
// xml loaded successfully
   } else {
// xml load error
   }
 }
 
 If you:
 
 delete foo;
 
 the foo.onLoad method stays in memory.
 
 You have to
 
 delete foo.onLoad;
 delete foo;
 
 to really get rid of foo.
 
 Objects cannot delete themselves, nor can they call another object to
 delete
 them because technically you're still in the same operation thread.  It
 has
 to be done independantly outside the object you're trying to delete.
 
 The way I get around this is:
 
 xmlHolder = {};
 var id = new Date.getTime();
 xmlHolder[id] = new XML();
 xmlHoLDer[id].onLoad = function(valid) {
   if (valid) {
// xml loaded successfully
   } else {
// xml load error
   }
   this.complete = true;
 }
 
 I assign a complete = true property.  Then, I have my own little clean up
 tool running, checking for complete xml loads:
 
 for (var o in xmlHolder) {
   if(this.xmlHolder[o].complete) {
delete this.xmlHolder[o].onLoad;
delete this.xmlHolder[o];
   }
 }
 
 The clean up tool is running in a separate thread therefore it can delete
 other xmlHolder without issue.
 
 HTH,
 Steven
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
 
 
 -
   Yahoo! Personals
   Skip the bars and set-ups and start using Yahoo! Personals for free
 ___
 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] Who wants MIDI in the Flash Player?

2005-12-06 Thread Tyler Wright
The Flash Player has evolved through the ages to provide the most needed
functionality.  Through each version there have always remained a few common
goals.  What I have found is that:

Flash is small -- from the player itself to the swf file format to the
assets it is optimized to load, focus has been placed on small file sizes
(this of course is not as apparent in many websites that are heavy in
multimedia)

Flash supports standards -- the player supports many web and multimedia
formats standard in the industry, such as jpg, mp3 and xml

Flash is interactive -- the players greatest strength is the dynamic
behavoir through ActionScript to allow user interactivity

MIDI, a music standard format that most computers support today, fits all of
these categories (like a glove).  In fact there's an opensource project
being developed to allow MIDI through Flash, though it requires an
additional download and install to the user apart from the Flash Player
itself (seen at osflash.org)

I'd like to take a poll.  Do you think MIDI should be included in the Flash
Player?  Why or why not?  I want both votes and opinions as I'll organize
the results and send them off to Adobe, formerly known as
Macromediahttp://www.macromedia.com.
Please respond with some sort of opinion whether it's pro or con.  I'll list
the pros/cons I can think of below (you don't have to read the rest of this
email if you already have your opinion).

A little more on MIDI:
MIDI is a standard music format (some will argue that it's the
onlystandard) that represents pitches and instruments to be played as
a song.
It's extremely small, being the vector of music, and has to be interpreted
by a users soundcard.  Almost all computers these days support standard
MIDI, though it sounds synthesized (especially on the voice and string
instruments).  Some soundcards or additional software transform the common
MIDI into amazing orchestrations, but most users don't have this advanced
playback.

MIDI pros:
can be generated dynamically and played through a sequencer to allow
complete on-the-fly customization of sound.
very small in filesize
supported by almost all soundcards
numerous applications for the creation of MIDI songs (many are free)
it's a standard that has been around for a long time (so there is a lot of
support for it)
a small implementation (wouldn't increase the Flash Player size by more than
50K)

MIDI cons:
most people will have a more synthesized sound
user experience isn't guarenteed to be consistant (for those with higher
quality soundcards)
as with all advancements, could make it really easy for developers to have
annoying sounds playing on their sites ;)

In short, if the Flash Player had a midi sequencer built in it would allow
developers to create lightweight interactive music applications, such as this
sheet music rendering application http://mediarain.com/musicrain or music
creation applications.  It could also allow users to experience a website
that contained sound effects or decent background music at very little
bandwidth cost.  Formerly know as Macromedia has always been good about
listening to the developer community and will surely make efforts to build
the features we need, if we tell them.  This is your forum.

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


[Flashcoders] Re: targeting classes in a loaded swf

2005-12-06 Thread Tyler Wright
Cole,

Ha ha, thank you for the compliments.  The good news is you shouldn't have
to use the same agreed upon name.  Thats the great thing about singleton!

for example

main.swf loads in ui.swf

when ui.swf is loaded it has on it's timeline something like:
obj:UI = UI.getInstance();

right?  So now the 'obj' object in ui.swf is the one instance of UI that can
exist (singleton).

so later, when main.swf asks for the same thing:

// calling it 'myUIObj' cause I can
var myUIObj = _global.UI.getInstance();// instance is defined, so we get
the same object that was defined on ui.swf's timeline

it returns the single instance of UI, or ui.swf's 'obj' object.  So test it
by inserting this code

trace(myUIObj == ui_mc.obj);  // returns true -- they are the same instance
of the UI class

This works because your agreed upon point of reference is the class UI.  As
long as you've implemented singleton correctly you can from get that same
object from anywhere.

Note:  This works because AS 2.0 classes are defined on the _global object.
If your class is in a package you'll need to reference it through the
package objects like this:

myUIObj = _global.package.subpackage.UI.getInstance();

also, the reason you use _global.packagename.classname instead of simple
importing the class and referencing it directly is so that Flash doesn't
compile the UI class (and every other class it references) in both swfs.  It
should only be compiled in ui.swf and simple be referenced in main.swf.

I really hope this all makes sense.  If not I know there's some great
articles out there.  Watch the Singleton tutorial by Rob Taylor (
http://www.flashextensions.com) in the Design Patterns section.  It's really
helpful.

Play around with it a bit and see what you get.  Good luck!

Tyler


On 12/4/05, Cole Peterson [EMAIL PROTECTED] wrote:

  Thanks a lot for your time Tyler Wright.
  That helped a lot!

 I have implemented your suggestion. singleton. everything is great.
 My controller loads in the swfs that make up the diff parts of the app.

 The only disconnect is that all swfs have to agree to implement their ui
 using ...
 for example  the name 'obj'.

 var obj:Someclass
 obj = Someclass.getInstance();
 then my controller can target that class in any swf by using the mc that
 it loaded the swf into and calling

 mc.obj.getInstance().doSomething();

 or just

 mc.obj.doSomething();

 Does that make sense or am I missing something?

 If the above does make oop sense I now have a controller that loads in
 swfs and can then create pointers, if needed, to the main UI object in each
 swf. The only problem I see is forcing the use of an agreed upon name.


 Thanks again!
 Cole



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


Re: [Flashcoders] targeting classes in a loaded swf

2005-12-03 Thread Tyler Wright
Of course you want to retain a synchronous relationship (much faster than
LocalConnection).

I'm not sure if this UI object you create is a singleton but the best way to
handle this situation is to use it's class to hold a static pointer to the
instance.

for example

class UI {
private static var instance:UI;
public static function getInstance():UI {
if (instance == undefined) {
instance = new UIController;
}
return instance;
}
}

on frame 1 of the swf: var ui = UI.getInstance();

same thing in your controller: UI.getInstance();

even if it's not a singleton you can use a similar method with only some
minor tweaks.

class UI {
public static var instance:UI;
function UI() {
 if (instance == undefined) {
instance = this;
}
}
}

this way your class will hold a reference to the first instance created, and
you'd still have on your timeline:

var ui = new UI()

This is the perfect way of getting a reference to a major object because now
the instance and class are always shipped together, one nice little
package.  Your AS 2.0 classes are defined on the _global object so everyone
has reference to them, and you're not making some extra (non-oop) reference
floating on the _global object that you can't track where it came from or
who's using it.

hope this helps!

Tyler


On 12/3/05, Mike Britton [EMAIL PROTECTED] wrote:

 I'd look into LocalConnection.  It sounds like you're trying to figure
 out how to avoid dependencies between objects, which (to me) makes
 sense.  Rather than over-design and make things work in a complicated
 way, you can use LocalConnection to init your child clips from your
 controller:

 receiving_lc = new LocalConnection;

 receiving_lc.init = function() {
 this.c.init(); // Calls your clip's init
 };

 receiving_lc.connect(lc_name);

 In your main application:

 var sending_lc2:LocalConnection = new LocalConnection();
 sending_lc2.send(lc_name, init);


 hth,

 Mike
 ___
 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] Detecting when a swf loses focus

2005-11-23 Thread Tyler Wright
Basically, the event is onBlur

Yes, if you've followed the discussion you'd know that onBlur is has been
the attempted solution.  It just doesn't work when Flash has focus ... the
browser seems to miss the onblur if you click on Flash (giving it focus) and
then click outside the window (when the onblur should trigger)

has no one had experience overcoming this?

Tyler

On 11/11/05, Steven Sacks [EMAIL PROTECTED] wrote:

 There is code out there used to fake modal dialogs in a browser that
 checks
 if a browser window loses focus and forces the window to take focus again.

 Really, a google search will help you on your way.  Writing JS isn't too
 difficult if you know AS1.

 http://www.eggheadcafe.com/articles/javascript_modal_dialog.asp

 Basically, the event is onBlur.

 body onBlur=myLoseFocusFunction();

 function myLoadFocusFunction() {
 -- tell flash something if you want
 -- or handle it directly in the browser
 -- like alert(You have attempted # times to exit the test);
 -- and on the threshold, you can load another page that doesn't
 have
 -- the flash anymore
 }

 I'm sure there's an easy solution to what you're trying to do.

 -Steven




  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf
  Of Tyler Wright
  Sent: Friday, November 11, 2005 2:47 PM
  To: Flashcoders mailing list
  Subject: Re: [Flashcoders] Detecting when a swf loses focus
 
  We are looking for a solution to this issue as well. It would
  be a great
  help in DRM (Digital Rights Management) to keep not just test
  takers honest.
 
  Anyone yet have a strong enough knowledge of the browser and
  JavaScript to
  crack this one?
 
  Tyler
 
  On 11/8/05, Muzak [EMAIL PROTECTED] wrote:
  
   Mmmm, mind explaining the buggy, unstable and CPU hogging?
  
   If you have any problems with screenweaver you can always
  join the mailing
   list or visit the forum:
   http://osflash.org/mailman/listinfo/screenweaver_osflash.org
   http://www.screenweaver.org/forums/index.php
  
   regards,
   Muzak
  
   - Original Message -
   From: Steven Sacks [EMAIL PROTECTED]
   To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
   Sent: Tuesday, November 08, 2005 11:00 PM
   Subject: RE: [Flashcoders] Detecting when a swf loses focus
  
  
Use a 3rd party wrapper like mProjector.
   
http://www.binarynoise.com/
   
Way better than the buggy, unstable and CPU hogging Screenweaver.
   
-Steven
  
  
   ___
   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


Re: [Flashcoders] Detecting when a swf loses focus

2005-11-11 Thread Tyler Wright
We are looking for a solution to this issue as well. It would be a great
help in DRM (Digital Rights Management) to keep not just test takers honest.

Anyone yet have a strong enough knowledge of the browser and JavaScript to
crack this one?

Tyler

On 11/8/05, Muzak [EMAIL PROTECTED] wrote:

 Mmmm, mind explaining the buggy, unstable and CPU hogging?

 If you have any problems with screenweaver you can always join the mailing
 list or visit the forum:
 http://osflash.org/mailman/listinfo/screenweaver_osflash.org
 http://www.screenweaver.org/forums/index.php

 regards,
 Muzak

 - Original Message -
 From: Steven Sacks [EMAIL PROTECTED]
 To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com
 Sent: Tuesday, November 08, 2005 11:00 PM
 Subject: RE: [Flashcoders] Detecting when a swf loses focus


  Use a 3rd party wrapper like mProjector.
 
  http://www.binarynoise.com/
 
  Way better than the buggy, unstable and CPU hogging Screenweaver.
 
  -Steven


 ___
 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