swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: [Swftools-common] an ActionScript question


From: Chris Pugh
Subject: Fwd: [Swftools-common] an ActionScript question
Date: Sat, 28 Nov 2009 11:16:47 +0000

I'm with Ricardo on the use of Globals. Rather unwise and messy!
What is wrong with keeping things tidy, and simply passing parameters
as and when required?

I'm not that well up on AS3, however if you must ( as in being hell
bent on a Global ), there is I believe nothing to stop you creating
a class called Global, visible to any classes in your project without
any form of import, i.e.

package {

    public class Global {

                         public static function yourAction():void {

                            trace("Called global function")


         }

                                }

              }


If you save this in the document root of your project, or any class
path previously defined, then you should then be able to call
it from anywhere with Global.yourAction()

> i dont see how throw/try/catch can change this problem of this function 
> accessibility an example is better than thousand words

I simply meant that you could subvert the existing run-time error
catching routines to your own ends.  All you doi is substitute your
custom error text.  I'll see if I can come up with an example.

HTH.

Salut,


Chris.
2009/11/27 jean-michel.voicechat_fan <address@hidden>:
> Hello chris it seems you dont  understand  my poor english
> I use already a own builtin trace function  as you can see in all the
>  sources on my site ( link already given )
> but i can use it only from the main class ricardo has show me how to use
> global variables with success
> but i wonder if we  can use a "global" function reachable from all classes
> i am under linux OS
> i dont see how throw/try/catch can change this problem of this function
> accessibility
> an example is better than thousand words
>
> the compilation seems ok  when trace is  described before the first class (
> as other global vars )
> but the call outputs nothing
>
> my audio video chat is on going and i will be very pleased to SEE you and a
> lot of swftools users
> even it is not working very well    my bandwith is very bad these days
> i dont it will have more then 2 persons at the same time
>
> thanks again for your help
>
> Chris Pugh a écrit :
>>
>> 2009/11/25 jean-michel.voicechat_fan <address@hidden>:
>>
>>>
>>> in fact i have tried another thing that does not work i want to have a
>>> common trace  function
>>> i have put  the lines outside the class the compilation is ok
>>> but the trace function  does not show anything
>>> see the old link
>>>
>>
>> As you are no doubt aware Trace simply dumps debugging info to the
>> Output Window in the one of the many
>> Flash Authoring Applications (  none of which I have, since I don't
>> use Flash! )  Since SWFTools is not a GUI
>> Application, it doesn';t have an output window, so you don't see anything.
>>
>> The easiest way is to fake the Trace oiutput with Exception Handling,
>> by Throwing ( triggering ) a trappable error, then sending the
>> resukltant output to say, an edittext object.
>>
>> Here's a random link on Throw/Try/Catch.
>>
>>   http://www.communitymx.com/content/article.cfm?page=3&cid=52C8C
>>
>> You can akso check the Adobe Actionscript Dictionaries.
>>
>> Bon chance!
>>
>> Salut,
>>
>>
>> Chris.
>>
>>
>>
>
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]