Copy link to clipboard
Copied
So I'll do my best to explain my inquiry.
Essentially I've copied the code that someone used to create a laser.
As part of this code, they created 4 solid objects that all went into an array.
I want to keep all of these objects in an array since they used that fact to make a really great collision detection system for all four of the objects.
The problem is, in the original fla these objects were already placed onto the stage.
I want to be able to create them after certain events and I want them all to be in particular places.
I was looking for the best way to do this.
I was thinking it had something to do with the index numbers of the array objects but I'm very very new to action script 3.
I can share the code if anyone takes enough interest to help me out. Just seemed like posting a bunch of code wasn't going to help in this situation.
It would actually be neat to have these objects appear somewhat randomly each time but with the confines of certain areas, so they don't get in the way of other things in the game.
Thanks ahead of time for any help. I've had a great experience on these forums so far.
what's the problem with creating the objects with actionscript, doing what you want and then adding then adding them to the array or creating them using the same references as the array references you copied?
Copy link to clipboard
Copied
what's the problem with creating the objects with actionscript, doing what you want and then adding then adding them to the array or creating them using the same references as the array references you copied?
Copy link to clipboard
Copied
I guess that works, just not sure how to do it. Is that the push function?
Copy link to clipboard
Copied
that would be one way to add elements to an array.
Copy link to clipboard
Copied
Yeah that seemed to work just fine. Didn't know I could do that thanks.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now