Pages: [1]
  Print  
Author Topic: File plugin Dir Command  (Read 3917 times)
0 Members and 1 Guest are viewing this topic.
ej52
Newbie
*
Posts: 3


« on: 16 September , 2009, 10:10:35 »

Hi all

i have been trying out the File plugin with the Dir command in order to get a list of songs on my phone
when i use klFile1,klFile2... it shows the name no problem but if i create a Array from the klFileCount

eg.
Code:
for (var i:Number = 0; i < klFileCount; i++) {
      song[i].text = klFile[i];
}
it does'nt return the song name.

can someone plz help me with this.

« Last Edit: 16 September , 2009, 10:32:19 by ej52 » Logged
jappit
Global Moderator
Jr. Member
*****
Posts: 88



WWW
« Reply #1 on: 17 September , 2009, 08:57:28 »

Hi ej52,

if you store the KuneriLite return values in an object, you can do something like:
Code:
var fileNum:Number = parseInt(res.klFileCount);

for(var i = 0; i < fileNum; i++)
{
song[i].text = res['klFile' + (i + 1)];
}
where 'res' is the object holding KuneriLite response. In your specific case, it should be enough to change 'res' with 'this'.

Hope it helps,
Pit
Logged
ej52
Newbie
*
Posts: 3


« Reply #2 on: 17 September , 2009, 09:39:27 »

Thx for reply jappit

after posting here i found a solution

Code:
for(i = 1; i <= klFileCount; i++) {
kl = eval('klFile'+i);
pl.attachMovie('songBtn', 'songBtn'+i, i);
pl['songBtn'+i]._x = 0;
pl['songBtn'+i]._y = i*20;
pl['songBtn'+i].songNam.text = kl;
pl['songBtn'+i].onRollOver = function() {
this.songNam.textColor = 0x3597D8;
}
pl['songBtn'+i].onRollOut = function() {
this.songNam.textColor = 0xFFFFFF;
}
pl['songBtn'+i].onRelease = function() {
this.songNam.textColor = 0xFFFFFF;
s.loadSound('E:/Download/Media/'+this.songNam.text, true);
s.start();
}
}

the only problem now is i get "not enough memory to open file" message and it doesnt play the song

any ideas???
Logged
jappit
Global Moderator
Jr. Member
*****
Posts: 88



WWW
« Reply #3 on: 21 September , 2009, 02:22:30 »

Hi ej52,

FlashLite uses its own (limited) memory when playing audio files, so it's highly probable that you'll get such errors when trying to reproduce large MP3 or other audio files.

Pit
Logged
ej52
Newbie
*
Posts: 3


« Reply #4 on: 22 September , 2009, 08:33:23 »

Hey Pit

thx again 4 reply

i forgot to mention that it only throws the error when i run it from the app packaged with
kunerlite, but if i run the swf from flash lite player it works perfect.

secondly if i cant get this working is there a param to open the song in system plugin?

eg.
loadVariables("http://127.0.0.1:1001/Basic/system?klCommand=open&klApp=Player&klArgs=Play&file=NameOfSong", "" );

thx
Ej52


Logged
jappit
Global Moderator
Jr. Member
*****
Posts: 88



WWW
« Reply #5 on: 23 September , 2009, 07:00:50 »

Hi Ej52,

there used to be a memory setting and a stub option on previous KuneriLite versions, but I can find them no more in latest version..

I'll let you know if I find something more about this Wink

Pit
Logged
Pages: [1]
  Print  
 
Jump to: