Re: [Flashcoders] movement

2008-04-08 Thread Cory Petosky
My buddy and I were playing with some performance benchmarks we wrote
(put 100 bitmaps on the screen by manual blits to a backing
BitmapData). We weren't surprised that it ran stably at 120 FPS in the
Flash IDE. We were alarmed to discover, however, that the same SWF ran
at a mere 80 FPS in the Flash standalone player and was just under 60
FPS when viewed in the browser.

Windows XP, Flash CS3 Professional, IE7.

On Tue, Apr 8, 2008 at 3:20 PM, David Rogers [EMAIL PROTECTED] wrote:
 if you are on a mac, try enabling or disabling rosetta in the info panel of
 the application icon

  On Apr 8, 2008, at 2:41 PM, Lehr, Theodore M (N-SGIS) wrote:



  I have a mc I am moving via AS - it moves at a fine pace in the player
  inside flash - but when I view it via the browser, it really slows
  down... why would this happen?
 
 
 
  ted
 
  ___
  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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Reading properties of a textbox [AS3]

2008-04-03 Thread Cory Petosky
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
   



   --
   -jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
   ___
   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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] books for flash programming

2008-04-03 Thread Cory Petosky
That's not true. I'd say the majority of Flash coders I've met in real
life are pretty awful at AS3, and they're not worth hiring. Yet, they
get hired, because there's not enough Flash programmers to go around,
and the theory (in marketing agencies, anyway) is that a bad Flash
programmer is better than no Flash programmer at all. Beyond that,
most small marketing agencies can't tell a good Flash programmer from
a bad one anyway.

Knowing multiple languages well is a good indicator that you're a good
Flash programmer. This is not a causation statement, merely a
correlation. There are undoubtedly people who know multiple languages
who suck at Flash programming. Similarly, there are definitely people
who only know AS3 but are great Flash programmers. Nevertheless, in my
experience, the guys who have learned multiple languages (myself
included) understand the strengths and weaknesses of AS3/Flash much
better, on average, than those who have only ever used AS3/Flash.

In the end, though, the advantage to learning multiple languages is
that you'll be better at what you do. No question. It's been common
knowledge among programmers since the 1970s.

On Wed, Apr 2, 2008 at 6:38 PM, Muzak [EMAIL PROTECTED] wrote:

  Not to mention that a programmer who knows AS3, Java, and Lisp is
  immensely more valuable than one who just knows AS3. It proves you
  have the capacity to learn, which is a very marketable trait.
 
 

  BS.. Doesn't prove a thing..
  Someone who *just* knows AS3 may have - scratch that - *has* the capacity
 to learn any other language, but may never have had the need to.

  - Original Message - From: Cory Petosky
 [EMAIL PROTECTED]
  To: Flash Coders List flashcoders@chattyfig.figleaf.com
  Sent: Wednesday, April 02, 2008 11:54 PM

  Subject: Re: [Flashcoders] books for flash programming



  A native English speaker, when learning German, will generally remark
  Wow! Because of this feature in German, I now understand English a
  little better.
 
  Programming languages are the same way. Learning another
  object-oriented language will help you identify how features in
  ActionScript work (or don't work). And learning a language from
  another paradigm entirely (functional or procedural, probably) will
  help you identify weaknesses and strengths of object-oriented
  programming.
 
  Not to mention that a programmer who knows AS3, Java, and Lisp is
  immensely more valuable than one who just knows AS3. It proves you
  have the capacity to learn, which is a very marketable trait.
 
 


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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] books for flash programming

2008-04-02 Thread Cory Petosky
A native English speaker, when learning German, will generally remark
Wow! Because of this feature in German, I now understand English a
little better.

Programming languages are the same way. Learning another
object-oriented language will help you identify how features in
ActionScript work (or don't work). And learning a language from
another paradigm entirely (functional or procedural, probably) will
help you identify weaknesses and strengths of object-oriented
programming.

Not to mention that a programmer who knows AS3, Java, and Lisp is
immensely more valuable than one who just knows AS3. It proves you
have the capacity to learn, which is a very marketable trait.

On Tue, Apr 1, 2008 at 2:05 PM, Alan MacDougall
[EMAIL PROTECTED] wrote:


  On 3/24/08, Naveen Bhaskar [EMAIL PROTECTED] wrote:
 
 
   Hi,
  
   I am a flash designer and I am in intermediate in programming.(AS2).
  
   anybody pls tellme what are the good books I can refer.
  
  
 

  And remember, just learning Actionscript in particular will not teach you
 programming in general. Jeff Atwood has an excellent list of books on topics
 essential to all programmers, even Actionscript programmers:
 http://www.codinghorror.com/blog/archives/20.html

  And if you really want to be a programmer, learn more than just
 Actionscript! A scripting language like Python, Ruby, or Perl will be
 extremely useful to you even as Flash developer -- but you'll never realize
 it until you've learned one.


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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Variable scope within for loops: reusing iteratorvariables

2008-03-28 Thread Cory Petosky
It's valid both in a frame script in an IDE and in an AS3 class
compiled via mxmlc. I suspect it's also valid in an mx:script block,
but I didn't bother testing.

Actually give it a try before telling me it doesn't work. :)

On Thu, Mar 27, 2008 at 6:59 PM, Steven Sacks [EMAIL PROTECTED] wrote:
 Valid where?  If that's in a class function and i is not a class
  variable, then the compiler will complain that you're using an
  undeclared variable.


  Cory Petosky wrote:
   I guess I should have provided an example when I mentioned no block
   level scoping. Try this on for size:
  
   for (i = 0; i  10; ++i); // Do nothing but increment i
   var i:int;
   trace(i);
  
   This is totally valid code and will trace 10! ALL variable
   declarations in a function, regardless of the block the variable is
   declared in, are performed as the function is pushed on the stack.
  



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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Krugle?

2008-03-28 Thread Cory Petosky
I've used Google Codesearch http://www.google.com/codesearch with
some success. I'm not sure which of the two tools is better, but
krugle is certainly prettier.

On Fri, Mar 28, 2008 at 10:26 AM, eric e. dolecki [EMAIL PROTECTED] wrote:
 Anyone ever use Krugle.org to search for AS source code?
  I just ran into the site, and I am not sure what to think yet. For other
  languages it might be better, but I'm currently unsure without spending time
  in the system. The search results and tabbed interface, etc. is pretty sweet
  though.
  - eric
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Variable scope within for loops: reusing iteratorvariables

2008-03-27 Thread Cory Petosky
I guess I should have provided an example when I mentioned no block
level scoping. Try this on for size:

for (i = 0; i  10; ++i); // Do nothing but increment i
var i:int;
trace(i);

This is totally valid code and will trace 10! ALL variable
declarations in a function, regardless of the block the variable is
declared in, are performed as the function is pushed on the stack.

Cory

On Thu, Mar 27, 2008 at 3:47 PM, jonathan howe [EMAIL PROTECTED] wrote:
 I wish it did.

  Maybe at least one person saying that was what I was looking for... Thanks
  for the discussion!



  On Thu, Mar 27, 2008 at 4:22 PM, Ian Thomas [EMAIL PROTECTED] wrote:

   AFAIK, in AS2 the Flash IDE didn't respect block level scoping, but
   MTASC did, which led to some confusion. That leads some people to
   think that AS2 as a language has block level scoping.
  
   AS3 definitely doesn't respect block scopes, and I curse every time I
   trip over that 'variable declared twice' issue. I wish it did.
  
   Ian
  
   On Thu, Mar 27, 2008 at 8:09 PM, Juan Pablo Califano
   [EMAIL PROTECTED] wrote:
for (var i:int = 0; i  10; i++)
   
{
  if (i == 5) break;
 }
 trace(i);
   
 Mmm, have you actually tested the example? Because it does trace 5,
   since,
 as it was explained earlier in this thread, there is no block level
   scoping
 in AS 3.0. In fact, and this was mentioned too, all var declarations
   are
 moved up to be executed as the first actions run in a function's code
   (I
 believe that was called hoisting, but I might be wrong).
   
 Cheers
 Juan Pablo Califano
   
 2008/3/27, Steven Sacks [EMAIL PROTECTED]:
   
   

  function doSomething
   {
 var i:int;
 for(i=0;i++;i10)
 {
 }
   }
  
   Is functionally identical to this:
  
   function doSomething
   {
 for(var i:int =0;i++;i10)
 {
 }
   }
 
  Wrong.  It's not.
 
  In the latter example, i is not available after the loop.  In the
   first
  example, it is.
 
  var i:int;
  for (i = 0; i  10; i++)
  {
if (i == 5) break;
  }
  trace(i);
  -- 5
 
  There are a multitude of uses for this, and I do it all the
  time.  Additionally, I read somewhere many moons ago (back in my
   FLASM days)
  that declaring variables outside a for loop is less bytecode and uses
   less
  memory.  I don't believe that applies to the counter declaration, but
   I do
  know it applies to the comparison as well as vars declared inside the
   for
  loop.  However, this level of optimization is only useful in a
   practical way
  on mobile and some games.
 
  ___
  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
  




 --
  -jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
  ___


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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Variable scope within for loops: reusing iterator variables

2008-03-24 Thread Cory Petosky
Jonathon:

In any other language, the scope would be as you describe. AS3 doesn't
have block-level scoping -- the most local scope is always the
function. Declaring a variable anywhere but the first line of a
function is a lie -- the VM declares all variables as the first set of
operations after pushing the function call on the stack.

On Mon, Mar 24, 2008 at 7:36 AM, Andrew Sinning [EMAIL PROTECTED] wrote:
 You are correct Jonathan, but loop blocks are delimited by brackets, so
  the for ( ... ) declaration is outside of the loop block.


  jonathan howe wrote:
   I had always thought that the scope of variables declared in the
   initialization part of the for loop were local to the loop block



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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Tweening Engines for AS3

2008-03-24 Thread Cory Petosky
TweenLite doesn't have bezier curve support, can't store the duration
in the options object, doesn't support auto-rounding of pixels, and
has significantly fewer transition options. I think TweenLite is great
-- if I ever need to tween 1200 things at once, I'll certainly choose
it -- but these features in Tweener make it a better choice for many
of my projects.

On Mon, Mar 24, 2008 at 1:16 PM, Steven Sacks [EMAIL PROTECTED] wrote:
 Tweener is proven to be significantly slower than TweenLite, and it's
  almost 300% larger (TweenLite is 3k vs Tweener's 8k).

  I'm not telling you what to do. You're welcome to your preference. I
  prefer to write better, faster, smaller, more efficient code.  Different
  strokes for different folks, I guess.  :)




  Dave Mennenoh wrote:
   I prefer Tweener, and if you've ever used Fuse you'll like it's
   syntax. It's also quite small - adds about 8K.
  
   Dave -
   Head Developer
   http://www.blurredistinction.com
   Adobe Community Expert
   http://www.adobe.com/communities/experts/
   ___
   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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Custom DrawRectangle Question

2008-03-24 Thread Cory Petosky
To clarify Jason's response:

You're adding two different things. In the first case, you're adding a
child movieclip (with a rectangle drawn inside it) to the empty
DrawRectangle instance. In the second case, you're adding the
DrawRectangle instance to the screen.

You should rewrite your init function so that it draws directly to the instance:

   private function Init():void {
   graphics.lineStyle(1, 0xFF);
   graphics.beginFill(0xFF, .3);
   graphics.drawRect(_x,_y,_w,_h);
   graphics.endFill();
   }

Finally, since this class does not have frames, it should extend
Sprite, not MovieClip.

On Mon, Mar 24, 2008 at 4:01 PM, Omar Fouad [EMAIL PROTECTED] wrote:
 I am creating a custom Class that draws a simple rectangle for an
  application. Here is the class

  DrawRectangle.as

  public class DrawRectangle extends MovieClip {

 public var _w:Number;
 public var _h:Number;
 public var _x:Number;
 public var _y:Number;

 public function DrawRectangle(w:Number, h:Number, x:Number,
  y:Number) {
 this._w = w;
 this._h = h;
 this._x = x;
 this._y = y;
 Init();
 }
 private function Init():void {
 var MC:MovieClip = new MovieClip();
 MC.graphics.lineStyle(1, 0xFF);
 MC.graphics.beginFill(0xFF, .3);
 MC.graphics.drawRect(_x,_y,_w,_h);
 addChild(MC);
 }

 }
  }

  I wrote it without the last line ( addChild(MC) ) and it didnt work. It did
  not work Event when In the Main Class I added the addChild() like this:


  var M:DrawRectangle = new Rectangle(100,100,20,100);

  addChild(M);


  I thought The addChild should be put outside the class. And No It only
  worked when I add the addChild() in the class and out the class... It works
  But I want to understand Why??
  How can I set it to draw from the class iteself??

  Thanks.


  --
  Omar M. Fouad - Digital Emotions
  http://www.omarfouad.net

  This e-mail and any attachment is for authorised use by the intended
  recipient(s) only. It may contain proprietary material, confidential
  information and/or be subject to legal privilege. It should not be copied,
  disclosed to, retained or used by, any other party. If you are not an
  intended recipient then please promptly delete this e-mail and any
  attachment and all copies and inform the sender. Thank you.
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Decorator Pattern - removing a decorator

