Union type in ActionScript? -


Do you know that action script support is the union type? For example, something like this:

  function fu (x: class union union) {// x class A or class b / something}}   

Thanks in advance

ActionScript does not support 3C ++ compile class hierarchy

Uses the AS3 rather than the Interface approach used in many object-oriented languages.

Generally, an interface is an abstract template of functionality, which allows communication between objects, which is unrelated to class hierarchy.

Like:

  public interface IBox {function addContentToBox (contentName: string, content: *) boolean; Function Box Resource (contentName: string): Boolean; Function getContentFromBox (contentName: string): *; }   

When you define a square in the AS3, if you want to implement the IBox interface, then

  class YourClass is of another class Expands IBox {  

(if you are expanding another class then another class is required)

Now you IBox your class

So what's the catch? Well, first of all

  A = new your class (parameters etc); If (one is your class) trace ('YIPPE'); If (an IBox) trace ('YAY');   

You have now detected YIPPE YAY

(xxx IBOX) will be correct for all instances of all sections implementing IBox.

You can pass any unrelated objects with the sections that apply to IBox for the purposes of IBox.

Please see for more information.

I hope it will be helpful.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -