Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3690634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:03:26+00:00 2026-05-19T04:03:26+00:00

im developing a very simple particle system in AS3, i have the particle (a

  • 0

im developing a very simple particle system in AS3, i have the particle (a movieclip) and the particle behavior, but now i need a good way to duplicate it n number of times and changing the only value that determine the system behavior, the width, from 10 to 100 px.

This is the code:

//some declarations
var blur:BlurFilter = new BlurFilter();
var filterArray:Array = new Array(blur);
import fl.transitions.Tween;
import fl.transitions.easing.*;

//the only input value, from 10 to 100
par.width=100;
//the equations that define the behavior.
par.alpha=.0088*par.width+.98;
par.height=par.width;
blur.blurX = .75*par.width-.55;
blur.blurY = blur.blurX;
blur.quality = 1;
par.filters = filterArray;
//the movement of the particle
var myTween:Tween = new Tween(par, "y", Strong.easeOut, par.y, stage.stageHeight+2*par.height, -.2*par.width+22, true); 

So, as you can see, par is the instance name for the particle, well, i need to duplicate it changing the .width value and eventually the .x value too. Any ideas? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:03:27+00:00Added an answer on May 19, 2026 at 4:03 am

    This is what OOP (Object Oriented Programming) is all about, and Flash is a great example.

    package  {
    
        import flash.filters.BlurFilter;
        import fl.transitions.Tween;
        import fl.transitions.easing.*;
        import flash.display.MovieClip;
        import flash.events.Event;
    
        public class Particle extends MovieClip {
    
            public function Particle() {
                // constructor code
                //some declarations
                this.graphics.beginFill(0, 1);
                this.graphics.drawCircle(0, 0, 50);
                var blur:BlurFilter = new BlurFilter();
                var filterArray:Array = new Array(blur);
                //the only input value, from 10 to 100
                this.width = Math.round(Math.random() * 90) + 10;
                //the equations that define the behavior.
                this.alpha = .0088 * this.width + .98;
                this.height = this.width;
                blur.blurX = .75 * this.width - .55;
                blur.blurY = blur.blurX;
                blur.quality = 1;
                this.filters = filterArray;
                this.addEventListener(Event.ADDED_TO_STAGE, __tweenMe);
            } 
    
    
            private function __tweenMe($evt:Event):void {
                //the movement of the particle
                var myTween:Tween = new Tween(this, "y", Strong.easeOut, this.y, stage.stageHeight+2*this.height, -.2*this.width+22, true); 
            }
    
        }
    
    }
    

    and then in your DocumentClass you could do something like this:

    package  {
    
        import flash.display.MovieClip;
    
        public class BaseClass extends MovieClip {
    
            public function BaseClass() {
            var par:Particle;
                for ( var i:int = 0; i < 100; i++) {
                    par = new Particle();
                    addChild(par);
                }       
            }   
        }    
    }
    

    EDIT

    Here you go http://d.pr/ycUh. Let me know if you have questions about what is going on. I added some random x and y values for the starting positions of your particles.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing a very simple script in AutoHotKey, but it involves using
I have lately been developing a very simple app for iOS with PhoneGap. All
I'm developing a control which inherits from a System.Windows.Form.Panel. The idea is very simple:
I'm developing a project for windows phone 7. It's very simple I guess but
When I'm developing websites, I use a very (very) simple system of creating pages:
I am developing a very simple CMS system for my brother's web site. I
I'm developing a very simple gadget for Windows 7. I have created an index.html
I'm developing a very simple web site, with only one web page, but i
I'm developing a very simple but (hopefully) solid framework that just fits my needs.
In a program I am developing (Linux), I need very simple text-based IPC. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.