RE: Air apps easily decompiled and hacked

2014-02-19 Thread Gordon Smith
Are you sure the others that aren't obscured are locals? I'd bet they're 
instance variables.

- Gordon

-Original Message-
From: Sean Thayne [mailto:s...@skyseek.com] 
Sent: Wednesday, February 19, 2014 12:24 PM
To: users@flex.apache.org
Subject: Re: Air apps easily decompiled and hacked

Ya, you right Alex, I re-checked, and there are not comments. It does keep
trace() calls though.

I also noticed that it does obscure some local vars into _loc_# vars, and but 
it doesn't obscure others, which I think is kinda weird.

-Sean Thayne


On Wed, Feb 19, 2014 at 11:47 AM, Alex Harui  wrote:

> Comments are easily viewable?  I don't think so.  It also depends on 
> whether you have the original source files or not.  For Google 
> Closure, if you have a source map, you can get back to the source as well.
>
> Try dumping out an export release version of one of your SWFs.  Sure 
> you can get back from the byte code to the basic algorithm, but I 
> don't think it is that much easier than deciphering a minified js or 
> even looking at intel byte code in an EXE file.
>
> -Alex
> 
> From: Sean Thayne 
> Sent: Wednesday, February 19, 2014 8:21 AM
> To: users@flex.apache.org
> Subject: Re: Air apps easily decompiled and hacked
>
> I'm actually more concerned about the plain readability of the AS3, 
> even comments are easily viewable. Where as a JS site that has been 
> compile with Google Closures is minimized and heavily obscured. I feel 
> like it would be very easy to steal someones hard work.
>
> -Sean Thayne
>
>
> On Wed, Feb 19, 2014 at 9:18 AM, Gary Yang  wrote:
>
> > Client side can not be trusted, server api should always be the 
> > security gate!
> >
> > After all there are certain applications that can encrypt Flash 
> > applications, Javascript application is just plain text!!!
> >
> >
> > On Wed, Feb 19, 2014 at 11:08 AM, Sean Thayne  wrote:
> >
> > > Anybody else concerned about decompilers like SoThink?
> > >
> > > http://www.ericzhang.me/cracking-adobe-air-applications/
> > >
> > > -Sean Thayne
> > >
> >
>


RE: Air apps easily decompiled and hacked

2014-02-19 Thread Gordon Smith
It's this way because of the dynamic nature of ActionScript. If an object obj 
has an instance variable foo, the language allows that variable to be accessed 
by name lookup. For example, obj["foo"] or obj["f" + "o" + "o"] or 
obj[propName] , where propName has the value "foo", are all ways of accessing 
o.foo by name at runtime. If the name was not stored in the SWF, the variable 
could not be accessed by name lookup at runtime.

- Gordon


-Original Message-
From: Sean Thayne [mailto:s...@skyseek.com] 
Sent: Wednesday, February 19, 2014 12:41 PM
To: users@flex.apache.org
Subject: Re: Air apps easily decompiled and hacked

It looks like every var declared inside a function is obscured/renamed. But all 
class vars(regardless of protected, public, private) are not obscured.
They keep their original naming. Which would make sense if your compiling a 
swc, but not if your compiling a final application (I would think). Maybe it 
was created this way for RSLs?

-Sean Thayne


On Wed, Feb 19, 2014 at 1:33 PM, Gordon Smith  wrote:

> Are you sure the others that aren't obscured are locals? I'd bet 
> they're instance variables.
>
> - Gordon
>
> -Original Message-
> From: Sean Thayne [mailto:s...@skyseek.com]
> Sent: Wednesday, February 19, 2014 12:24 PM
> To: users@flex.apache.org
> Subject: Re: Air apps easily decompiled and hacked
>
> Ya, you right Alex, I re-checked, and there are not comments. It does 
> keep
> trace() calls though.
>
> I also noticed that it does obscure some local vars into _loc_# vars, 
> and but it doesn't obscure others, which I think is kinda weird.
>
> -Sean Thayne
>
>
> On Wed, Feb 19, 2014 at 11:47 AM, Alex Harui  wrote:
>
> > Comments are easily viewable?  I don't think so.  It also depends on 
> > whether you have the original source files or not.  For Google 
> > Closure, if you have a source map, you can get back to the source as
> well.
> >
> > Try dumping out an export release version of one of your SWFs.  Sure 
> > you can get back from the byte code to the basic algorithm, but I 
> > don't think it is that much easier than deciphering a minified js or 
> > even looking at intel byte code in an EXE file.
> >
> > -Alex
> > 
> > From: Sean Thayne 
> > Sent: Wednesday, February 19, 2014 8:21 AM
> > To: users@flex.apache.org
> > Subject: Re: Air apps easily decompiled and hacked
> >
> > I'm actually more concerned about the plain readability of the AS3, 
> > even comments are easily viewable. Where as a JS site that has been 
> > compile with Google Closures is minimized and heavily obscured. I 
> > feel like it would be very easy to steal someones hard work.
> >
> > -Sean Thayne
> >
> >
> > On Wed, Feb 19, 2014 at 9:18 AM, Gary Yang 
> wrote:
> >
> > > Client side can not be trusted, server api should always be the 
> > > security gate!
> > >
> > > After all there are certain applications that can encrypt Flash 
> > > applications, Javascript application is just plain text!!!
> > >
> > >
> > > On Wed, Feb 19, 2014 at 11:08 AM, Sean Thayne 
> wrote:
> > >
> > > > Anybody else concerned about decompilers like SoThink?
> > > >
> > > > http://www.ericzhang.me/cracking-adobe-air-applications/
> > > >
> > > > -Sean Thayne
> > > >
> > >
> >
>


