Hi,
I have run into a strange problem (I work in Flash Studio 8).
I have a class that starts streaming a mp3 file in a Sound object.
When I do this alone, it works perfectly. But as soon as I also
animate something with the Tween class (using OnEnterFrameBeacon), the
mp3 stops playing at random positions.
Any suggestions?
-------------------------------
Application class:
[code]
import com.application.StreamedSound;
import com.application.Logo;
class com.application.Application {
private var _mcRoot:MovieClip;
function Application(mcRoot:MovieClip){
_mcRoot = mcRoot;
createLogo();
createSound();
}
private function createLogo():Void{
new Logo(_mcRoot.mcLogo);
}
private function createSound():Void{
var streamedsoundTest:StreamedSound = new
StreamedSound(_mcRoot);
}
}
[/code]
-------------------------------
StreamedSound class:
[code]
class com.application.StreamedSound {
private var _mcRoot:MovieClip;
private var _soundTest:Sound;
function StreamedSound(mcRoot:MovieClip){
_mcRoot = mcRoot;
loadSound();
}
private function loadSound():Void{
var mcSoundContainer:MovieClip =
_mcRoot.createEmptyMovieClip("mcSoundContainer",10);
_soundTest = new Sound();
_soundTest.loadSound("media/mp3/test.mp3",true);
}
}
[/code]
-------------------------------
Logo class:
[code]
import com.movement.tween.easing.*;
import com.movement.tween.Tween;
class com.application.Logo {
// instance properties
private var _mcLogo:MovieClip;
function Logo(mcLogo:MovieClip){
_mcLogo = mcLogo;
createLoadingTween();
}
private function createLoadingTween():Void{
var objLoadingListener:Object = new Object();
objLoadingListener.onMotionFinished = function():Void{
tweenLoading.yoyo();
}
var tweenLoading:Tween = new
Tween(_mcLogo,"_alpha",Quad.easeInOut,45,10,20);
tweenLoading.addEventListener("onMotionFinished",objLoadingListener);
}
}
[/code]
Thanks.
Tony
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders