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

  • Home
  • SEARCH
  • 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 6792821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:01:09+00:00 2026-05-26T18:01:09+00:00

Newbie question here: I’m working with Flash Builder 4.5 on an Actionscript project. I’ve

  • 0

Newbie question here: I’m working with Flash Builder 4.5 on an Actionscript project. I’ve created the following classes:

package 
{
    public class ComplexNumber
    {
        public var real:Number;  // real component
        public var imag:Number;  // imaginary component
    }
} 

and,

package 
{
    public class ComplexArray
    {
        public var real:Array;  // real component array
        public var imag:Array;  // imaginary component array
    }
}

and a static function:

package 
{
    public class ComplexDivide
    {
        public static function v1p0(a:Number, b:Number, // numerator: a+bi
                                    c:Number, d:Number  // denominator: c+di
                                    ):ComplexNumber
        {
            var z:ComplexNumber = new ComplexNumber();  
            var divisor:Number = c*c + d*d;

            z.real = (a*c + b*d) / divisor; // real component
            z.imag = (b*c - a*d) / divisor; // imaginary component          

            return z;
        }
    }
}

and in another .as file I’m trying to call this function

var BXFN_complex:ComplexArray = new ComplexArray();
for (var ii:int = 0; ii <= 2; ii++) {
    BXFN_complex[ii] = ComplexDivide.v1p0( 1, 0, 2, 3 );
}

but the code inside this loop generates the following run time error: “ReferenceError: Error #1056: Cannot create property 0 on ComplexArray.” Thus, my code for “BXFN_complex[ii] = ~” is incorrect. Anyone know how to achieve what I’m trying to do? Basically, ComplexDivide.v1p0 returns two numbers, and BXFN_complex is an object containing two number arrays, and I want to assign the ComplexDivide two numbers into the ii’th element of arrays in BXFN_complex.

  • 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-26T18:01:09+00:00Added an answer on May 26, 2026 at 6:01 pm

    I am not sure I understand what you are trying to accomplish, and frankly I find your code hard to read, but the cause of the error is simple:

    Your ComplexArray instance does not behave like an Array – it is an Object with two member Arrays, real and imag, and you need to specify which one you are acually addressing:

    BXFN_complex.real[ii] 
    

    or

    BXFN_complex.imag[ii] 
    

    instead of just

    BXFN_complex[ii] 
    

    If you want to pass in just a ComplexNumber type, you can use a function to do it:

    (on ComplexArray):
    
    public function setItemAt (index:int, n:ComplexNumber) : void {
        real[index] = n.real;
        imag[index] = n.imag;
    }
    

    Don’t forget to initialize the real and imag arrays before adding items!

    Last but not least I don’t understand why you don’t use a primitive array which holds ComplexNumbers, instead of a ComplexArray which holds two arrays of primitive Number values – then you could just use BXFN_complex[ii]like you did before.

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

Sidebar

Related Questions

Newbie question here ... I've created a Master-Detail Application project in Xcode 4.2 using
Here goes a newbie question: Create a new project in Xcode: File > New
a newbie question here... I've created an entity data model (.edmx) file in one
Another newbie question here, I have the following Select: SELECT DATEADD(dd, 0, DATEDIFF(dd, 0,
Newbie question here. I'm in the beginning stages of laying out a site in
Pardon the dumb newbie question here; web programming isn't my forte... (blush) I have
Here is one more newbie question: require 'tasks/rails' I saw this line in Rakefile
This is sort of SQL newbie question, I think, but here goes. I have
Newbie question: I just installed VisualSVN Server and created a repository. I noticed that
Newbie question. I have Django models that look like this: class Video(models.Model): uploaded_by =

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.