I want to play a sound's specific time, i tried using position , but not gonna help , help me please help me , i need to play a file from specific time to a specific time , i tried using current position , but how do i make it stop , i dont wanna use stop or close functions
protected function application1_applicationCompleteHandler(event:FlexEvent):void
{
snd.load(ul);
trace(snd.bytesTotal);
trace(snd.bytesLoaded);
trace(snd.isBuffering);
snd.addEventListener(Event.COMPLETE,nad);
snd.addEventListener(IOErrorEvent.IO_ERROR,rightu);
}
protected function rightu(event:IOErrorEvent):void
{
Alert.show("error");
}
public function nad(event:Event):void
{
trace(snd.bytesTotal);
trace(snd.bytesLoaded);
trace(snd.isBuffering);
p1.enabled=true;
}
protected function p1_clickHandler(event:MouseEvent):void
{
if(p1.label=="PLAY")
{
sc=snd.play(pause);
sc.soundTransform=st;
p1.label="PAUSE";
}
else
{
pause= sc.position;
sc.stop();
p1.label="PLAY";
}
}
protected function i1_clickHandler(event:MouseEvent):void
{
st.volume += .1;
if(st.volume > 1)
{
st.volume = 1;
}
sc.soundTransform=st;
}
protected function d1_clickHandler(event:MouseEvent):void
{
st.volume -= .1;
if(st.volume <0)
{
st.volume=0;
}
sc.soundTransform=st;
}
protected function pa1_clickHandler(event:MouseEvent):void
{
sc.stop();
p1.label="PLAY";
pause=0;
}
protected function test_clickHandler(event:MouseEvent):void
{
trace(sc.position);
}
]]>
</fx:Script>
<s:HGroup horizontalAlign="center" verticalAlign="middle">
<s:VGroup verticalAlign="middle" horizontalAlign="center">
<mx:ProgressBar id="q"/>
<s:Button id="p1" label="PLAY" enabled="false" click="p1_clickHandler(event)" />
<s:Button id="pa1" label="STOP" click="pa1_clickHandler(event)"/>
<s:Button id="i1" label="INCREASE" click="i1_clickHandler(event)"/>
<s:Button id="d1" label="DECREASE" click="d1_clickHandler(event)"/>
<s:Button id="test" click="test_clickHandler(event)"/>
</s:VGroup>
</s:HGroup>