RE: ActionScript AST

2014-06-27 Thread Gordon Smith
I agree that you should investigate using Falcon. think you'll find that the 
classes making up Falcon's AST are reasonably intuitive and have good Javadoc 
documentation.
 
If you get Falcon compiling in Eclipse and run a compile in Debug mode, you'll 
see an indented tree-like representation of the AST whenever you inspect an AST 
node instance.
 
- Gordon
 
> From: aha...@adobe.com
> To: users@flex.apache.org
> Subject: Re: ActionScript AST
> Date: Fri, 27 Jun 2014 05:44:50 +
> 
> 
> 
> On 6/26/14 6:21 AM, "Mariana Gheorghe" 
> wrote:
> 
> >Hello,
> >
> >We are looking for a way to obtain and rewrite the AST (abstract syntax
> >tree) for an AS file. Currently, we are using the compiler library that
> >comes with the SDK, and we've obtained the AST rooted at a ProgramNode.
> >We are now unsure on how to proceed to: a) make modifications to the
> >tree (e.g. add a variable, add a parameter to a function), and b)
> >generate the code from a (modified) tree. Any hints on how to do this
> >would be appreciated!
> I find the MXMLC code to be very difficult.
> 
> >
> >Also, we were wondering about the status of Falcon, and if we should in
> >fact use Falcon to obtain/rewrite the AST, instead of the compiler from
> >the SDK.
> Falcon has released a 0.0.1 alpha, we'll ship a 0.0.2 soon.  I find the
> code base much easier to work with.
> 
> -Alex
> 
  

Re: ActionScript AST

2014-07-01 Thread Gordon Smith
There are APIs in each node class that are used to build the AST (based on the 
token stream), and you should be able to use them to modify an existing AST. 
But there is currently no way to listen to changes. You can turn an AST into 
ABC byte code but not back into AS source code. However, regenerating AS should 
be reasonably easy if you need to do that. But if you need to maintain the same 
formatting that the original AS had, it will be hard because the current AST 
represents the complete semantics of the AS but not the complete formatting of 
the AS. For example, the AST does not represent any comments or any semicolons 
that terminate statements.

- Gordon

Sent from my iPad

> On Jun 30, 2014, at 9:59 AM, "Alex Harui"  wrote:
> 
> Hopefully Gordon will reply as he knows this code better.  I haven't had to 
> do much AST surgery.
> 
> I do want to point out that in the FalconJX project, the AST code generation 
> is done differently.  There is no ABC output for FalconJX but it would be 
> interesting to have one in order to compare performance against the BURM the 
> regular Falcon project uses.  Output hacking might be easier in FalconJX.
> 
> -Alex 
> 
> From: Mariana Gheorghe [mariana.gheor...@crispico.com]
> Sent: Monday, June 30, 2014 7:35 AM
> To: users@flex.apache.org
> Subject: Re: ActionScript AST
> 
> Thank you both for the suggestion, we've started using Falcon, and
> indeed, it seems that the AST is much easier to use, and the code is
> well documented.
> 
> So far, we have obtained the AST for an AS file, and now we are looking
> for a way to do rewriting. We want to be able to make modifications to
> the AST (e.g. change the return type of a function, add a parameter),
> and then generate the AS code to show these modifications (i.e. with the
> new return type or parameter etc). Is there any functionality already
> implemented in Falcon that would help us achieve this? E.g. listening to
> AST changes, generating AS code from an AST node.
> 
> Any hints would be appreciated!
> 
> Mariana
> 
> 
>> On 27.06.2014 22:44, Gordon Smith wrote:
>> I agree that you should investigate using Falcon. think you'll find that the 
>> classes making up Falcon's AST are reasonably intuitive and have good 
>> Javadoc documentation.
>> 
>> If you get Falcon compiling in Eclipse and run a compile in Debug mode, 
>> you'll see an indented tree-like representation of the AST whenever you 
>> inspect an AST node instance.
>> 
>> - Gordon
>> 
>>> From: aha...@adobe.com
>>> To: users@flex.apache.org
>>> Subject: Re: ActionScript AST
>>> Date: Fri, 27 Jun 2014 05:44:50 +
>>> 
>>> 
>>> 
>>> On 6/26/14 6:21 AM, "Mariana Gheorghe" 
>>> wrote:
>>> 
>>>> Hello,
>>>> 
>>>> We are looking for a way to obtain and rewrite the AST (abstract syntax
>>>> tree) for an AS file. Currently, we are using the compiler library that
>>>> comes with the SDK, and we've obtained the AST rooted at a ProgramNode.
>>>> We are now unsure on how to proceed to: a) make modifications to the
>>>> tree (e.g. add a variable, add a parameter to a function), and b)
>>>> generate the code from a (modified) tree. Any hints on how to do this
>>>> would be appreciated!
>>> I find the MXMLC code to be very difficult.
>>> 
>>>> Also, we were wondering about the status of Falcon, and if we should in
>>>> fact use Falcon to obtain/rewrite the AST, instead of the compiler from
>>>> the SDK.
>>> Falcon has released a 0.0.1 alpha, we'll ship a 0.0.2 soon.  I find the
>>> code base much easier to work with.
>>> 
>>> -Alex
>>> 
>> 
> 


