Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

AS3 Array concat or push problem

Explorer ,
Mar 20, 2025 Mar 20, 2025

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);

}

 

156
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 27, 2025 Mar 27, 2025

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 28, 2025 Mar 28, 2025
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines