Re: [flexcoders] Effects on Linkbar links

2007-02-03 Thread Jared Verdi
Ok, so I guess this was fairly easy.

What I ended up doing is catching the ChildExistenceChangeEvent for the 
LinkBar and attaching the rollover event to the added linkbutton:

private function 
addClickEvent(event:ChildExistenceChangedEvent):void {
if(event.type == ChildExistenceChangedEvent.CHILD_ADD  
event.relatedObject is LinkButton) {
var lb:LinkButton = (event.relatedObject as LinkButton);
lb.addEventListener(MouseEvent.ROLL_OVER, playClick);
}
}

  mx:LinkBar id=controller dataProvider=myViewstack 
childAdd=addClickEvent(event) /

Jared Verdi wrote:

 Given a sound effect:
 mx:SoundEffect id=click
 source=@Embed(source='assets/sounds/click.mp3') /

 and a linkbar which derives its links from a viewstack:
 mx:LinkBar id=controller dataProvider=myViewstack /

 How would I cause each link of the linkbar, rather than the linkbar
 itself to play the sound effect on a rollover event?

 Thanks

  



[flexcoders] Effects on Linkbar links

2007-01-24 Thread Jared Verdi
Given a sound effect:
mx:SoundEffect id=click 
source=@Embed(source='assets/sounds/click.mp3') /

and a linkbar which derives its links from a viewstack:
mx:LinkBar id=controller dataProvider=myViewstack /

How would I cause each link of the linkbar, rather than the linkbar 
itself to play the sound effect on a rollover event?

Thanks