Re: Decimal to Hex conversion.

2014-09-30 Thread Gordon Smith
Converting decimal numbers with fractional parts to hex is rather unusual. I'm 
curious why you want to do this.

 - Gordon

> On Sep 29, 2014, at 4:23 AM, "Saju Thankathurai"  
> wrote:
> 
> Hi,
> 
> How can we convert a decimal value to Hex value?
> 
> I need to convert *1345.4567 *value to HEX value. I used the below code to
> convert decimal values to Hex,
> 
> hexVal.text = uint(scaledVal.text).toString(16).toUpperCase();
> 
> 
> Below code to convert from Hex to decimal.
> var texts:String = "0x"+hexVal.text;
> scaledVal.text = uint(texts).toString(10);
> 
> 
> The value 1345 is converted to HEX without any issues. But after the
> decimal part, it is not converting.
> 
> Could some one give inputs on this conversion.
> 
> 
> --
> Regards
> Saju Thankathurai,


Re: Decimal to Hex conversion.

2014-10-01 Thread Gordon Smith
A requirement for what kind of application for what kind of user? I've never 
met a user that would understand fractional hex values which is why I'm curious.

- Gordon

> On Sep 30, 2014, at 7:58 PM, "Saju Thankathurai"  
> wrote:
> 
> Actually it was a requirement that's why i asked. Thanks for your answers.
> 
> 
> --
> Regards
> 
> Saju Thankathurai,
> 
> 
> On Wed, Oct 1, 2014 at 5:09 AM, Frédéric THOMAS 
> wrote:
> 
>> Hi gordon, really, I didn't want, just because some else wanted and I
>> answered giving a mathematical uncorrected solution, I pushed the thing a
>> little more deeply and found I was even totally wrong and then wanted to
>> give the right answer, for himself, I don't know what was his goal really.
>> 
>> Frédéric THOMAS
>> 
>>> Subject: Re: Decimal to Hex conversion.
>>> From: gsmit...@hotmail.com
>>> Date: Tue, 30 Sep 2014 09:17:18 -0700
>>> To: users@flex.apache.org
>>> 
>>> Converting decimal numbers with fractional parts to hex is rather
>> unusual. I'm curious why you want to do this.
>>> 
>>> - Gordon
>>> 
 On Sep 29, 2014, at 4:23 AM, "Saju Thankathurai" <
>> sathikeshj...@gmail.com> wrote:
 
 Hi,
 
 How can we convert a decimal value to Hex value?
 
 I need to convert *1345.4567 *value to HEX value. I used the below
>> code to
 convert decimal values to Hex,
 
 hexVal.text = uint(scaledVal.text).toString(16).toUpperCase();
 
 
 Below code to convert from Hex to decimal.
 var texts:String = "0x"+hexVal.text;
 scaledVal.text = uint(texts).toString(10);
 
 
 The value 1345 is converted to HEX without any issues. But after the
 decimal part, it is not converting.
 
 Could some one give inputs on this conversion.
 
 
 --
 Regards
 Saju Thankathurai,
>> 
>> 


Re: Hierarchy Tree

2014-10-30 Thread Gordon Smith
labelField =  doesn't work?

- Gordon 

> On Oct 29, 2014, at 3:00 AM, mark goldin  wrote:
> 
> That's exactly what I dont want.  I have an element based XML, no
> attributes.
> 
>> On Wed, Oct 29, 2014 at 1:03 AM, pkumar.flex  wrote:
>> 
>> if you want to display xml attribute on Tree node then use labelFiled =
>> @
>> 
>> On Tue, Oct 28, 2014 at 11:42 PM, mark goldin [via Apache Flex Users] <
>> ml-node+s246n8535...@n4.nabble.com> wrote:
>> 
>>> I need to show data in the Tree control. The xml comes down transformed
>>> into a hierarchical structure but it's an element based XML. I am trying
>>> to
>>> use it, but I see that it would work if I have an attribute based
>>> structure. Can I still use the one I am getting, or I need to change xslt
>>> to output it as an attribute based xml?
>>> 
>>> Thanks
>>> 
>>> 
>>> --
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>> http://apache-flex-users.246.n4.nabble.com/Hierarchy-Tree-tp8535.html
>>> To unsubscribe from Apache Flex Users, click here
>>> <
>> http://apache-flex-users.246.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=cHJhc2hha3VtYXJAZ21haWwuY29tfDF8LTU0MTcyMzE2NA==
>>> 
>>> .
>>> NAML
>>> <
>> http://apache-flex-users.246.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
>> 
>> 
>> 
>> --
>> *Regards,*
>> Prashant Kumar* | *Mob.: +91 8408811225
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://apache-flex-users.246.n4.nabble.com/Hierarchy-Tree-tp8535p8540.html
>> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>> 


RE: Math.pow in ActionScript

2014-11-11 Thread Gordon Smith
 NO NO NO.
 
16 to the power 14 is indeed 72057594037927936. Calculator is absolutely 
correct. It is presumably doing high-precision integer arithmetic.
 
ActionScript is using floating point arithmetic, since you can ask for things 
like Math.pow(16.1, 14.2). It doesn't special case on integers, and even if it 
did it doesn't do high-precision integer arithmetic. It gets the wrong answer 
because floating-point numbers don't have a sufficient number of significant 
digits to produce a 17-digit result exactly. It simply computes powers by 
taking the log() of the first argument, multiplying it by the second argument, 
and then taking the exp() of the result, because a^b = e^(ln(a^b)) = e^(b 
ln(a)). These are all floating-point operations.
 
- Gordon
 
> From: javi...@gmail.com
> Date: Tue, 11 Nov 2014 19:48:38 +0100
> Subject: Re: Math.pow in ActionScript
> To: users@flex.apache.org
> 
> Don't worry at all about the Calculator result :)
> 
> http://www.askvg.com/microsoft-windows-calculator-bug/
> 
> The math engine of the calculator is well known as quite buggy :) Once
> again, ActionScript is right :)
> 
> On Tue, Nov 11, 2014 at 7:39 PM, OmPrakash Muppirala 
> wrote:
> 
> > Doing a Math.pow(16,14) in JavaScript results in 72057594037927940 as well.
> > Google's calculator gives the same answer as well:
> > http://lmgtfy.com/?q=16+to+the+power+of+14
> >
> > Majority wins, I guess ;-)
> >
> > On Tue, Nov 11, 2014 at 10:25 AM, Harbs  wrote:
> >
> > > I’m not sure why you think it’s not using floats.
> > >
> > > Take a look here:
> > >
> > >
> > http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Math.html
> > >
> > > Specifically:
> > > Note: The Math functions acos, asin, atan, atan2, cos, exp, log, pow,
> > sin,
> > > and sqrt may result in slightly different values depending on the
> > > algorithms used by the CPU or operating system. Flash runtimes call on
> > the
> > > CPU (or operating system if the CPU doesn't support floating point
> > > calculations) when performing the calculations for the listed functions,
> > > and results have shown slight variations depending upon the CPU or
> > > operating system in use.
> > >
> > > Harbs
> > >
> > > On Nov 11, 2014, at 7:50 PM, Devesh Mishra(NABFS00) <
> > > devesh.dmis...@igate.com> wrote:
> > >
> > > > It's not floating point number. So I don't think so.
> > > >
> > > > --
> > > > Thanks & Regards,
> > > > Devesh Mishra
> > > >
> > > > -Original Message-
> > > > From: Subscriptions [mailto:subscripti...@leeburrows.com]
> > > > Sent: Tuesday, November 11, 2014 10:44 PM
> > > > To: users@flex.apache.org
> > > > Subject: Re: Math.pow in ActionScript
> > > >
> > > > presumably due to precision issues with large numbers (ie not your
> > > > fault) eg:
> > http://en.wikipedia.org/wiki/Floating_point#Accuracy_problems
> > > >
> > > > Lee Burrows
> > > > ActionScripter
> > > >
> > > > On 11/11/2014 16:38, Devesh Mishra(NABFS00) wrote:
> > > >> Hi,
> > > >>
> > > >> I am using Math.pow(x,y) method in action script. But I am very
> > > surprised with the results.
> > > >>
> > > >> For example, Math.pow(16,14).
> > > >>
> > > >> In Action Script, it gives:72057594037927940
> > > >> In Calculator, it gives:  72057594037927936
> > > >>
> > > >> What may be the reason for this difference , Any idea !
> > > >>
> > > >>
> > > >> --
> > > >> Thanks & Regards,
> > > >> Devesh Mishra
> > > >>
> > > >>
> > > >>
> > >
> > ~~Disclaimer~~~
> > > >> Information contained and transmitted by this e-mail is confidential
> > > and proprietary to IGATE and its affiliates and is intended for use only
> > by
> > > the recipient. If you are not the intended recipient, you are hereby
> > > notified that any dissemination, distribution, copying or use of this
> > > e-mail is strictly prohibited and you are requested to delete this e-mail
> > > immediately and notify the originator or mailad...@igate.com  > > mailad...@igate.com>. IGATE does not enter into any agreement with any
> > > party by e-mail. Any views expressed by an individual do not necessarily
> > > reflect the view of IGATE. IGATE is not responsible for the consequences
> > of
> > > any actions taken on the basis of information provided, through this
> > email.
> > > The contents of an attachment to this e-mail may contain software
> > viruses,
> > > which could damage your own computer system. While IGATE has taken every
> > > reasonable precaution to minimise this risk, we cannot accept liability
> > for
> > > any damage which you sustain as a result of software viruses. You should
> > > carry out your own virus checks before opening an attachment. To know
> > more
> > > about IGATE please visit www.igate.com .
> > > >>
> > >
> > 

RE: Is there a way to check if a style exists on an object

2015-01-12 Thread Gordon Smith
What about object.getStyle("style") === undefined? I don't think any styles are 
ever deliberately set to undefined.
 
- Gordon
 
> From: flexcapaci...@gmail.com
> Date: Mon, 12 Jan 2015 17:45:45 -0800
> Subject: Is there a way to check if a style exists on an object
> To: users@flex.apache.org
> 
> Is there a way to check if there is a style on an object?
> 
> We can use the following for properties:
> 
>  ("property" in object || object.hasOwnProperty("property"))
> 
> I'm looking for something like this:
> 
> ("style" in object || object.hasOwnStyle("style"))
> 
> If not does anyone want to write it or recommend a way or API for it to be
> written?
> 
> Just this second I thought of this:
> 
> ("style" in object.inheritedStyles || "style" in object.nonInheritedStyles)
> 
> If that works maybe we can add it:
> 
> // check if style exists
> public function hasStyle(styleName:String, inherited:Boolean = false) {
> 
> }
> 
> Jude
  

RE: AW: tracking down where "[trace] null" statements are comming from?

2013-01-23 Thread Gordon Smith
Is it possible to monkey-patch trace() to substitute your own version, and set 
a breakpoint in it?

- Gordon

-Original Message-
From: Michael Montoya [mailto:montoyl...@gmail.com] 
Sent: Wednesday, January 23, 2013 4:02 AM
To: users@flex.apache.org
Subject: Re: AW: tracking down where "[trace] null" statements are comming from?

Hey Chris,

This may be a long shot, but how about using a an swf decompiler? I remember 
ising Trillix awhile back and was very impressed by the amount of detail 
provided in the diagnostics - It may pinpoint the source of your trace 
statement...

Cheers!

On Jan 23, 2013, at 11:46 AM, "christofer.d...@c-ware.de" 
 wrote:

> Hi Omar,
> 
> thanks for that input ... I knew that "trace" is a Flash function.  I 
> was simply hoping for some guru here to give me a hint to the 
> "ultimate way to debug this" ;-) As it would help quite a lot ... 
> especially when having AMF serialization/deserialization problems (The 
> other type of problems that seem to be really hard to debug)
> 
> Chris
> 
> -Ursprüngliche Nachricht-
> Von: Omar Gonzalez [mailto:omarg.develo...@gmail.com]
> Gesendet: Mittwoch, 23. Januar 2013 11:00
> An: users@flex.apache.org
> Betreff: Re: tracking down where "[trace] null" statements are comming from?
> 
> On Wednesday, January 23, 2013, christofer.d...@c-ware.de wrote:
> 
>> Unfortunately I can't set a breakpoint to the "trace" function ...
>> perhaps it would be good if in future versions of flex there would be 
>> the means to somehow do this.
>> 
>> Chris
> 
> The trace() function is not a method from Flex it comes from Flash player.
> There really isn't anything that can be done at the Flex level.
> 
> I would try to get source code for your 3rd party libraries  and search for 
> trace statements. If the source isn't available then you're probably out of 
> luck. Or you can try a decompiler.
> 
> Also, I don't know enough about Adobe Scout but maybe that could help you 
> narrow it down.
> 
> -omar


RE: AW: tracking down where "[trace] null" statements are comming from?

2013-01-23 Thread Gordon Smith
Isn't trace() is just a public function in the unnamed package? I'd try putting 
a file with

package
{
public function trace(...args):void
{
var i:int = 0; // set breakpoint here
}
}
   
on the source path. Then mxmlc should find this trace() instead of the trace() 
in playerglobal.swc. But I've never tried monkey-patching a non-method, or 
anything that is native.

- Gordon


-Original Message-
From: Alex Harui [mailto:aha...@adobe.com] 
Sent: Wednesday, January 23, 2013 9:56 AM
To: users@flex.apache.org
Subject: Re: AW: tracking down where "[trace] null" statements are comming from?

I'm not sure how to do that.

But consider this: When the flex tool chain creates a SWF in release mode, it 
cleans out trace statements, so whatever is spitting a trace has debug code in 
it.  The swfdump decompiler will certainly show you what SWFs have debug code 
in it.  

