I would like to list out few technical questions and answers which technical guys like me can phase at any stage in life. May be during an interview or questions you may check with people whom you are recruiting.

If you find any questions which you think should be listed here please comment it, if they are worth I will make sure they get added to the list below:

  1. Is it possible to make httpService Requests synchronous?
    Ans: No.
  2. I need to load an image from flickr into my application. Do I need a crossdomain.xml file on flickr?
    Ans: No. Flickr has already given a public access to its picture collection.You can find that file here http://api.flickr.com/crossdomain.xml. The only think we have to do is register an account with flickr and get API key. For more details visit http://www.flickr.com/services/apps/create/
  3. How do you generate random numbers within a given limit with actionscript?
    Ans:

    function randomNumbers(min:Number,max:Number)
    {
    var results:Number=Math.floor(Math.random()*max)+min;
    return results;
    }
  4. Have you built any components with actionscript? If so explain how you did it? Ans: When you define a simple component in ActionScript, you do not create a component, but you modify the behavior of an existing component. In the following example you create a subclass of the ComboBox class to create a custom ComboBox called CountryComboBox that is prepopulated with a list of countries. AS3 CODE:
    package components
    {
    import mx.controls.ComboBox;
     
    public class CountryComboBox extends ComboBox
    {
     
    public function CountryComboBox()
    {
    dataProvider = [ "India", "Sri Lanka" ];
    }
     
    }
    }

    MXML Usage of the above class:

  5. How do you call javascript from Flex?
    Ans
    : Very simple import this

    import flash.external.*;

    This is the code below to call a javascript method from flex

    if (ExternalInterface.available)
    {
    ExternalInterface.call("javascriptMethod", "this is one parms");
    }

    Javascript method is as below

     function javascriptMethod(vMessage)
    {
    alert(vMessage);
    }
  6. What is the difference between sealed class and dynamic classes? Ans:An instance of a sealed can have only properties and method which are already declared in that classes, but it is possible to add properties and methods programmatically at runtime for dynamic classes.
  7. What is state? what is the difference between states and ViewStack? Ans:ViewStack is to switch between different container for a single view but States change is to change view of single container itself. In ViewStack different views are switched by setting visibility true to only one container at a time, thus content containers are untouched.
  8. What keyword allows you to refer to private variables of a class? Ans: Private variables cannot be referred outside the class. “this” keyword can be used to refer private variable within a class.
  9. How polymorphism works on actionscript? Ans: Polymorphism describes multiple possible states for a single property. Another way of expressing this in OOPs is, different classes implementing the same method names. Polymorphism is achieved in actionscript with keyword Override.
  10. How do you overload functions in action script? Ans:Overloading is not supported in actionscripts current version(as3). Workaround for this is to declared method with wildcard data-type and handling it logically inside as show below.
    function functionName(parm:*):void
    {
    If(parm is String)
    {
    //do string operation..
    } else if(parm is Number)
    {
    //do number operation..
    } else if ….
    {
    //do required specific operations…
    }else
    {
    throw new customError(“datatype not supported”)
    }
    }
  11. What is dynamic keyword used for?
    Ans:In actionscript by making a class dynamic, it is possible to add properties and methods programmatically at runtime. A class can be declared dynamic by adding keyword “dynamic” to the class definition.

    dynamic class ClassName {
    //class definition…
    }
  12. What are sealed classes ?
    Ans:Actionscript classes that are not declared as dynamic are called sealed classes. So normally all classes are sealed by default.
    Technically speaking, an instance of a sealed can have only properties and method which are already declared in that classes.
  13. What keyword allows you to implement abstraction better?
    Ans:There is no keyword in as3 to implement abstraction directly, but there are workaround available for this. One of the best followed way is runtime enforcement of abstract classes.
  14. What’s the difference between Java and AS3 getters and setters?
    Ans:In Java there is no keyword for declaring setters and getters. A prefix set & get is added with property name for declaring setters and getters according to java standards.
    In actionscript “get” and “set” keywords are used for declaring getters and setters respectively.