2008-03-20 Thread Cory Petosky
That's not really how Decorator is meant to work.

You could hack around it by exposing the decorated instance in your
Decorator interface, digging down to it, and using a bunch of
instanceof calls to figure out which is which. I really don't
recommend this, though -- instead, use a different design pattern or
program architecture.

On 3/20/08, Jiri Heitlager [EMAIL PROTECTED] wrote:
 Hello List,

  i am looking into the decorator pattern for an upcoming AS2 project. I was
  wondering if the following is possible

  var com:Component = new Component()

  com = new decoratorA(com)
  com = new decoratorB(decA)
  com = new decoratorC(decB)

  I cant seem to figure out what I need to do in order to remove let say
  decB at runtime? I tried a search on the internet, but all the articles
  about the decorator pattern are about runtime adding, not removing.

  Can somebody please help me if it is at all possible.

  Thank you,

  Jiri

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Error #1009

2008-03-17 Thread Cory Petosky

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Passing vars with the the timer and events

2008-03-14 Thread Cory Petosky
Erik,

Thanks for being more diligent than I was! I assumed the let it run
for an hour while eating dinner test case was enough, too!

This behavior is much more sane than my initial assessment, and I'm
certainly glad to have been shown incorrect. :)

On 3/14/08, Muzak [EMAIL PROTECTED] wrote:
 Old articles, but a must read:
  http://gskinner.com/blog/archives/2006/06/as3_resource_ma.html
  http://gskinner.com/blog/archives/2006/07/as3_resource_ma_1.html
  http://gskinner.com/blog/archives/2006/06/understanding_t.html
  http://gskinner.com/blog/archives/2006/07/as3_weakly_refe.html



  - Original Message -
  From: EECOLOR [EMAIL PROTECTED]
  To: Flash Coders List flashcoders@chattyfig.figleaf.com
  Sent: Friday, March 14, 2008 1:18 PM
  Subject: Re: [Flashcoders] Passing vars with the the timer and events


  I have modified my test classes slightly. And found that when debugging this
   movie in Flex Builder 3, the garbage collection was triggered when I moved
   my mouse within the Flash movie.
  
   I suspect that the method behind the screens that runs the garbage 
 collector
   is quite complex. I think that in more complex applications garbage
   collection is more efficient.
  
  


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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] to mac or not to mac

2008-03-14 Thread Cory Petosky
Speaking of Ubuntu, I do my Flash development on an Ubuntu box. Flex
Builder 3, the Flex SDK, and Flash Player 9 run fine on it. If you
really need the IDE, you can VMWare, Remote Desktop, or plain-old dual
boot into your commercial OS of choice to run it.

Nowadays, you can buy a cheap Windows machine, pick up a copy of Mac
OS, and dual boot OSX and Windows (and Ubuntu, if you want to be
happy) cheaper than buying an Apple machine, and you get the ability
to buy standard off-the-shelf hardware if you want to do any
customizations.

On 3/14/08, Zeh Fernando [EMAIL PROTECTED] wrote:
  It's time for me to get a new computer and I have heard so many horror
   stories about Vista that I am thinking of switching to Mac. What tools are
   people using to develop on the Mac. I mostly Flash IDE, FlexBuilder,
   FlashDevelop, SWFMill, SWFDump, HaXe, FlashTracer - are these available on
   Mac? Also any general info about developing on the Mac, positive or
   negative, would be helpful.


 This is a highly subjective question in so many ways that it's pretty
  hard for anyone to answer in a neutral fashion.

  With that said - yes, Vista is a POS, IMHO. It's the best definition of
  an extremely annoying, user-unfriendly operating system. It's a slap in
  the user's face as it automatically assumes anyone using the computer is
  a complete retard. Which is probably true in 95% of the cases, but that
  doesn't make it a good development architecture. Not mentioning it IS
  slow as hell.

  So the question shouldn't be whether you get a Mac vs a PC with Vista,
  but rather a Mac vs a PC with Windows XP.

  I'm probably not the best person to comment on it, I haven't used Vista
  for a very long time. But after getting a Notebook with Vista I was
  really surprised with how the horror stories (which I didn't believe
  before, dismissing them as random, generic MS-hate) were accurate. Maybe
  it's one of those systems that become bearable after you tweak it
  enough, a bit like XP is. But my initial impressions were so strong I
  really didn't feel like trying it at all. Thankfully I had bought the
  Notebook for presentation and testing only so it's now happily running
  Ubuntu instead.



  Zeh

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] GUI SVN

