;

PDA

Click to See Complete Forum and Search --> : onFD in Mediaplayer


blanius
05-02-2007, 10:58 AM
Wilburt this one is for you.

I'm trying to make use of the FD data and to test the function I tried this in the load.as file

onFD(fd){
_root.txt1.text=fd.length;
}

but I get undefinded, the fd is displayed in the normal fd display.

blanius
05-02-2007, 11:13 AM
While we're at it how about the onID3 function?

The event fires but I cannot figure out how to access the id3 tag. I want to expand the a mediaplayer skin with some custom buttons and display extended id3 tags in a window and also make some movements based on fd data.

blanius
05-02-2007, 11:15 AM
if I do this in timeline

mediaplayer1.onID3(){
_root.txt1.text=this
}

I get _level0 which is NOT what I expect Shouldn't that be the mediaplayer and if so how do I reference the id3 tag, shouldn't it be mediaplayer1.?song?.id3 where ?song? is the internal name of the sound object?

w.brants
05-02-2007, 11:30 AM
Try thismediaplayer1.onID3 = function(){
_root.txt1.text = this.id3.artist;
}

mediaplayer1.onFD = function(a){
_root.txt2.text = a.length;
}

blanius
05-02-2007, 12:20 PM
duh thanks

blanius
05-02-2007, 03:34 PM
I remember that I was not able to use the in command to loop through the properties of an object, we discussed this some time ago in relation to id3 tags. There must be a work around for this...

blanius
05-02-2007, 03:40 PM
Here's a test using onFD, the speaker and the display are driven by onFd, also extended ID3 information using onID3

http://www.bretlanius.com/flash/lab/playertest2.html

w.brants
05-02-2007, 03:57 PM
Nice work Bret :)

I don't know if you already figured out how to loop through all id3 properties.
Here's an example in case you didn't.mediaplayer1.onID3 = function(){
var o = this.id3;
var p;
for (p in o) {
_root.txt1.text += 'property:' + p + ' value:'+o[p]+'\n';
}
}

tmoore935
05-02-2007, 04:59 PM
Here's a test using onFD, the speaker and the display are driven by onFd, also extended ID3 information using onID3

http://www.bretlanius.com/flash/lab/playertest2.html

Can you explain this a little more in general? I remember you was trying to do this a few months ago.

blanius
05-02-2007, 06:22 PM
Thanks Wilburt, that is what I was talking about. I couldn't get it to work but will try again with your code.

Tmoore Mediaplayer object has there functions already. onFd and onID3 I'm just playing around with using them.


mediaplayer1.setExternalPlaylist("playlist.txt")
mediaplayer1.onPlay=function(){
_root.txt2.text="";
mc3.mc1._xscale=mc3.mc1._yscale=0
mc3.mc2._xscale=mc3.mc2._yscale=0
mc3.mc3._xscale=mc3.mc3._yscale=0
mc3.mc4._xscale=mc3.mc4._yscale=0
mc3.mc5._xscale=mc3.mc5._yscale=0
mc3.mc6._xscale=mc3.mc6._yscale=0
mc3.mc7._xscale=mc3.mc7._yscale=0
mc3.mc8._xscale=mc3.mc8._yscale=0
mc3.mc9._xscale=mc3.mc9._yscale=0
}
mediaplayer1.onFD = function(a){
_root.txt1.text = a[5];
speaker.grill._xscale=95+a[5]
speaker.grill._yscale=95+a[5]
mc3.mc1._xscale=mc3.mc1._yscale=25*a[1]
mc3.mc2._xscale=mc3.mc2._yscale=25*a[2]
mc3.mc3._xscale=mc3.mc3._yscale=25*a[3]
mc3.mc4._xscale=mc3.mc4._yscale=25*a[4]
mc3.mc5._xscale=mc3.mc5._yscale=25*a[5]
mc3.mc6._xscale=mc3.mc6._yscale=25*a[6]
mc3.mc7._xscale=mc3.mc7._yscale=25*a[7]
mc3.mc8._xscale=mc3.mc8._yscale=25*a[8]
mc3.mc9._xscale=mc3.mc9._yscale=25*a[9]
}


mediaplayer1.onID3 = function(){

var o = this.id3;
var p;
for (p in o) {
_root.txt2.text +=p + ':'+o[p]+'\n';
}


}


The Display is just a MC with 9 clips in it with a single shape on each.
The speaker is a two layer clip and I scale the background one a little based on the value of a FD

tmoore935
05-02-2007, 06:58 PM
This is how swf-tools worked. I remember this. If the volume was tied into the FD's, then they could respond to the music output. But thats getting too "tweeeked" :)

blanius
05-02-2007, 11:00 PM
If a song has id3 v1 and v2 tags you get both. Any ideas on not seeing the duplicated tags?

w.brants
05-03-2007, 01:01 AM
If a song has id3 v1 and v2 tags you get both. Any ideas on not seeing the duplicated tags?
Besides filtering when you loop through all properties I see no option.
The id3 object is the same as from the sound class and it doesn't have a function to only get the v1 or v2 tags.