Is it possible to duplicate objects through actionscript?

New Here ,
Apr 20, 2022 Apr 20, 2022

Copy link to clipboard

Copied

I'm making a bullet hell but i've encountered a slight problem, I can't use just one sprite for everything and manually animating each attack would be way too time-consuming, Is it possible for symbols to be duplicated through actionscript?

 

The example here is what i know how to do, being the use of a single object on loop in a set path.

 Exampe-2.gif                     

 

But what i need is for a single stationary object to be able to create duplicates of itself when a function is called, then have those clones do a desired action or go on a set path. As shown below.

 Example-1.gif

TOPICS
ActionScript , Code , How to

Views

60

Likes

Translate

Translate

Report

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

Adobe Community Professional , Apr 20, 2022 Apr 20, 2022
make your bullet a movieclip assign a linkage id (ie, class name), eg Bullet_mc.  if you don't need it to have any properties/methods, let animate create the class for you, but youi might want to remove the bullets (from the display list and ready them for gc) when they're not visible. either way, you can use: var bullet1:Bullet_mc = new Bullet_mc();  // to create a bullet instance addChild(bullet1); to add it to stage

Likes

Translate

Translate
Adobe Community Professional ,
Apr 20, 2022 Apr 20, 2022

Copy link to clipboard

Copied

LATEST

make your bullet a movieclip

assign a linkage id (ie, class name), eg Bullet_mc.  if you don't need it to have any properties/methods, let animate create the class for you, but youi might want to remove the bullets (from the display list and ready them for gc) when they're not visible.

 

either way, you can use:

 

var bullet1:Bullet_mc = new Bullet_mc();  // to create a bullet instance

addChild(bullet1); to add it to stage

Likes

Translate

Translate

Report

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