Then, I generally use divide and conquer by placing breakpoints and seeing if 
the flashlog.txt has the trace in it.  But once you get to a "reasonable"
boundary around the area, you can also use the poorly documented 
flash.trace.Trace to dump all function calls leading up to the trace statement.

On 1/23/13 9:48 AM, "Gordon Smith"  wrote:

> Is it possible to monkey-patch trace() to substitute your own version, 
> and set a breakpoint in it?
> 
> - Gordon
> 
> -Original Message-
> From: Michael Montoya [mailto:montoyl...@gmail.com]
> Sent: Wednesday, January 23, 2013 4:02 AM
> To: users@flex.apache.org
> Subject: Re: AW: tracking down where "[trace] null" statements are 
> comming from?
> 
> Hey Chris,
> 
> This may be a long shot, but how about using a an swf decompiler? I 
> remember ising Trillix awhile back and was very impressed by the 
> amount of detail provided in the diagnostics - It may pinpoint the 
> source of your trace statement...
> 
> Cheers!
> 
> On Jan 23, 2013, at 11:46 AM, "christofer.d...@c-ware.de"
>  wrote:
> 
>> Hi Omar,
>> 
>> thanks for that input ... I knew that "trace" is a Flash function.  I 
>> was simply hoping for some guru here to give me a hint to the 
>> "ultimate way to debug this" ;-) As it would help quite a lot ...
>> especially when having AMF serialization/deserialization problems 
>> (The other type of problems that seem to be really hard to debug)
>> 
>> Chris
>> 
>> -Ursprüngliche Nachricht-
>> Von: Omar Gonzalez [mailto:omarg.develo...@gmail.com]
>> Gesendet: Mittwoch, 23. Januar 2013 11:00
>> An: users@flex.apache.org
>> Betreff: Re: tracking down where "[trace] null" statements are comming from?
>> 
>> On Wednesday, January 23, 2013, christofer.d...@c-ware.de wrote:
>> 
>>> Unfortunately I can't set a breakpoint to the "trace" function ...
>>> perhaps it would be good if in future versions of flex there would 
>>> be the means to somehow do this.
>>> 
>>> Chris
>> 
>> The trace() function is not a method from Flex it comes from Flash player.
>> There really isn't anything that can be done at the Flex level.
>> 
>> I would try to get source code for your 3rd party libraries  and 
>> search for trace statements. If the source isn't available then 
>> you're probably out of luck. Or you can try a decompiler.
>> 
>> Also, I don't know enough about Adobe Scout but maybe that could help 
>> you narrow it down.
>> 
>> -omar

--
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui



RE: tracking down where "[trace] null" statements are comming from?

2013-01-23 Thread Gordon Smith
I don't think the compiler knows anything special about trace(); I think it 
just finds it in playerglobal.swc. But the fact that it is 'native' may explain 
why you can't monkey-patch it. You can't override it because it isn't a virtual 
method of a class, it's a package-level function.

- Gordon

-Original Message-
From: David Coleman [mailto:david_coleman_...@hotmail.com] 
Sent: Wednesday, January 23, 2013 1:49 PM
To: users@flex.apache.org
Subject: RE: tracking down where "[trace] null" statements are comming from?

yeah, jude, I've tried that override the trace trick... no dice.  trace is a 
low level keyword