2008-03-14 Thread Cory Petosky
If you use Gnome, you can use these Nautilus scripts for a
Tortoise-like experience:

http://marius.scurtescu.com/2005/08/24/nautilus_scripts_for_subversion

If not, you have RapidSVN:

http://rapidsvn.tigris.org/

On 3/14/08, Andrew Sinning [EMAIL PROTECTED] wrote:
 I'm not a command line guy either, but I backup my files to a ubuntu
  box, and I also develop my php directly on that box.  I'd love to run
  SVN but without the command line.

  Is there a good GUI SVN for linux?

  Thanks.

  Claus Wahlers wrote:
   Dunno if that has been mentioned, but if you are NOT a command line
   guy, like me, and want a kick ass non-CLI SVN client, by far the best
   option is TortoiseSVN, which afaik is only available for Windows and
   beats the crap out of everything else i've seen.
  
   This one tiny software is the main reason i stick to Windows (XP) for
   now. I have three machines here (XP, OSX and Ubuntu), and the XP
   machine is my main dev machine, because i don't wanna miss TortoiseSVN.
  
   Otherwise, i'm very, VERY unreligious about operating systems, because
   i frankly think they all suck in one way or another.
  
   Cheers,
   Claus.
   ___
   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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Passing vars with the the timer and events

2008-03-13 Thread Cory Petosky
  The common use for weak event
  listeners is when adding listeners to the stage

I disagree. Weak event listeners should be used in nearly all cases.

  In most cases there is actually no real benefit of creating weak event
  listeners. In most cases parents add
  listeners to their children. Children are removed and that's that.

This is not correct. If you add a normal event listener to a child,
and then remove that child, the child is _not_ garbage collected.
Objects are only garbage collected when all references to the object
are removed. Adding a normal event listener causes a reference to be
created invisibly within the event system.

You must remove all normal listeners from an object before it will be
garbage collected.

 Hmmm, if it was garbage collected, why would I remove the listener, isnt
  that the point of weak references?

You can't use weak references on an anonymous event listener. The only
reference to that function is in the event system itself, so if you
use a weak reference, the garbage collector considers the anonymous
function eligible for garbage collection. Thus, the garbage collector
removes your event listener immediately, and you never get your event.

(When I say immediately, I really mean at a random time when the GC
is invoked. Sometimes that's immediate, sometimes its not, but you
should assume immediacy so your code doesn't randomly break.)

On 3/13/08, EECOLOR [EMAIL PROTECTED] wrote:
 That's a dangerous practice.


 I do not completely agree.


  It prevents you from using weak event listeners


 Correct.

  The common use for weak event
  listeners is when adding listeners to the stage: the stage is allways
  present and adding normal listeners to it will insure that the
  listener will persist. Even if it is removed everywhere else.

  In most cases there is actually no real benefit of creating weak event
  listeners. In most cases parents add
  listeners to their children. Children are removed and that's that. If
  the parent gets removed: no problem.

  In the majority of the cases, the creation of listeners on a parent is bad
  practice (stage is one of those exceptions).



   Now have to manually remove your listener to
   make sure your object is garbage collected -- but the only way to
   remove event listeners is to pass the removeEventListener function a
   reference to the function you want to remove... but you don't have
   that reference!


 Hmmm, if it was garbage collected, why would I remove the listener, isnt
  that the point of weak references?


  Greetz Erik



  On 3/12/08, Cory Petosky [EMAIL PROTECTED] wrote:
  

  That's a dangerous practice. It prevents you from using weak event
   listeners -- because the only reference to your delegate function
   object is the event listener itself, a weakly-referenced listener will
   be garbage collected. Now have to manually remove your listener to
   make sure your object is garbage collected -- but the only way to
   remove event listeners is to pass the removeEventListener function a
   reference to the function you want to remove... but you don't have
   that reference!
  
   If it's a one-time event, you can have the listener remove itself.
   Your delegate function object can pass a reference to itself (using
   arguments.callee) in to the real event listener function, which you
   can use to remove the listener. In any other case, you'll have to
   build a separate data structure (usually a Dictionary of Objects -
   Functions) to keep a reference available to your code.
  

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Passing vars with the the timer and events

2008-03-13 Thread Cory Petosky
 There is no such thing as a reference to be created invisibly within the 
 event system.

I disagree. Try this test code:

package {
import flash.events.Event;  
import flash.display.Sprite;
import flash.utils.getTimer;

public class TestClass extends Sprite {
public function TestClass() {
trace(Started!);
var s:Sprite = new Sprite();
s.addEventListener(Event.ENTER_FRAME, listener);
addEventListener(Event.ENTER_FRAME, listener);
}

private function listener(event:Event):void {
trace(event.currentTarget.toString() + getTimer());
}
}
}

You'll see both event handlers fire until the end of time.  Event
references actually are kept, invisibly, within the event system.

On 3/13/08, EECOLOR [EMAIL PROTECTED] wrote:
 If you add a normal event listener to a child,
  and then remove that child, the child is _not_ garbage collected.
  Objects are only garbage collected when all references to the object
  are removed. Adding a normal event listener causes a reference to be
  created invisibly within the event system.



 I think this is where we disagree. If a parent adds a listener to a child,
  this means the child has a reference to the parent, not the other way
  around. What you call the event system can be thought of as an array
  with handler methods on the child instance. This means that if you add
  a normal event listener to a child and then remove it, it will be
  garbage collected. There is no such thing as a

 reference to be created invisibly within the event system.


 You can't use weak references on an anonymous event listener.


 In my last email I agreed with you on this :)


  You must remove all normal listeners from an object before it will be
  garbage collected.


 Again, I do not think this is correct. An object will be garbage collected
  if there are no references to it. Adding listeners to an object will not
  create references to the object itself.


  An example (not usefull, but to illustrate the point):

  package
  {
class TestClass
{
   public function TestClass()
   {
  var o:EventDispatcher = new EventDispatcher();
  o.addEventListener(Event.COMPLETE, _handler);
   }; // At this point o will be marked for
  garbage collection, no references to o left.

   private function _handler(e:Event):void
   {
   };
};
  };


  Another example (again not usefull, but to illustrate the point):

  package
  {
class TestHandler
{
   public function TestHandler()
   {
   };

   public function handler(e:Event):void
   {
   };
};
  };

  package
  {
import flash.display.Sprite;

class TestClass extends Sprite
{
   public function TestClass()
   {
  var o:TestHandler = new TestHandler();
  stage.addEventListener(Event.RESIZE, o.handler);

   }; // At this point o will not be marked for garbage collection, stage
  will still have a reference to it.
};
  };


  I hope you agree on this. If not I am open to convincing arguments :)



  Greetz Erik



  On 3/13/08, Cory Petosky [EMAIL PROTECTED] wrote:
  
 The common use for weak event
 listeners is when adding listeners to the stage
  
  
   I disagree. Weak event listeners should be used in nearly all cases.
  
  
 In most cases there is actually no real benefit of creating weak event
 listeners. In most cases parents add
 listeners to their children. Children are removed and that's that.
  
  
   This is not correct. If you add a normal event listener to a child,
   and then remove that child, the child is _not_ garbage collected.
   Objects are only garbage collected when all references to the object
   are removed. Adding a normal event listener causes a reference to be
   created invisibly within the event system.
  
   You must remove all normal listeners from an object before it will be
   garbage collected.
  
  
