1 Replies - 142 Views - Last Post: 06 January 2018 - 01:51 AM Rate Topic: -----

#1 Kreinen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-January 18

AS3 array to AS2 array

Posted 05 January 2018 - 06:13 AM

I'm trying to use a for loop to add all instances of the MC clam_aee to the Array ground_clam_array, in order to preform a hitTest on any instances of clam_aee.

var ground_clam_array: Array = new Array();
for(var i = 0; 1 < numChildren; i ++){
if(getChildAt(i)is clam_aee){
ground_clam_array.push(getChildAt(i));
}
}


Unfortunately, i just had to switch my document from AS3 to AS2 in order to allow nested script, and now my checker has an issue with this code. It insists that there's a missing ")" in line 3, and and unexpected "}" in line 5. I assume this is because AS2 can't use this push child method. In any case, how can I achieve adding any instances of clam_aee to ground_clam_array in order to hitTest ground_clam_array MCs in AS2?

Is This A Good Question/Topic? 0
  • +

Replies To: AS3 array to AS2 array

#2 snoopy11  Icon User is offline

  • Engineering ● Software
  • member icon

Reputation: 1437
  • View blog
  • Posts: 4,626
  • Joined: 20-March 10

Re: AS3 array to AS2 array

Posted 06 January 2018 - 01:51 AM

I doubt its because of the push method.

More likely you need to clean your project then rebuild.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1