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

Adding objects from an array at particular points

Community Beginner ,
Oct 01, 2017 Oct 01, 2017

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.

TOPICS
ActionScript
549
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

correct answers 1 Correct answer

Community Expert , Oct 01, 2017 Oct 01, 2017

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?

Translate
Community Expert ,
Oct 01, 2017 Oct 01, 2017

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?

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 Beginner ,
Oct 03, 2017 Oct 03, 2017

I guess that works, just not sure how to do it. Is that the push function?

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 ,
Oct 03, 2017 Oct 03, 2017

that would be one way to add elements to an array.

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 Beginner ,
Oct 03, 2017 Oct 03, 2017

Yeah that seemed to work just fine. Didn't know I could do that thanks.

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 ,
Oct 04, 2017 Oct 04, 2017
LATEST

you're welcome.

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