Hmmm, if it was garbage collected, why would I remove the listener, isnt
 that the point of weak references?
  
  
   You can't use weak references on an anonymous event listener. The only
   reference to that function is in the event system itself, so if you
   use a weak reference, the garbage collector considers the anonymous
   function eligible for garbage collection. Thus, the garbage collector
   removes your event listener immediately, and you never get your event.
  
   (When I say immediately, I really mean at a random time when the GC
   is invoked. Sometimes that's immediate, sometimes its not, but you
   should assume immediacy so your code doesn't randomly break.)
  
  

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

Re: [Flashcoders] ScrollBar strangeness

2008-03-12 Thread Cory Petosky
Drag the UIScrollBar component from the Components window to your
library. The components window isn't visible by default -- it's under
the Window menu option.

On 3/12/08, Allandt Bik-Elliott (Receptacle)
[EMAIL PROTECTED] wrote:
 oh - i'm using flash cs3




  On 12 Mar 2008, at 15:14, Glen Pike wrote:

   What are you coding in - Flash, Flex or Flash Dev - it maybe
   because you are doing a Flex project, but trying to use a Flash
   control bar, or similar.
  
   Allandt Bik-Elliott (Receptacle) wrote:
   hi guys
  
   could you take a look at this please, i can't see what the problem
   is? I think maybe this is a syntax thing that i'm not aware of
  
   thanks
   a
  
  
   CODE:
   package com.receptacle.timeline
   {
   //package imports
   import fl.controls.ScrollBar;
   import fl.controls.ScrollBarDirection;
   internal class TAScrollBar extends ScrollBar // error:
   1017: The definition of base class ScrollBar was not found.
   {
   // class variable declarations
  // constructor
   public function TAScrollBar()
   {
   setVars();
   }
  private function setVars():ScrollBar
   {
   direction = ScrollBarDirection.VERTICAL;
   setSize(280, 40);
  return this;
   }
   }
   }
  
  
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  
  
   --
  
   Glen Pike
   01736 759321
   www.glenpike.co.uk http://www.glenpike.co.uk
   ___
   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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] ScrollBar strangeness

2008-03-12 Thread Cory Petosky
Those source files only exist as part of the components. If the
component isn't in your library, the classes don't exist. As long as
you drag the components you need to your library, you can extend the
classes.

On 3/12/08, Allandt Bik-Elliott (Receptacle)
[EMAIL PROTECTED] wrote:
 i've checked my folder and ScrollBar.as is there

  something else that was strange - i tried instantiating UIScrollBar
  with the same result but when i dragged it to my library on the empty
  fla, it worked

  i really don't understand what's happening


  a



  On 12 Mar 2008, at 15:44, Allandt Bik-Elliott (Receptacle) wrote:

   is there an extra set of libraries i need to install from flash or
   something? i don't have a scrollbar component in my component
   window either (although i do have a uiscrollbar and a scrollpane
   which subclass it)
  
  
   On 12 Mar 2008, at 15:14, Glen Pike wrote:
  
   What are you coding in - Flash, Flex or Flash Dev - it maybe
   because you are doing a Flex project, but trying to use a Flash
   control bar, or similar.
  
   Allandt Bik-Elliott (Receptacle) wrote:
   hi guys
  
   could you take a look at this please, i can't see what the
   problem is? I think maybe this is a syntax thing that i'm not
   aware of
  
   thanks
   a
  
  
   CODE:
   package com.receptacle.timeline
   {
   //package imports
   import fl.controls.ScrollBar;
   import fl.controls.ScrollBarDirection;
   internal class TAScrollBar extends ScrollBar // error:
   1017: The definition of base class ScrollBar was not found.
   {
   // class variable declarations
  // constructor
   public function TAScrollBar()
   {
   setVars();
   }
  private function setVars():ScrollBar
   {
   direction = ScrollBarDirection.VERTICAL;
   setSize(280, 40);
  return this;
   }
   }
   }
  
  
   ___
   Flashcoders mailing list
   Flashcoders@chattyfig.figleaf.com
   http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
  
  
  
   --
  
   Glen Pike
   01736 759321
   www.glenpike.co.uk http://www.glenpike.co.uk
   ___
   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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Passing vars with the the timer and events

2008-03-12 Thread Cory Petosky
That's a dangerous practice. It prevents you from using weak event
listeners -- because the only reference to your delegate function
object is the event listener itself, a weakly-referenced listener will
be garbage collected. Now have to manually remove your listener to
make sure your object is garbage collected -- but the only way to
remove event listeners is to pass the removeEventListener function a
reference to the function you want to remove... but you don't have
that reference!

If it's a one-time event, you can have the listener remove itself.
Your delegate function object can pass a reference to itself (using
arguments.callee) in to the real event listener function, which you
can use to remove the listener. In any other case, you'll have to
build a separate data structure (usually a Dictionary of Objects -
Functions) to keep a reference available to your code.

On 3/12/08, EECOLOR [EMAIL PROTECTED] wrote:
 If we ever he need to pass extra arguments to the handler we use a delegate
  class to pass them. Usage:

  obj.addEventListener(Event.TYPE, Delegate.create(this, _handler, arg1,
  arg2));

  private function _handler(e:Event, arg1:Object, arg2:Object):void
  {

  };

  I added our delegate class as an attachment.

  Note that for class methods the scope (first argument of the create method)
  has no influence.


  Greetz Erik



  On 3/12/08, Helmut Granda [EMAIL PROTECTED] wrote:
  
   Hi Bob,
  
   Thanks for the comment, that is the route that started working on after
   posting the question and the only issue I am having is dispatching the
   custom event when the timer has been reached, I did a soft search for
   samples of extending the Timer Class with custom TimerEvents but wasnt
   able
   to find any would you happen to know where I could find more info?
  
   Thanks!!
  
  

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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] calculating distance between two points

2008-03-11 Thread Cory Petosky
Point.distance (like pretty much all Flash math functions) is
abysmally slow and shouldn't be used in anything performance-critical.
Write your own replacement (using formula provided above) if you're
doing a bunch of these every frame.

On 3/11/08, Kenneth Kawamoto [EMAIL PROTECTED] wrote:
 Isn't it pointless to do Math.abs() since result is always positive
  number anyway? ;)


  Kenneth Kawamoto
  http://www.materiaprima.co.uk/


 Paul Andrews wrote:
   - Original Message - From: Merrill, Jason
   [EMAIL PROTECTED]
   To: Flash Coders List flashcoders@chattyfig.figleaf.com
   Sent: Tuesday, March 11, 2008 1:53 PM
   Subject: RE: [Flashcoders] calculating distance between two points
  
  
   Your teacher must be cringing!
  
   The square of the hypotenuse equals the sum of the squares of the
   opposite two sides should be familar..  ;-)
  
   Math.sqrt ( Math.pow(Math.abs(x1-x2),2 )+Math.pow(Math.abs(y1-y2),2
   )+))
  
  
   Why not skip the math lessons and use the Point class?
  
   Yes, my explanation was what was completely pointless..
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] dictionary vs array

2008-03-11 Thread Cory Petosky
That's a pretty good use, as long as you call your variable something
more meaningful than dictionary. :)

On 3/11/08, Patrick Matte | BLITZ [EMAIL PROTECTED] wrote:
 Thanks Steven, I never really understood what a dictionary was myself, so 
 dictionary would be useful for something like this ?

  dictionary = new Dictionary();
  button1 = new Button()
  dictionary[button1] = http://www.google.com;;
  button2 = new Button()
  dictionary[button2] = http://www.yahoo.com;;

  function onButtonClick(event:MouseEvent){
  trace(dictionary[event.target]);
  }



  BLITZ | Patrick Matte - 310-551-0200 x214


  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks
  Sent: Tuesday, March 11, 2008 12:14 PM
  To: Flash Coders List
  Subject: Re: [Flashcoders] dictionary vs array

  An Array is a linear collection.  A Hash is a random access collection
  (lookup table) of name-value pairs.

  Dictionary is a fancy Hash that can take an Object as a key, instead of
  a String, and uses strict (===) equality for its lookups.

  hash = new Object();
  hash.foo = bar;

  array = new Array();
  array.push(hello);
  array.push(world);

  dictionary = new Dictionary();
  dictionary[hash] = array;

  trace(hash.foo);
  -- bar

  trace(array)
  -- hello, world

  trace(dictionary[hash]);
  -- hello, world




  ___
  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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] clean scripting

2008-03-11 Thread Cory Petosky
To clarify, this difference only matters in the case of static class
members. Anything non-static gets initialized at constructor-time
regardless -- the difference is syntax only.

On 3/11/08, Cor [EMAIL PROTECTED] wrote:
 I go for the second option.
  Instanciate at the point you need it, and clear if no longer needed.
  It also keep memory use limited.

  HTH
  C

  -Oorspronkelijk bericht-
  Van: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] Namens Allandt
  Bik-Elliott (Receptacle)
  Verzonden: dinsdag 11 maart 2008 18:41
  Aan: flashcoders
  Onderwerp: [Flashcoders] clean scripting


  hi

  just a semantic question really

  when writing your classes, would you only declare variables in the class and
  assign variables later or would you assign values straight away if you had
  them?

  so for instance, would you...:

  package com.receptacle.timeline
  {
 //package imports
 import flash.display.Sprite;

 internal class Class extends Sprite
 {
 // class variable declarations
 private var cp:CommonProperties = new CommonProperties();
 private var commonY:uint = cp. commonY;
 private var commonCopy:String = cp.commonCopy;
 private static var title:String = Title;
 private static var subtitle:String = Subtitle;

 public function Class()
 {
 myFunc1();
 }

 private function myFunc1()
 {
 trace (function ran);
 trace (commonY is +commonY);
 trace (commonCopy is +commonCopy);
 trace (title is +title);
 trace (subtitle is +subtitle);
 }
 }
  }

  which works fine but is a little messy at the class level

  or would you...:

  package com.receptacle.timeline
  {
 //package imports
 import flash.display.Sprite;

 internal class Class extends Sprite
 {
 // class variable declarations
 private var cp:CommonProperties;
 private var commonY:uint;
 private var commonCopy:String
 private static var title:String
 private static var subtitle:String ;

 public function Class()
 {
 setVars();
 myFunc1();
 }

 private function setVars()
 {
 cp =  new CommonProperties();
 commonY = cp. commonY;
 commonCopy = cp.commonCopy;
 title = Title;
 subtitle = Subtitle;
 }

 private function myFunc1()
 {
 trace (function ran);
 trace (commonY is +commonY);
 trace (commonCopy is +commonCopy);
 trace (title is +title);
 trace (subtitle is +subtitle);
 }
 }
  }

  which seems cleaner but is more round the houses.

  thanks in advance
  a


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



 --
  No virus found in this incoming message.
  Checked by AVG.
  Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
  13:41


  No virus found in this incoming message.
  Checked by AVG.
  Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
  13:41


  No virus found in this outgoing message.
  Checked by AVG.
  Version: 7.5.518 / Virus Database: 269.21.7/1325 - Release Date: 11-3-2008
  13:41



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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] [as2] problem with super class on Tweener callback

2008-03-04 Thread Cory Petosky
I don't have a solution, but I have an arguably less ugly workaround
that I've used in similar cases.

public class Superclass {
public function load():Void {
   __load();
}

protected function __load():Void {
// Base class functionality here
}
}

public class Subclass extends Superclass {
public function load():Void {
Tweener.addTween(this, {onComplete: __load});
}
}

On 3/4/08, Wagner Amaral [EMAIL PROTECTED] wrote:
 Hey there Zeh!

  On Tue, Mar 4, 2008 at 12:18 PM, Zeh Fernando [EMAIL PROTECTED]
  wrote:


  
   Hm.. that's a good question. It runs functions inside of the instance
   using .apply, but if you pass the super.load without wrapping it, I'm
   sure exactly how the function reference is handled by actionscript.
  


 Yeah, I've looked at Tweener's code, even tried to tweak a little bit to see
  if I could get through it, then I realized it's not Tweener's fault.
  By issuing a:
  trace(tScope);
  on line 754, right before:
  tTweening.onComplete.apply(tScope, tTweening.onCompleteParams);
  it traces my current instance correctly.



  
   Anyway, have you tried this instead?
  
   public function load():Void {
  var obj:Object = new Object({
 _y: 200,
 time: 1,
  onComplete: function() { super.load(); }
  });
  Tweener.addTween(this, obj);
   }
  


 Yes, I tried that. Just tried again right now to make sure I wasn't missing
  anything ;)
  Still, no success...

  I've just pasted the code from the superclass inside the onComplete handler
  (it's just a event dispatch anyway, works for now), but I really hate myself
  for doing this, specially because this is a refactoring of some old crappy
  code, and it's supposed to be made the right way.
  Anyway, still trying to come up with something. (Boy, I really wish the boss
  would let me use AS3 already, I'm sure these things wouldn't happen. AS2
  really isn't made to serious programming)

  Thanks for the help so far, Zeh! Valeu!


  --

 Wagner Amaral
  Agência Ginga - Brazil
  www.agenciaginga.com.br
  ___

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com

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


Re: [Flashcoders] Re: AS2 vs. AS3: instantiate library symbols with a loop string concatenation

2008-03-04 Thread Cory Petosky
import flash.utils.getDefinitionByName;

for (var i:uint = 0; i  30; ++i) {
   var sym:MovieClip = new (getDefinitionByName(sym + i) as Class)();

   // rest
}

On 3/4/08, jonathan howe [EMAIL PROTECTED] wrote:
 Sorry - somehow triggered the send mail hotkey before I was finished:

  On Tue, Mar 4, 2008 at 3:25 PM, jonathan howe [EMAIL PROTECTED]
  wrote:


  
  
   Imagine I have in my library a series of MovieClips with linkage
   identifiers like so:
  
   sym0
   sym1
   sym2
   ...
   sym29
  
   In AS2, if I wanted to create instances of each one (or perhaps decide
   which symbol to use based on XML data, for example), I could use a for 
 loop:
  
   for (var i:Number = 0; i  30; i ++) {
   var new_mc:MovieClip = parent_mc.attachMovie(sym + i, sym + i, i);
   // do stuff with clip
   }
  
   and create each symbol via passing a concatenated string as symbolName.
  
   Now, in AS3, I can't think of a way to do this efficiently. In our simple
   example, I can only think of the following:
  
   for (var i:int = 0; i  30; i ++) {
   var sym:MovieClip;
switch (i) {
case 0: sym = new sym0();

   case 1:sym =  new sym1();
case 2: sym =new sym2();

  ...
}
   // do stuff with clip
   }
  
  
   Is there a more efficient way to do this in AS3? You can't really
   instantiate a class based on a stringname, can you?
  

 Was I doing myself a disservice by using this technique in AS2 anyway?
  

  Thanks,

 -jonathan

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] External Interface + Google Analytics + IE7

2008-02-29 Thread Cory Petosky
Glen,

Somebody on my team had the same problem with AS3, Google Analytics,
and IE7. He used the global sendToURL function instead. According to
him, neither navigateToURL nor ExternalInterface worked for him.

On 2/29/08, Glen Pike [EMAIL PROTECTED] wrote:
 Hi,

 I am using AS3, so this is not an option, but thanks.


 Glen


  Karim Beyrouti wrote:
   I know this is not what you are asking for, but I use a getURL command to
   call the tracking script: getURL(javascript:pageTracker._trackPageview(' 
 +
   str + '););
  
   I have built two classes for google analytics 1 for the urchin tracking, 
 and
   another for the gaTracker, Here are the links to the classes:
  
   http://underground-bunker.com/transfer/gaTracker.as
   http://underground-bunker.com/transfer/urchinTracker.as
  
   maybe they will be usefull to someone.
  
  
   - karim
  
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] On Behalf Of Glen Pike
   Sent: 29 February 2008 13:57
   To: Flash Coders List
   Subject: Re: [Flashcoders] External Interface + Google Analytics + IE7
  
   Hi,
  
   Does anyone have any ideas about this?
  
   Glen
  
   Glen Pike wrote:
  
   Hi,
  
  I have encountered a problem with an ExternalInterface.call causing
   IE7 to throw a JS error.
  
  I get an error message saying:
  Line: 1
  Char 14:
  Error: Expected ';'
  Code: 0;
  URL: http://www.dijitl.co.uk/beta/
So, my guessing is that somewhere the ExternalInterface call is
   not adding a semi-colon, but that IE 7 maybe getting it's knickers in
   a twist.  Either way, it's annoying and my tracking is not working.
   Can anyone shed light on this - I am using
   so.addParam(allowScriptAccess, always); with SWFObject too.
Ta
  
  Glen
  
  AS code is like this:
var page:String = evt.type.substr(5);
if (ExternalInterface.available) {
  ExternalInterface.call (trackTesting, page);
  }
  
  Have also tried calling the pageTracker object directly -
   ExternalInterface.call(pageTracker._trackPageview, page); - but no joy.
  
  JS Code is like this:
  
  script type=text/javascript
  // ![CDATA[
  var pageTracker = _gat._getTracker(UA-DELETED);
  pageTracker._initData();
  pageTracker._trackPageview();
function trackTesting(page) {
  alert(before  + page);
  pageTracker._trackPageview(page);
  alert(after);
  }
// ]]
  /script
  
  
  

  --

  Glen Pike
  01736 759321
  www.glenpike.co.uk http://www.glenpike.co.uk
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] RangeError: Error #2006: The supplied index is out of bounds.

2008-02-25 Thread Cory Petosky
Judging by the error message, your container doesn't have 11 children added.

Consider using a for loop instead of manually coding all that.

On 2/25/08, anuj sharma [EMAIL PROTECTED] wrote:
 Hi Guys
  I am making an Auto-Arrange button and clicking on which arranges all the
  children of the container( which are on the main stage) in the tile format.
  Basically on clicking, I manually move those child on the stage to
  particular coordinates as shown in my code. I have pasted my code below. My
  problem is that as soon as i click on the auto arrange button I am getting
  error RangeError: Error #2006: The supplied index is out of bounds..
  Please let me know what i am doing wrong and i will appreciate if you let me
  know how would i fix this
  Thanks a lot guys
  Anuj

  **CODE**
  var aa:Number=0;
  var xcoord:Number=-300;
  var ycoord:Number=-200;
  var xcoord1:Number=450;
   var xcoord2:Number=850;
   var xcoord3:Number=1250;
  var ycoord1:Number=350;
   var ycoord2:Number=650;
  //Button Listener
  btn_AA.addEventListener(MouseEvent.CLICK,autoArrange);
  function autoArrange(event:MouseEvent):void
  {
 if(container.getChildAt(aa)!=null)
 {
 container.getChildAt(aa).x=xcoord;
 container.getChildAt(aa).y=ycoord;
 //Arrange Second
 container.getChildAt(aa+1).x=xcoord+xcoord1;
 container.getChildAt(aa+1).y=ycoord;
 //Arrange Third
 container.getChildAt(aa+2).x=xcoord+ xcoord2;
 container.getChildAt(aa+2).y=ycoord;
 //Arrange Forth
 container.getChildAt(aa+3).x=xcoord+xcoord3;
 container.getChildAt(aa+3).y=ycoord;
 //Arrange Fifth
 container.getChildAt(aa+4).x=xcoord;
 container.getChildAt(aa+4).y=ycoord+ycoord1;
 //Arrange Sixth
 container.getChildAt(aa+5).x=xcoord+xcoord1;
 container.getChildAt(aa+5).y=ycoord+ycoord1;
 //Arrange Seventh
 container.getChildAt(aa+6).x=xcoord+ xcoord2;
 container.getChildAt(aa+6).y=ycoord+ycoord1;
 //Arrange Eight
 container.getChildAt(aa+7).x=xcoord+xcoord3;
 container.getChildAt(aa+7).y=ycoord+ycoord1;
 //Arrange Ninth
 container.getChildAt(aa+8).x=xcoord;
 container.getChildAt(aa+8).y=ycoord+ycoord2;
 //Arrange Tenth
 container.getChildAt(aa+9).x=xcoord+xcoord1;
 container.getChildAt(aa+9).y=ycoord+ycoord2;
 //Arrange Eleventh
 container.getChildAt(aa+10).x=xcoord+ xcoord2;
 container.getChildAt(aa+10).y=ycoord+ycoord2;
 }
  }
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] How do you do this?

2008-02-25 Thread Cory Petosky
Can you verify that this is Papervision? I'd think Papervision would
be far too slow for something like this. A simple homebrew 3D engine
optimized for this particular use-case seems more likely considering
that this app is designed as a performance benchmark.

On 2/25/08, eric e. dolecki [EMAIL PROTECTED] wrote:
 tons of math and some papervision3d.



  On Mon, Feb 25, 2008 at 4:40 PM, Jim Robson [EMAIL PROTECTED]
  wrote:


   Hello all,
  
   There's a neat 3D CS3 demo from a Japanese tour. I'd like to know how to
   go
   about creating this kind of effect; my (few and rare) attempts at 3D
   animation in Flash have not performed nearly this well:
  
   http://www.adobe.com/jp/events/cs3_web_edition_tour/swfs/perform.swf
  
   Any ideas/hints/urls/etc?
  
   - Jim
  
   ___
   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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] CDROM XML search

2008-02-21 Thread Cory Petosky
Since it's a CD-ROM, you can get away with a lot of preprocessing on
the data. Do all the really heavy lifting before you deliver the
project, so that the live Flash app doesn't have to.

One straightforward thing you can do is parse the entire collection
XML, keeping every article every word appears in, and dumping this
list  (sorted) as a plaintext file. Something like:

aardvark: i302a27, i322a41, i412a2
anchovy: i210a9, i289a31
bezier: i123a4

Where the list format is iissueNumaarticleNum. Then, at run time,
your Flash app can (relatively) quickly load your index file into a
huge sorted list. Finally, when a search term is entered, you can do a
quick binary search on the search term and find all relevant articles.

You'll probably need to write your preprocessor in another language,
since Flash can't write to local files. You could conceivably write
your preprocessor using AIR and Actionscript.

Also note that I'm not guaranteeing that a simple list index is best
-- I'm just providing one implementation idea off the top of my head
that demonstrates the use of preprocessing the data, which I think you
must do regardless of your final indexing strategy.

On 2/21/08, Glen Pike [EMAIL PROTECTED] wrote:
 The system can use AS3 - as it is a CDROM.

  I asked about the data size - at the moment, a sample XML file,
  generated by an automatic tool is about 500k, gulp.
  That means, 6MB per year, 60MB per decade at the moment.

  I have asked to see the file, because there may be a lot of rubbish that
  can be eliminated - I hope so..


  Glen




  Merrill, Jason wrote:
   First questions to get out of the way is which version of Actionscript
   and potentially how much data (in k)?
  
   Jason Merrill
   Bank of America
   GTO LLD Solutions Design  Development
   eTools  Multimedia
  
   Bank of America Flash Platform Developer Community
  
  
   Are you a Bank of America associate interested in innovative learning
   ideas and technologies?
   Check out our internal  GTO Innovative Learning Blog and  subscribe.
  
  
  
  
  
  
  
   -Original Message-
   From: [EMAIL PROTECTED]
   [mailto:[EMAIL PROTECTED] On Behalf
   Of Glen Pike
   Sent: Thursday, February 21, 2008 10:50 AM
   To: Flash Coders List
   Subject: [Flashcoders] CDROM XML search
  
   Hi,
  
  I have been asked to look at a search facility for a
   CDROM project.
  
  The customer is archiving magazines, 1 a month, for a
   decade per CD and wants a simple search engine.
  
  The magazines will be archived as scanned images plus XML
   data containing page text content.
  
  Loading in an XML file and searching / filtering is
   pretty easy in principle, but I am guessing I may run into
   performance issues as the amount of data is scaled up.
  
  Google is proving fairly useless today, so has anyone had
   much experience of this and have any recommendations.
  
  Thanks
  
  Glen
   --
  
   Glen Pike
   01736 759321
   www.glenpike.co.uk http://www.glenpike.co.uk
   ___
   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
  
  
  

  --

  Glen Pike
  01736 759321
  www.glenpike.co.uk http://www.glenpike.co.uk
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Graphic design universities

2008-02-20 Thread Cory Petosky
If you don't mind the cold, a lot of the designers I've met have gone
to the Minneapolis College of Art and Design (MCAD)
http://www.mcad.edu/. There are a lot of genuinely talented guys
there, and their degree programs sound like just what you're looking
for.

Many good friends (amazing designers/Flash animators) have highly
recommended the place to me.

On 2/20/08, Sidney de Koning [EMAIL PROTECTED] wrote:
 Check out the SAE (http://www.sae.nl/ speciafically in The Netherlands).
 Its an internationally orientated school, specialized in Audio
 engineering, video editing and Flash animation and Actionscripting :)
 For world wide check out: http://www.sae.edu/ . I am a teacher here and
 i can highly recommend it, and its well regarded.

 Good luck picking a school,

 Sidney

  Hi list.
 
  I have two years to choose in which univerity i'll go when my school studies
  finish. I am looking for some graphical design universitys in which i can
  apply my knowledge offlash, animation, video and audio modeling. So, mostly
  about graphics and motion. I've been googling the web, but i found so many
  results that my head went bad,and they mostly all of them had some other
  studies that i don't like such as ecomony, telecommunication between others.
 
 
  So, can someone recommend me some universites you think are good?
 
  Thanks
 
  Pedro D.K.
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 
  --
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.516 / Virus Database: 269.20.8/1287 - Release Date: 19-2-2008
  10:55
 
 
  No virus found in this incoming message.
  Checked by AVG Free Edition.
  Version: 7.5.516 / Virus Database: 269.20.8/1287 - Release Date: 19-2-2008
  10:55
 
 
  No virus found in this outgoing message.
  Checked by AVG Free Edition.
  Version: 7.5.516 / Virus Database: 269.20.8/1287 - Release Date: 19-2-2008
  10:55
 
 
  ___
  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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] AS3 Accessing objects properties on the stage from other objects

