Ah, didn't read the thread from the beginning.

You could also create an interface. For example

public function x(y:IEventDispatcher):void
{

}


> From: Hans Wichman <[email protected]>
> Reply-To: Flash Coders List <[email protected]>
> Date: Mon, 7 Jun 2010 21:45:50 +0200
> To: Flash Coders List <[email protected]>
> Subject: Re: [Flashcoders] problem with strongly typed actionscript
> 
> I send the same reply 8 hours ago, are my messages not coming through?:)
> 
> On Mon, Jun 7, 2010 at 9:05 PM, Patrick Matte
> <[email protected]>wrote:
> 
>> public function x(y:Object):void
>> {
>> 
>> }
>> 
>> Or this
>> 
>> public function x(y:*):void
>> {
>> 
>> }
>> 
>> 
>>> From: Steven Sacks <[email protected]>
>>> Reply-To: Flash Coders List <[email protected]>
>>> Date: Mon, 07 Jun 2010 11:38:07 -0700
>>> To: Flash Coders List <[email protected]>
>>> Subject: Re: [Flashcoders] problem with strongly typed actionscript
>>> 
>>> Architecturally speaking, that's a bad idea. There's probably a strongly
>> typed
>>> solution to what you're doing.  Can you provide detail about what you
>> need to
>>> accomplish so we can help you figure out a better solution?
>>> 
>>> 
>>> 
>>> On 6/7/2010 3:40 AM, Jim Andrews wrote:
>>>> i want to write a method x which takes an argument y. i cannot
>>>> anticipate what type the argument is going to be until run-time. it
>>>> might be a number or a string or an array or who knows what?
>>>> 
>>>> but i am not sure how to do this in actionscript because it is strongly
>>>> typed. normally what is done is
>>>> 
>>>> public function x(y:String):void
>>>> {
>>>> 
>>>> }
>>>> 
>>>> but this won't do because y is limited to being of type String, whereas
>>>> in the method i want to write, the type of y is not known until
>> run-time.
>>>> 
>>>> how do i do this in actionscript?
>>>> 
>>>> ja?
>>>> http://vispo.com
>>>> _______________________________________________
>>>> Flashcoders mailing list
>>>> [email protected]
>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>> 
>>> _______________________________________________
>>> Flashcoders mailing list
>>> [email protected]
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>> 
>> 
>> 
>> This e-mail is intended only for the named person or entity to which it is
>> addressed and contains valuable
>> business information that is proprietary, privileged, confidential and/or
>> otherwise protected from disclosure.
>> 
>> If you received this e-mail in error, any review, use, dissemination,
>> distribution or copying of this e-mail
>> is strictly prohibited. Please notify us immediately of the error via
>> e-mail to [email protected] and
>> please delete the e-mail from your system, retaining no copies in any
>> media. We appreciate your cooperation.
>> 
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>> 
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



This e-mail is intended only for the named person or entity to which it is 
addressed and contains valuable 
business information that is proprietary, privileged, confidential and/or 
otherwise protected from disclosure.

If you received this e-mail in error, any review, use, dissemination, 
distribution or copying of this e-mail 
is strictly prohibited. Please notify us immediately of the error via e-mail to 
[email protected] and 
please delete the e-mail from your system, retaining no copies in any media. We 
appreciate your cooperation.

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to