> From: flexcapaci...@gmail.com
> Date: Wed, 23 Jan 2013 15:44:22 -0600
> Subject: Re: tracking down where "[trace] null" statements are comming from?
> To: users@flex.apache.org
> 
> Yeah, Search in Files (CTRL + H in Eclipse) is what I ended up doing 
> in a similar situation but I had access to all the libraries.
> 
> It's also a good idea to use TraceTargets, although I haven't used it 
> until relatively recently. They let you control the destination of 
> trace statements, the level of information (debug, info, error, etc), 
> along with source of the call, timestamp and so on.
> 
> Maybe in the next Flex SDK we can override trace (or create an 
> alternative like "console") to point to an Application or 
> SystemManager level trace target.
> 
> 
> On Wed, Jan 23, 2013 at 3:30 PM, David Coleman < 
> david_coleman_...@hotmail.com> wrote:
> 
> > yeah Wayne is right, and another option that *I* find particularly 
> > useful is go get the source code for your libraries and copy it into 
> > your src folder.  then you only link to the code that you need.  You 
> > don't use any more space than you would with a pre-compiled swc (in 
> > fact you may use less).  AND you have access to all the black magic 
> > voodoo that your libraries might be doing.  In this way it ceases to 
> > become voodoo and becomes your code to tweak and polish to meet your 
> > specific needs.  There are no real licensing concerns with this 
> > approach since using the swc in the first place already places you 
> > in a position of dependency on your eula for that particular package.
> >
> > This way you can do as Wayne suggests and simply search for the 
> > trace in the code and comment it!  :-)  And you now have full a-z 
> > control over your application's code.  Two birds, one stone = 1 happy 
> > developer.
> >
> > > Subject: Re: tracking down where "[trace] null" statements are 
> > > comming
> > from?
> > > From: waynestud...@me.com
> > > Date: Wed, 23 Jan 2013 21:17:55 +
> > > To: users@flex.apache.org
> > >
> > > Quick question - are your components linked swc's / ane's etc or
> > imported classes (as in a bunch of .as files)?
> > >
> > > If it's the latter you can use a tool like EasyFind (for Mac - no 
> > > idea
> > what a PC equivalent is) to search inside the files for any 'trace' strings.
> > >
> > > If the components are compiled swc's then you're going to have a 
> > > tough
> > time omitting the trace but I'm guessing it'll be somewhere in an 
> > imported .as file.
> > >
> > > Hope this helps?
> > >
> > > Wayne
> > >
> > > On 23 Jan 2013, at 21:00, "christofer.d...@c-ware.de" <
> > christofer.d...@c-ware.de> wrote:
> > >
> > > > Gee ... I really hoped this would work, cause it looked like the 
> > > > type
> > of AS voodoo I was hoping to find.
> > > > So I created a file "trace.as" and pasted in your code. IntelliJ
> > jumped to the right place, but the breakpoint was not hit.
> > > > In order to try if defining functions this way worked, I added 
> > > > the
> > same function (called "lalala" in a file called "lalala.as") and 
> > called both functions from initializing code ... lalala was hit, trace 
> > wasn't ...
> > so I guess this hack was a good idea, but it didn't work :-(
> > > >
> > > > Decompiling is problematic, as the Flexicious components have a 
> > > > copy
> > protection and decompiling that code would result in me losing my 
> > license ... I don't want to risk this after paying that much money 
> > for it ;-)
> > > >
> > > > Well I think I'll simply live with the trace statements :-|
> > > >
> > >

RE: who Open HTML in the Flex ?

2013-03-07 Thread Gordon Smith
> You gotta wonder what Adobe was thinking to not adding a fundamental feature 
> like this  inside Flash/Flex

The Flash Player team believed that adding WebKit would have made the player 
download so large (and therefore slow) that the ubiquity of the player would 
have been compromised.

- Gordon

-Original Message-
From: Alain Ekambi [mailto:jazzmatad...@gmail.com] 
Sent: Thursday, March 07, 2013 2:18 PM
To: users@flex.apache.org
Subject: Re: who Open HTML in the Flex ?

249 USD to display HTML in a web application. Insane.
You gotta wonder what Adobe was thinking to not adding a fundamental feature 
like this  inside Flash/Flex


2013/3/7 Om 

> (Moving thread to users@flex.apache.org.  Bcc-ing d...@flex.apache.org 
> in case someone wants to follow the thread.  )
>
> Marcio,
>
> For AIR, you can just use the built-in HTML component.
>
> I am assuming you want this for Flex on Flash Player.  I have worked 
> with Drumbeat's HTML component for Flex [1] and Flex-iframe [2]
>
> Both worked just fine for me.  There might some browser specific 
> annoyances, but for the most part things work fine.
>
> And you need to subscribe to users@flex.apache.org to read further 
> replies on this thread.
>
> Thanks,
> Om
>
> [1] http://drumbeatinsight.com/htmlcomponent
> [2] https://github.com/flex-users/flex-iframe
>
>
> On Thu, Mar 7, 2013 at 10:54 AM, Marcio Fermino < 
> prologicasiste...@gmail.com
> > wrote:
>
> > Hello friends.
> >
> >
> > Please any idea
> >
> >
> > I need open google.com in the TitleWindow any idea ?
> >
> > Thank you
> >
> >
> >
>


RE: How to get a class instance using string name?

2013-08-16 Thread Gordon Smith
Doesn't myModelInstance.vAxis1 work? Every MXML file defines a class, and every 
tag with an id defines a property in that class, where the name of the property 
is specified by the id. So when you have an instance of that class, you should 
just be able to use the dot operator to access that property, in the same way 
that you would access a public var or public getter in the class.

- Gordon

-Original Message-
From: Deepak MS [mailto:megharajdee...@gmail.com] 
Sent: Friday, August 16, 2013 5:17 AM
To: users@flex.apache.org
Subject: Re: How to get a class instance using string name?

To be precise, I was using linear axis in a model class, and i used 
myModelInstance["vAxis1"] and that worked. : ) That was simple concept but I 
kept banging my head with all types of combinations using  
getDefinitionByNamegetQualifiedClassName.

Thanks for the help everyone...

Cheers!


On Fri, Aug 16, 2013 at 5:23 PM, Jitendra Jain < warriorofheavens...@gmail.com> 
wrote:

