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 7048981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:57:26+00:00 2026-05-28T02:57:26+00:00

I have a Class as follow: class com.flightstatus.SpecificationFlight { public var Airline:Airline; public var

  • 0

I have a Class as follow:

class com.flightstatus.SpecificationFlight 
{
    public var Airline:Airline;

    public var FlightNumber:String;

    public var SearchCodeshares:Boolean;

    public var SearchCodesharesSpecified:Boolean;

    public var TailNumber:String;
}

Now I want to create a array of above type like below:
var myArr:SpecificationFlight = new Array();

This type is very crucial as it will be sent over webservice.

Is this possible in AS3 ?If so , can I import only this feature to AS2 and use it.

  • 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-28T02:57:27+00:00Added an answer on May 28, 2026 at 2:57 am

    Your code is AS2, not AS3, in AS3 you cannot declare a class using periods in the name, instead packages are used. (Technically, this is not precise, you could’ve have periods in the name if you altered the bytecode after it was compiled, but I doubt you meant that).

    AS2 has no typed arrays, i.e. it has only one Array class and it can contain objects of any type. However, you can define a __resolve(x) method for your custom class and let only objects of certain type be returned from yourClassInstance[x] code. Unfortunately, you cannot control the type of an object being assigned to yourClassInstance[x].

    In AS3 there is a Vector.<T> class since Flash player 10. This class is used to create vectors of certain type, obviously.

    In the Haxe language, which can compile to AS2 and AS3 there are typed arrays, but they are enforced on the language (compiler) level, if you then access the compiled code through reflection or through some other code not compiled with Haxe, then arrays are still untyped (pretty much like generics work in Java).

    PS. It is extremely counterintuitive to use Pascal case for variables’ names in either variant of AS, class fields are usually camel-cased (even the code highlighter assumed those are class names, not variable names). Using public variable us usually a bad idea too, but it is not necessarily bad, depends on the context, yet I’d certainly be alarmed.

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

Sidebar

Related Questions

I have a simple class inheriting from WebControl as follow: public class Instrument :
Suppose I have a class hierarchy as follow: class Vehicle; class Car extends Vehicle;
I have a class which, by design, must follow the singleton pattern. So I
I have a class A as follows: class A { public: A() { printf(A
I have a class SimpleCircle. Its declaration is as follows: class SimpleCircle { public:
I have a Point2D class as follows: class Point2D{ int x; int y; public:
I have tried to follow the instructions here http://docs.oracle.com/cd/B31017_01/web.1013/b28221/cmp30cfg001.htm Along with using generic model.
I've been trying to follow the tutorial here: http://www.edu4java.com/en/androidgame/androidgame2.html But have hit a snag.
Assume that I have the follow class. class Foo # I want the following
I just follow this http://www.dotnetcurry.com/ShowArticle.aspx?ID=585 to do the project but have error ambiguity and

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.