Skip to main content
Inspiring
Mar 20, 2025 5:16 PM UTC
Question

AS3 Array concat or push problem

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

}

 

    2 replies

    JoãoCésar17023019
    Community Expert
    Community Expert
    Mar 27, 2025 12:18 PM UTC

    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
    Inspiring
    Mar 29, 2025 2:33 AM UTC

    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