[Flashcoders] ||= operator

2008-07-27 Thread Adam Jowett

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


[Flashcoders] ||= operator

2008-07-27 Thread Adam Jowett

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


RE: [Flashcoders] Overriding the trace command

2008-07-15 Thread Adam Jowett
Some great suggestions thanks! ... I guess in essence I simply wanted to
extend the inbuilt trace function rather than overriding it ... all I wanted
to do was append which class and or method the trace was called from. My
immediate need is for debugging someone else's very buggy code that I have
just come onto at the end of it's lifecycle .. for future projects, then
something like what Hans mentioned might be the way to go.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Francis
Turmel
Sent: Wednesday, 16 July 2008 7:25 AM
To: Flash Coders List
Subject: Re: [Flashcoders] Overriding the trace command

As everyone else mentioned, I don't think there's a way to override the
trace function in as3.

However, if you put a public function in the unnamed package, your
application will be able to reach this function from anywhere,
so if you're willing to use something else like log() or debug() as a method
name instead of trace(), then you can
replicate the trace function's behavior and add your own customizations.
I've been using this to route my traces to AirLogger, for example.

As a quick demo, this would just route your arguments to the trace function.
Just put the following code in a file called debug.as in the root of your
classpath.

package {
public function debug(...args):void {
trace.apply(null, args);
}
}

Hope this helps!



On Tue, Jul 15, 2008 at 10:08 AM, Juan Pablo Califano 
[EMAIL PROTECTED] wrote:

 I'm afraid you can't extend the trace builtin function . Using another
 function or logging class and then redirecting the trace to some logger
 console or even the trace() function, if at some point you need it, is the
 way to go. MTASC handles that trace replacement through a compiler
 switch, like a preprocessor macro, making textual substitutions to trace
 calls in the AS.

 The thing is that trace function is not compiled into a call to an
 actionscript function, but it's embedded directly with its own bytcode in
 the swf. That's why you can't change its behaviour from AS code.


 Cheers
 Juan Pablo Califano

 2008/7/15, Adam Jowett [EMAIL PROTECTED]:
 
  Hi all,
 
 
 
  A very quick one, I haven't had to over-ride or extend built in classes
  since the good old days of prototyping in AS1, specifically this time I
  want
  to extend the built in trace() statement with some conditions etc. Can
 this
  be done? or do I need to do my own custom logger such as those out there
 at
  the moment?
 
 
 
  Cheers
 
  Adam
 
  ___
  Flashcoders mailing list
  Flashcoders@chattyfig.figleaf.com
  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
 
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

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

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


[Flashcoders] Custom RegExp problem

2008-07-14 Thread Adam Jowett

Hey all,

Just wondering if anyone more familiar with RegExp can pick what might 
be causing the convertToCurrency function below to crash the Flash IDE 
and/or browser (no problems if publishing from a straight FlashDevelop 
project for some reason). Below is firstly how I call it, and secondly 
the class itself:



...

private var _global:Object = GlobalObject.vars;

var currencyFormat:Function = new CustomRegExp().convertToCurrency;
_global.convertToCurrency = currencyFormat;

...


package utils.CustomRegExp
{
   public class CustomRegExp extends RegExp
   {
   public function CustomRegExp()
   {
   }
  
   public function convertToCurrency ($val:Number):String

   {
   var pattern:RegExp = /(\d+)(\d{3}(\.|,|$))/gi;
   var returnString:String = String($val.toFixed(2));
  
   while (returnString.match(pattern).length != 0)

   {
   returnString = (returnString.replace(pattern, $1,$2));   
   }
  
   return returnString;

   }
   }
}


If there is an alternative to the above I would love to see it, but 
still curious why the above would cause problems.


Cheers
Adam

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


[Flashcoders] Overriding the trace command

2008-07-14 Thread Adam Jowett
Hi all,

 

A very quick one, I haven't had to over-ride or extend built in classes
since the good old days of prototyping in AS1, specifically this time I want
to extend the built in trace() statement with some conditions etc. Can this
be done? or do I need to do my own custom logger such as those out there at
the moment?

 

Cheers

Adam

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


RE: [Flashcoders] Flash And AJAX

2008-07-02 Thread Adam Jowett
What you are looking for is SWFAddress I suspect .. have a look here:

http://www.asual.com/swfaddress/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bassam M
Sent: Thursday, 3 July 2008 6:43 AM
To: [EMAIL PROTECTED]
Cc: Flash Coders List
Subject: [Flashcoders] Flash And AJAX

Hi guys
anyone can tell me where to find tutorial to use AJAX wih flash  I need to
know how can I call flash file from flash menu and load flash file without
refesh the page
only the URL change like this http://domain.com/#/about for about page and
is I click services the URl change  http://domain.com/#/services
and the services page load without refersh
please help me to find out how can I do it

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