> you can use myComponentName["myView"] where myComponentName is the 
> parent one and myView is the child
>
>
> On Fri, Aug 16, 2013 at 5:09 PM, Deepak MS 
> wrote:
>
> > Hi there,
> >
> > Is there a way we can get a running instance in our application, by 
> > using it's id as a String?
> >
> >
> >
> > For ex:
> >
> > I have a mxml line which is
> >
> >  > labelFunction="percentageformatAxis"  />
> >
> >
> >
> >
> >
> > There is a data xml in which these instance names (vAxis1, vAxis2 ...)
> shall
> > be declared:
> >
> >
> >
> > 
> >
> >
> >  > chartType="1" verticalAxis="vAxis1">
> >
> >
> >  > checked="1" chartType="2" verticalAxis="vAxis2"/>
> >
> >
> > 
> >
> >
> >  > chartType="2" verticalAxis="vAxis3">
> >
> >
> >  > attribute="@AUDMSGrowth" checked="0" chartType="1"
> verticalAxis="vAxis4"/>
> >
> >
> > 
> >
> > 
> > 
> >
> >
> >
> > This data would be dynamic and I am trying to assign verticalAxis
> attribute
> > value to verticalAxis property of a column series at runtime:
> >
> >
> >
> > colSeries = *new* ColumnSeries();
> >
> > colSeries.yField = 
> > String(metric.@attribute);
> >
> > 
> > colSeries.displayName = String(metric.@metricName);
> >
> >
> >
> >
> >
> > 
> > colSeries.verticalAxis = metric.@verticalAxis; //metric.@verticalAxis here 
> > would be a string.
> But I
> > have to reference the LinearAxis that I have declared on top, which 
> > is vAxis1.
> >
> >
> > seriesArray.push(colSeries);
> >
> >
> >
> > Is there any way we can achieve that?
> >
> >
> >
> > getDefinitionByName() would just give be the class, but I need the
> declared
> > instance.
> >
> >
> >
> >
> >
> > Warm regards,
> >
> > Deepak
> >
>
>
>
> --
> Thanks and Regards,
> JJain,
>
>If you have knowledge, let others light their candles in it 
> --Margaret
> Fuller:
>


Re: Send parameter to mxml constructor

2013-09-26 Thread Gordon Smith
MXML does not support constructor parameters. You need to set a property,
as in



Properties get set before children get created.

- Gordon

On 9/26/13 11:57 AM, "mark goldin"  wrote:

>I have an mxml class called Obj1. Somewhere in my code I do:
>var _obj1 = new Obj1();
>
>What I need is to provide some variable to Obj1 for its initialization. A
>reason for that is because Obj1 has children that need that variable for
>their initialization.
>But because I cannot send a parameter to Obj1's constructor I dont know
>how
>to solve my problem.
>Any idea?
>
>Thanks



RE: Variable Naming Convention

2013-11-04 Thread Gordon Smith
> Here's an example of mine:

Your example didn't appear in the email.

> Currently I might name a local variable as 'm_variableName'

Naming local variables m_variableName is a bad idea, as "m" stands for "member" 
(i.e. instance).

The getter/setter convention used by the Flex framework is

private var _fooBar:int;

public function get fooBar():int
{
return _fooBar;
}

public function set fooBar(value:int):void
{
_fooBar = value;
}

In other words, the "backing variable" for a getter/setter starts with an 
underscore.

Local variables in the Flex framework don't start with anything special.

- Gordon


-Original Message-
From: Tintin [mailto:1955.mille.mig...@googlemail.com] 
Sent: Monday, November 04, 2013 5:23 AM
To: users@flex.apache.org
Subject: Variable Naming Convention

Hello

I am about to set sail on a new project and I thought I should try and improve 
my naming conventions throughout the code. Bad habits are easily carried 
through from one language/project to the next.

I'm particularly trying to nail down an acceptable (I realise that one person's 
'acceptable' makes another person mad) convention for local variable names and 
instance variable names when employing Get and Set methods.

Currently I might name a local variable as 'm_variableName' and the instance 
variable as 'variableName'. Some people precede the instance variable name with 
simply an underscore for the local variable. It appears safe to assume a 
lowercase first letter and then capital letters for subsequent 'words' in the 
variable name.

Here's an example of mine:



Any thoughts very welcome.

Chris



--
View this message in context: 
http://apache-flex-users.246.n4.nabble.com/Variable-Naming-Convention-tp3517.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.


RE: Variable Naming Convention

2013-11-05 Thread Gordon Smith
The coding conventions that we used in the Flex framework are available at 
http://sourceforge.net/adobe/flexsdk/wiki/Coding%20Conventions/. Unfortunately, 
this document is in a wiki markup language and doesn't display as the intended 
HTML, but it's better than nothing.

- Gordon


-Original Message-
From: Tintin [mailto:1955.mille.mig...@googlemail.com] 
Sent: Tuesday, November 05, 2013 12:39 AM
To: users@flex.apache.org
Subject: RE: Variable Naming Convention

Hello Gordon

Thank you very much for replying to my question. I shall follow your suggested 
naming convention. I don't know where I picked up using the 'm_'
during my .NET days. There's always room to improve!

Regards

Chris



--
View this message in context: 
http://apache-flex-users.246.n4.nabble.com/Variable-Naming-Convention-tp3517p3530.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.