Copy link to clipboard
Copied
AS3 Array concat or push problem
When trying to connect 3 arrays with music lists to different hosts,
it seems to be merged into 1 array normally.
It plays normally in swf file,
but in exe file, the music in the 3rd array does not play.
I tried several ways, but I can't find a solution.
Can someone help me?
ar sm1:Array = [2500 musics.....]; --> domain1 (nomal)
var sm2:Array = [ 500 musics.....]; --> domain2 (nomal)
var sm3:Array = [ 5 musics.....]; --> domain2 (no play)
var sm:Array = [];
// (1) ------------------------------------------
sm = sm1.concat(sm2,sm3);
// (2) ------------------------------------------
sm = merge(sm1,sm2,sm3);
function merge(...arrays):Array {
var result:Array = [];
for(var i:int=0;i<arrays.length;i++){
result = result.concat(arrays[i]);
}
return result;
}
// (3) --------------------------------------------
merge2(sm1);
merge2(sm2);
merge2(sm3);
function merge2(ar):void {
for(var i:int=0;i<ar.length;i++){
sm.push(ar[i]);
}
}
// ---------------------------------------------------
var dm1;String = "http;//...";
var dm2;String = "http;//...";
function musicPlay(url: String): void {
var dm = (n > sm1.length-1) ? domain1 : domain2;
url = dm + url + ".mp3";
sound = new Sound(new URLRequest(url));
channel = sound.play(0);
}
Copy link to clipboard
Copied
Hi.
Are you getting all the correct strings in the end?
Maybe it's not an array issue, but rather a permission issue depending on the type of .exe you're generating.
Please let us know.
Regards,
JC
Copy link to clipboard
Copied
It seems that the problem is not the array problem, but the problem with the Korean language support on the hosting server.
I will try a new solution.
Thank you for your good answer.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now