Re: [Flashcoders] play sound via linkage

2009-02-13 Thread Joel Stransky
pass the string to getDefinitionByName()
var myClass:Object = getDefinitionByName(linkageID);
var snd:myClass = new myClass();
snd.play();

On Fri, Feb 13, 2009 at 5:11 PM, bernice guerrero wrote:

> Stop the messeges
>
> On Feb 13, 2009 8:24 AM, "Kenneth Kawamoto" 
> wrote:
>
> var snd:LinkedSound = new LinkedSound();
> snd.play();
>
> Kenneth Kawamoto
> http://www.materiaprima.co.uk/
>
> Mendelsohn, Michael wrote: > > Hi list... > > Silly AS3 question: how do
> you
> play a sound with a l...
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
--Joel Stransky
stranskydesign.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] play sound via linkage

2009-02-13 Thread bernice guerrero
Stop the messeges

On Feb 13, 2009 8:24 AM, "Kenneth Kawamoto" 
wrote:

var snd:LinkedSound = new LinkedSound();
snd.play();

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

Mendelsohn, Michael wrote: > > Hi list... > > Silly AS3 question: how do you
play a sound with a l...
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] play sound via linkage

2009-02-13 Thread Zeh Fernando
Exactly. Or, if you know the name and you don't need it to be a dynamic
reference, just do...

var snd:MySoundName = new MySoundName();
snd.play();

Where "MySoundName" is the name given to it in the library.

Zeh

On Fri, Feb 13, 2009 at 12:35 PM, Kenneth Kawamoto <
kennethkawam...@gmail.com> wrote:

> There are no "Linkage ID"s in AS3. Class names you are talking about? :)
>
> May be you can do something like:
>
> private function playSound(className:String):void {
>   var ClassRef:Class = getDefinitionByName(className) as Class;
>   var snd:Object = new ClassRef();
>   snd.play();
> }
>
>
> Kenneth Kawamoto
> http://www.materiaprima.co.uk/
>
> Mendelsohn, Michael wrote:
>
>> Thanks for responding Ken, but I'm passing a String (linkage id).  My
>> question is really how to create a new instance of the sound when I only
>> have the linkage identifier as a string?  I can't seem to cast it to a
>> Class.
>>
>> - MM
>>
>> -Original Message-
>> From: flashcoders-boun...@chattyfig.figleaf.com
>> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kenneth
>> Kawamoto
>> Sent: Friday, February 13, 2009 10:18 AM
>> To: Flash Coders List
>> Subject: Re: [Flashcoders] play sound via linkage
>>
>> var snd:LinkedSound = new LinkedSound();
>> snd.play();
>>
>> Kenneth Kawamoto
>> http://www.materiaprima.co.uk/
>>
>>
>> Mendelsohn, Michael wrote:
>>
>>> Hi list...
>>>
>>> Silly AS3 question: how do you play a sound with a linkage identifier?
>>>
>>
>>  public function playSound(linkageID:String):void{
>>>// these don't work
>>>var snd:Sound = new Sound(linkageID);
>>>var snd:* = new Class(linkageID);
>>>snd.play();
>>> }
>>>
>>> Thanks!
>>>
>>> - MM
>>>
>> ___
>> 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


Re: [Flashcoders] play sound via linkage

2009-02-13 Thread Kenneth Kawamoto

There are no "Linkage ID"s in AS3. Class names you are talking about? :)

May be you can do something like:

private function playSound(className:String):void {
   var ClassRef:Class = getDefinitionByName(className) as Class;
   var snd:Object = new ClassRef();
   snd.play();
}


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

Mendelsohn, Michael wrote:

Thanks for responding Ken, but I'm passing a String (linkage id).  My
question is really how to create a new instance of the sound when I only
have the linkage identifier as a string?  I can't seem to cast it to a
Class.

- MM

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kenneth
Kawamoto
Sent: Friday, February 13, 2009 10:18 AM
To: Flash Coders List
Subject: Re: [Flashcoders] play sound via linkage

var snd:LinkedSound = new LinkedSound();
snd.play();

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

Mendelsohn, Michael wrote:

Hi list...

Silly AS3 question: how do you play a sound with a linkage identifier?



public function playSound(linkageID:String):void{
// these don't work
var snd:Sound = new Sound(linkageID);
var snd:* = new Class(linkageID);
snd.play();
}

Thanks!

- MM

___
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


RE: [Flashcoders] play sound via linkage

2009-02-13 Thread Mendelsohn, Michael
Thanks for responding Ken, but I'm passing a String (linkage id).  My
question is really how to create a new instance of the sound when I only
have the linkage identifier as a string?  I can't seem to cast it to a
Class.

- MM

-Original Message-
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Kenneth
Kawamoto
Sent: Friday, February 13, 2009 10:18 AM
To: Flash Coders List
Subject: Re: [Flashcoders] play sound via linkage

var snd:LinkedSound = new LinkedSound();
snd.play();

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

Mendelsohn, Michael wrote:
> Hi list...
> 
> Silly AS3 question: how do you play a sound with a linkage identifier?

> 
> public function playSound(linkageID:String):void{
>   // these don't work
>   var snd:Sound = new Sound(linkageID);
>   var snd:* = new Class(linkageID);
>   snd.play();
> }
> 
> Thanks!
> 
> - MM
___
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


Re: [Flashcoders] play sound via linkage

2009-02-13 Thread Kenneth Kawamoto

var snd:LinkedSound = new LinkedSound();
snd.play();

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

Mendelsohn, Michael wrote:

Hi list...

Silly AS3 question: how do you play a sound with a linkage identifier? 


public function playSound(linkageID:String):void{
// these don't work
var snd:Sound = new Sound(linkageID);
var snd:* = new Class(linkageID);
snd.play();
}

Thanks!

- MM

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


[Flashcoders] play sound via linkage

2009-02-13 Thread Mendelsohn, Michael
Hi list...

Silly AS3 question: how do you play a sound with a linkage identifier? 

public function playSound(linkageID:String):void{
// these don't work
var snd:Sound = new Sound(linkageID);
var snd:* = new Class(linkageID);
snd.play();
}

Thanks!

- MM

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