2008-02-19 Thread Cory Petosky
You have to cast the root property because it's statically typed as a
DisplayObject. Because the player/API doesn't know what document class
you might use for your root object, it types root as the base class
your document class must inherit from.

Looking at your code, it seems that you're trying to develop AS3 as if
it were AS2. In general, manually traversing the display list using
parent or root properties is a sign of bad design. In this case,
you're tying your program architecture to your display list
architecture -- if you move one thing in your FLA, everything will
break.

Instead, build your classes in a more object-oriented manner. I don't
know what class the snippet you posted is in, but it looks like all
you need is property derived from another display object's width. In
this case, consider adding a property called maxWidth or something
similar to the object's constructor, and pass the value in when you
create the object. That way you don't need to traverse the display
list to find the information you need -- everything is nice and
encapsulated.

Cory

On 2/19/08, Johan Nyberg [EMAIL PROTECTED] wrote:
 Hi, I have a question regarding referencing objects on the stage from
 other objects. You should be able to use the root from any object that
 has been added to the display list using addChild. But when I do so I
 get this error message:

 1119: Access of possibly undefined property loader through a reference
 with static type flash.display:DisplayObject.

 The only way for me to do what I want is if I cast the root reference
 to the class of my document class. For example, if the name of my
 document class is MyDocumentClass it would be like this:

 MyDocumentClass( root ).theObjectIWantToAccess.someProperty

 My questions are:

 1. Why do I have to cast the root property?
 2. Is this the best way to go around what I want to do.

 To illustrate what I'm talking about, here's a snippet of code:

 if( this.inputBubble.x + this.inputBubble.width 
 PokerHandComp(root).frame_mc.width )
   {
 this.inputBubble.x = x;
 this.inputBubble.bubble_mc.scaleX = -1;
 this.inputBubble.txt.x = - this.inputBubble.bubble_mc.width + 20;
 }

 In this case my document class is called PokerHandComp.

 Regards,


 Johan Nyberg
 Designer and web developer

 [EMAIL PROTECTED]
 08 - 50 00 24 30
 070 - 407 83 00



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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] pure AS3 app to use mx.* stuff

2008-02-14 Thread Cory Petosky
Flex apps override addChild to only allow things that implement
IUIComponent. If you need to add a child that's just a plain display
object, manipulate the rawChildren property instead.

On 2/14/08, Gregory N [EMAIL PROTECTED] wrote:
 Glen,
   ...you can have your class in the app folder

  called SystemCore.as this looks like it extends a display object


 Not exactly :-)
  If It extends Sprite, the result is grey-gradient standard flex bg,
  w/o any traces of my objects. Trace commands are executed nice,
  however.
  If I make the main class extending mx.core.Application then, in
  addition to tracing messages,  I can see my (white) background and
  initializing progress bar.
  But:
  ===
  [Fault] exception, information=TypeError: Error #1034: Type Coercion
  failed: cannot convert mx.core::[EMAIL PROTECTED] to
  mx.core.IUIComponent.
  Fault, addingChild() at Container.as:3301
  ===
  where FlexSprite is used in code:

  var triangle:FlexSprite = new FlexSprite( );
  // drawing a triangle...
  addChild(triangle);

  And it's addChild() that causes the error (no error with addChild() 
 commented).

  So far, it looks strange for me, as the argument's type of
  mx.core.Application.addChild() is DisplayObject.

  Thoughts?



  Glen Pike wrote:
   You can write pure AS3 files for Flex - all MXML gets compiled
   down to AS3 before it is compiled to bytecode.
  
   (I had done followed an example online which has a pure AS3
   component - once it is written, you add the package to your namespace
   and add an MXML tag in your code to add it to the stage.)
  
   Like with the workaround on the forum you posted - if you have added
   your package path to the namespace ( xmlns:app=app.*), you can write
   your code in an AS file rather than an MXML file, then you write it as
   you would any other class file - no need for Script tags  mixing mxml /
   as code.
   ?xml version=1.0 encoding=utf-8?
   mx:Application horizontalScrollPolicy=off
   xmlns:mx=http://www.adobe.com/2006/mxml; xmlns:app=app.*
   layout=absolute frameRate=30
   app:SystemCore id=sysCore width=100% height=100%/
   /mx:Application
  
   So the above example, you can have your class in the app folder
   called SystemCore.as this looks like it extends a display object or
   similar as it has width and height attributes - not sure about extending
   other classes.


 --

 Best regards,
  GregoryN
  
  http://GOusable.com
  Flash components development.
  Usability services.
  ___

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Control speed by how fast mouse moving

2008-02-12 Thread Cory Petosky
You'd be better off doing it in an onEnterFrame or a onMouseMove than
in a setInterval call -- code is only executed between frames anyway,
so your way just adds extra processing burden.

Since all these events are only working once per frame, just comparing
x's isn't likely to give you meaningful data -- if a player moves his
mouse rapidly left to right at a rate that's some factor of your
framerate, you could easily get the same (or similar) x value at every
read. Increasing the framerate could help this, but brings other
problems.

Consider placing a small, invisible movieclip on the path you intend
the user to move his mouse, and listen for onRollOver. You can use the
number of RollOver events per second to adjust speed. Just keep in
mind that you won't get any more events than your framerate.

Finally, instead of adjusting speed directly, adjust max speed and
provide a constant acceleration toward the current max speed. For
example, if the user starts out at a rate that correlates to 50 mph,
his current speed should slowly increase at a constant rate over many
seconds until it reaches 50. Similarly, once the user begins to slow
down, the speed should decrease linearly to the maximum speed allowed
by the mouse move rate. This provides a slow acceleration at the
beginning -- which is probably what you want if you're emulating the
old button mashers -- and provides smooth speed changes as the game
progresses, which is definitely good.

On 2/12/08, Paul Steven [EMAIL PROTECTED] wrote:
 I am trying to program a game where a character moves faster, the faster the
 player moved the mouse left and right. A bit like the old Dailey Decathlon
 Game where you had to hit 2 keys on the keyboard on after the other as fast
 as you can to control the speed of say a character running.

 I could do with some advice on how to achieve this.

 I have a frame rate of 31 FPS, with a movie width of 600 pixels.

 Currently I am calling a function every 10ms to calculate the speed

 objShowerGame.updateSpeedInterval = setInterval(updateSpeed, 10);


 I compare the previous mouse X position with the current one and use this
 difference as the speed.

 This isn't really working so I could do with some suggestions.

 Thanks

 Paul

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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Insert new symbol

2008-02-04 Thread Cory Petosky
Just move the image so 0,0 is in the middle of it and animate from there.

On 2/4/08, [p e r c e p t i c o n] [EMAIL PROTECTED] wrote:
 because i load an image into it and animate from the middle of the
 image...so if i can't control the registration point it animates from top
 left...

 On Feb 4, 2008 9:12 AM, Kenneth Kawamoto [EMAIL PROTECTED] wrote:

  Do you mean an empty MovieClip? It's empty - why do you need to worry
  about the registration point?
 
  Kenneth Kawamoto
  http://www.materiaprima.co.uk/
 
  [p e r c e p t i c o n] wrote:
   Hi all,
   Can anyone explain why when you insert a new movieclip symbol using the
   insertnew symbol from the menu can't choose a registration point?  very
   annoying...
   that's my rant for the day...
   happy monday
   p
  
 
  ___
  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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] input text formatting

2008-01-30 Thread Cory Petosky
Use the defaultTextFormat property instead of setTextFormat.

On 1/29/08, Andrew Sinning [EMAIL PROTECTED] wrote:
 Yes, that's exactly what I'm going ot have to do.  This has got to be a
 BUG.  If I trace out the format.align property after a single character
 change it goes from center to null!  Then after the user replaces all of
 the text it changes to left.

 Glen Pike wrote:
  In AS3 I have to keep applying the TextFormat object to the TextField
  when it's content changes:
 
  function createText():void {
 _nameText.setSelection(0, _nameText.text.length);
 //_nameText.caretIndex = 0;
 _nameText.setTextFormat(_nameFormat);
 addChild(_nameText);
 _nameText.addEventListener(Event.CHANGE, textChange);
  }
 
 
  private function textChange(evt:Event):void {
 _nameText.setTextFormat(_nameFormat);
  }
 
  Andrew Sinning wrote:
  I'm creating an input-type TextField at runtime and setting the align
  prop of its TextFormat to 'center'.  The default text displays
  centered.  If the user edits just one character at a time the text
  remains centered.  However, if they select all of the text and then
  type something in, the align suddenly changes to 'left'.  Any idea
  what's going on?
 
  Thanks!
  ___
  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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] xml generator

