How to display elapsed/current time of a song in Actionscript.


hi have question on how can make code display total time song media player created actionscript 3.0, using xml load song track.

 

this current function have done , unsure on problem is not allowing elapsed time display in textfield on stage.

 

stage.addeventlistener(event.enter_frame, timeelapsed);

function timeelapsed(e:event):void

{

                    var minutescurr:number = math.floor((my_channel.position /1000) /60);

                    var secondscurr = math.floor((my_channel.position /1000) % 60);

        if (secondscurr < 10)

                    {

            secondscurr = "0" + secondscurr;

        }

        var minutestot:number = math.floor((my_sound.length /1000) /60);

        var secondstot = math.floor((my_sound.length /1000) % 60);

        if (secondstot < 10)

                    {

            secondstot = "0" + secondstot;

        }

        completetext_txt.text = minutescurr + ":" + secondscurr + "/" + minutestot + ":" + secondstot;

}

 

i tried adding stage , getting null object reference.

 

thanks casey

the 1009 error indicates 1 of objects being targeted code out of scope.  mean object....

 

- declared not instantiated

- doesn't have instance name (or instance name mispelled)

- not exist in frame code trying talk it

- animated place not assigned instance names in every keyframe it

- 1 of 2 or more consecutive keyframes of same objects no name assigned in preceding frame(s).

 

if go publish settings flash section , select option permit debugging, error message should have line number following frame number isolate object involved.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account