Need help please with an error and also a glitch in my .swf :)
ok explain 2 problems having media player @ moment , hope can explain clear enough understand
problem #1:
i getting error error #1009 null object reference etc etc etc...
i fixed adding following lines:
my_sound = new sound();
my_channel = new soundchannel();
now getting error seems because streaming mp3's external .xml file loading media player urlloader.
the error getting is:
argumenterror: error #2068: invalid sound.
at flash.media::sound/play()
at basicplayer_fla::maintimeline/dropit2()[basicplayer_fla.maintimeline::frame1:378]
which may wrong saying believe getting error audio being streamed , variable had in code:
var my_sound:sound;
var my_channel:soundchannel;
i had these variables stated hold sound , soundchannel objects.
the error @ line 378:
// function dropit2
// dropping slider
function dropit2(e:event):void
{
if (song_paused == false)
{
if (isdragging == true)
{
stopdrag();
var fulltime:int = math.floor(my_sound.length/1000);
//my_sound.length:int = math.ceil(my_sound.length /(my_sound.bytesloaded / my_sound.bytestotal));
var newpos:number = fulltime/685.5 * math.floor(seekbar_mc.sliderseek_mc.x * 1000);
pauseposition = newpos/2;
my_channel.stop();
gotoandplay(2);
my_channel = my_sound.play(newpos); <------ line 378
song_paused = false;
isdragging = false;
}
}else
{
isdragging = false;
seekbar_mc.sliderseek_mc.stopdrag();
pauseposition = fulltime / 100 * math.floor(seekbar_mc.sliderseek.mc.x * 1000);
//seekbar_mc.sliderseek_mc.visible = false;
}
}
how can fix if streaming audio .xml external file created dreamweaver.
problem #2:
ok , onto second problem.
whenever try run mediaplayer following code working , scrubber bar moving automatically song in enter_frame function. doesn't , when go play song trackknob stuck in spot along scrubber bar glitched or something???
here media player , can see when start song playsong() function trackknob doesn't start @ start of scrubber bar.
here enterframe function:
// add listener trigger [onenterframe] function below
addeventlistener(event.enter_frame, onenterframe);
function onenterframe(event:event):void
{
// full time
var tallytime = (my_sound.length/1000);
var totalmins:number = math.floor(tallytime /60);
var totalsecs = math.floor (tallytime) % 60;
if (totalsecs < 10)
{
totalsecs = "0" + totalsecs;
}
timertext_txt.text = ( " " + totalmins+ ":" + totalsecs);
// end playing time
// playing time
var totalseconds:number = my_channel.position/1000;
var minutes:number = math.floor(totalseconds /60);
var seconds = math.floor (totalseconds) % 60;
if (seconds < 10)
{
seconds = "0" + seconds;
}
completetext_txt.text = ( " " + minutes+ ":" + seconds);
// end full time
/// progress bar code...
var estimatedlength:int = math.ceil(my_sound.length / (my_sound.bytesloaded / my_sound.bytestotal));
var playbackpercent:uint = 100 * (my_channel.position / estimatedlength );
// want position bar 200 pixels wide on completion multiply percentage x 2
seekbar_mc.sliderseek_mc.x = playbackpercent * 2;
seekbar_mc.sliderseek_mc.x = seekbar_mc.sliderseek_mc.x;
// make loaded progress bar lives under playhead progress bar grow dynamically
var loadedpercent:uint = 100 * (my_sound.bytesloaded / my_sound.bytestotal);
seekbar_mc.sliderseek_mc.x = loadedpercent * 2;
}
how can go fixing appreciated thank-you.
to start, doesn't appear my_sound has actual associated sound. ie, you're not using sound class library , you're not loading sound using my_sound.
More discussions in ActionScript 3
adobe

Comments
Post a Comment