2008-01-24 Thread Cory Petosky
Eclipse has a good XML editor built in.

On 1/22/08, Merrill, Jason [EMAIL PROTECTED] wrote:
 I'm looking for a tool that generates XML.  It's for quiz
 questions/answers loaded into Flash.  We currently edit the
 .xml files by hand, but it's messy and causes cross-eyes.  Is
 Altova XML Spy a good tool for this purpose? Are there other,
 less expensive ones?

 Microsoft XML Notepad is really nice and really free. Keeps your nodes
 in a tree-like structure that is easy to navigate. Altova XML Spy is
 expensive and probably way more capable that what your needs are.

 http://www.microsoft.com/downloads/details.aspx?FamilyId=72D6AA49-787D-4
 118-BA5F-4F30FE913628displaylang=en


 Jason Merrill
 Bank of America
 GTO LLD Solutions Design  Development
 eTools  Multimedia

 Bank of America Flash Platform Developer Community




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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] missing glyphs

2008-01-24 Thread Cory Petosky
From the docs:

If you set the embedFonts property to true for a text field, you must
specify a font for that text by using the font property of a
TextFormat object applied to the text field. If the specified font is
not embedded in the SWF file, the text is not displayed.

On 1/23/08, Mendelsohn, Michael [EMAIL PROTECTED] wrote:
 Hi list...
 I've embedded a font that I confirmed in Windows' character map that it has 
 the glyphs for ≤ and ≥.  These glyphs trace fine, but they don't appear in my 
 textField.  Any idea what I'm missing?

 Thanks,
 - Michael M.



 var objMarkText:TextField = _root.createTextField(tf, 1, 0, 0, 1, 1);
 objMarkText.embedFonts = true;
 var symbol:String = (i==0)?\u2264:\u2265;
 objMarkText.text = symbol;
 trace(objMarkText.text);

 // traces correctly...but glyph doesn't show up in objMarkText.text


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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com

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


Re: [Flashcoders] Form AS3 - variable name brackets []

2008-01-23 Thread Cory Petosky
Try:
variables[group_ids[]] = String('2');

On 1/23/08, Cor [EMAIL PROTECTED] wrote:
 Hi Nick,

 group_ids[] indicates that you are referencing an Array, and it also needs a
 index.

 HTH
 Cor

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens Nick Terry
 Verzonden: woensdag 23 januari 2008 7:36
 Aan: Flash Coders List
 Onderwerp: [Flashcoders] Form AS3 - variable name brackets []

 Hello,

 I'm trying to set up a newsletter, sending some variables to a PHP script in
 AS3.  The problem is that one of the variable Name/IDs has brackets [] in it
 and flash does not like this, so I've put the variable in the URLRequest -
 but it doesn't work either.  I'm interested if anyone has any ideas in how
 to pass this variable to the PHP file.

 Should I put group_ids[]=2 in a text file and load that text file in the
 flash and then pass it to the PHP with the other variables?  If so, ideas in
 how?  Thanks for any help.

 -Nick

 Here's the code I have so far:

 var variables:URLVariables = new URLVariables();
 var varSend:URLRequest = new
 URLRequest(manage/public/listmessenger.php?group_ids[]=2);
 //var varSend:URLRequest = new
 URLRequest(manage/public/listmessenger.php);
 var varLoader:URLLoader = new URLLoader;
 varSend.method = URLRequestMethod.POST;
 varSend.data = variables;

 emailSubmit.addEventListener(MouseEvent.CLICK, sendActions);
 varLoader.addEventListener(Event.COMPLETE, loadComplete);

 function sendActions(event:MouseEvent):void {
 variables.email_address = email_txt.text;
 variables.action = String('subscribe');
 //variables.group_ids[] = String('2');
 varLoader.load(varSend);
 trace(variables.email_address);
 trace(variables.action);
 }

 function loadComplete(event:Event) {
 trace(Your message was sent.);
 }


 --
 Nick Terry
 Designer

 [EMAIL PROTECTED] | www.nickterry.com

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


 --
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
 20:12


 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
 20:12


 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
 20:12


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



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] extends implements

2008-01-10 Thread Cory Petosky
I declare the implements as well, because FDT doesn't seem to infer
interface inheritance. Without explicitly declaring the implements, I get
extraneous error notifications.

On 1/10/08, Andy Herrman [EMAIL PROTECTED] wrote:

 I normally just declare the extends, as the docs for the base class
 would already show that it fits the interface.  However, in my AS2
 code (I'm also working in java, C#, and C++ right now) I've started
 declaring the interfaces as well.  The reason I started doing that is
 that the documentation generator I'm using (as2api) doesn't seem to
 properly inherit the documentation from the interface unless I
 explicitly declare it.

   -Andy

 On Jan 10, 2008 3:11 AM, Hans Wichman [EMAIL PROTECTED]
 wrote:
  Hi folks,
 
  I was wondering about your personal/professional preference regarding
 the
  following.
 
  Say you have an interface IEvent and a base class Event which implements
  IEvent.
 
  Now you are creating an event subclass MyEvent which can:
  - implement IEvent
  - extend Event
  - both
 
  In other words, would you when choosing to extend Event still declare it
 as
  an implementation of IEvent for the sake of readability:
  class MyEvent extends Event implements IEvent OR
  simply class MyEvent extends Event
 
  I see pro's and con's to the both of them, but I guess I'm looking to
 see if
  there is some sort of 'why declaring blablahb is evil'.
 
  I guess I'm used to adding the implements clause as well, since it
 allows me
  to change the superclass and testing whether I still adhere to the
 required
  interface by compiling that class instead of compiling any source that
 uses
  it. In addition I hope it prevents people from declaring variables like
 var
  a:Event instead var a:IEvent...
 
  tnx in advance.
  JC
  ___
  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




-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Estimate FLV file size?

2007-12-26 Thread Cory Petosky
To be picky about nomenclature --

Amongst those in the know, b is bit and B is byte -- so 10 Mbps is
10 megabits per second but 12 MB is twelve megabytes. It's also totally
acceptable (and advocated by at least one proposed standard) to use the word
bit fully (e.g., 512 kbit/s).

In practical use, I've only ever seen kbps/Mbps refer to bitrates,
regardless of capitalization. When rates are used with bytes, I always see a
slash instead of the p -- that is, I have a 6 Mbps (megabit per second)
connection, so I usually download files at around 800 kB/s (kilobytes per
second).

Of course, people aren't generally as precise as they should be, so even if
you know the various standards out there, you've got to keep the context of
the number in mind to make sure it makes sense. :)

On 12/23/07, Micky Hulse [EMAIL PROTECTED] wrote:

 Latcho wrote:
  512 Kbits / 8 bitsperbyte = streaming 64 KBytes per sec = 3840 KBytes
  per minute = (3840 / 1024)  3.75 MBytes

 Wow, thanks for that. ;)

 Interesting stuff.

 I finally had a chance to compress a vid (using settings I mentioned in
 first post) and the file size was compressed to about 13mb (note to
 self, mb = megabytes) :D

 Playing with the numbers now though... the formula above is good to
 know. Thanks Latcho and Marc!

 Cheers,
 Micky

 --
 Wishlist: http://tinyurl.com/22xonb
 Switch: http://browsehappy.com/
 BCC?: http://snipurl.com/w6f8
 My: http://del.icio.us/mhulse
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




-- 
Cory Petosky : Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] load flex swf into flash CS3 project

2007-12-20 Thread Cory Petosky
You can use mx.core.Container.rawChildren.addChild to add any DisplayObject
to a Flex container.

On 12/20/07, Jamie S [EMAIL PROTECTED] wrote:

 I guess i'm thinking specifically of mx.core.Container Objects.
 Although you can use addChild() to add any DisplayObject, unless that
 DisplayObject implements IUIConponent, it wont work.

 Jamie

 On Dec 20, 2007 7:23 AM, Merrill, Jason [EMAIL PROTECTED]
 wrote:
  Also I've found that when trying to add a MovieClip instance
  to a UIComponent in Flex, the whole app just quits. Though
  technically there is nothing wrong with doing this, Flex
  components react badly to display objects that are not
  desensants of UIComponent.
 
  Interesting, I haven't encountered that in Flex (yet) - I have added
  Sprite instances to UIComponent instances with no problems. Knock on
  wood.
 
  Jason Merrill
  Bank of America
  LLD GTO
  eTools  Multimedia Research  Development
 
 
 
 
  ___
  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




-- 
Cory Petosky : Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders