How to call functions of document class?

I m biggner in as3

I jst do document class (employee.as) and I do a few functions

public void account() {}
trace ("this is an accountant");
}
public void designer()
{
trace ("this is a Designer")
}
public void programmer()
{
trace ("this is a programmer")
}

in another class (empData.as) I would like to call these functions

I try this way to m...

public void empData() {}
var anuj:employee = new employee();
var vijay:employee = new employee();
var amit:employee = new employee()

;
Anuj.Account ();
Vijay.Designer ();
Amit.programmer ();
}

but nothing tracing...

You can see(6KB) the source file location

http://sites.Google.com/site/amit0shakya/home/callclassfunctions

Thanks for help

[email protected]

Yes Amit you are right you can class number n

classes for example var classA: class1 = new class1()

classB:class2 = new class2()

and so on...

Tags: Adobe Animate

Similar Questions

  • How to call functions of class Document class side

    Main is my doccument class. How can I call the Main.showAlert class of the caller function.


    package
    {
    import flash.display.Sprite;
    import flash.events.Event;

    SerializableAttribute public class Main extends Sprite
    {

    public void Main (): void
    {
    If init() (stage);
    of another addEventListener (Event.ADDED_TO_STAGE, init);
    }

    private void init(e:Event_=_null):void
    {
    removeEventListener (Event.ADDED_TO_STAGE, init);
    entry point
    }

    public void showAlert() {}

    trace ("called")
    }

    }

    }

    ////

    package
    {

    public class calling
    {

    public void Caller()
    {
    Main.showAlert)
    }

    }

    }


    ////

    change your instantiation of the appellant if you switch a display object.

    package
    {
    import flash.display.Sprite;
    import flash.events.Event;

    SerializableAttribute public class Main extends Sprite
    {

    public void Main (): void
    {
    If init() (stage);
    of another addEventListener (Event.ADDED_TO_STAGE, init);
    }

    private void init(e:Event_=_null):void
    {
    removeEventListener (Event.ADDED_TO_STAGE, init);
    entry point
    }
     
    public void showAlert() {}
      
    trace ("called")
    }

    }

    }

    ////

    package
    {

    import flash.display.MovieClip;

    public class calling
    {

    var mainTL:MovieClip;
    public void Caller(mc:MovieClip)
    {

    mainTL = MovieClip (mc.root);

    mainTL.showAlert)
    }
     
    }

    }

    ////

    p.s. Please check the useful/correct.

  • Calling functions from another class

    How one accesses a function from another class?

    Let's say I have a file called .as hand. My flash file uses this as this is the main class to make it work when you test the program. Let's say I have another class named Test that looks like this:

    package

    {

    public class Test

    {

    public void Test()

    {

    trace ("why don't you work?');

    }

    }

    }

    I want call the Test function when the game takes place (in the appellant to hand), how would he enter the main run file? I imported to it, made sure that the functions were public/static, created as a variable and it still doesn't work.

    Any help would be good

    the constructor for a class is different from a 'normal' function

    If you can't do something like

    meow: Test of var = new Meow();

    To call it thus:

    test: Test of var = new Test();

    test. Meow();

  • AM how to call the methods of class Impl EO

    Hello world

    I try to display database data in a table, and I need to add a transitional and calculated attribute.

    So I created an EO, I added a transitional attribute, and now I need to create the method that calculates its value.

    I created this method of AOS.

    Back to EO Impl class, I want to call this method in the Get accessor of my transitional attribute.

    To call this AM method in the EO Impl category, I have to get the AM, and I don't know how to do it. Because I'm used to getting the pageContext controller AM.

    I googled and found that I don't need to create the method in the AM, I found that I just have to code directly in the Get accessor.

    But again, to calculate my transitional attribute, I have need for some queries and for that I need OADBTransaction, which means once again, I need to get the AM in the Impl EO class.

    I'm confused, I don't know how to do, if anyone can help please

    Thank you

    Kind regards

    Afaf

    If you derive the value based on the query, it would be better to do it in a single query.

    If you can stick the main request and the subquery (s) here, I take a look.

    If this is not possible using the query, you can get the oaDBTransaction like below in the VO RowImpl.

    Import oracle.apps.fnd.framework.OAApplicationModule;

            OAApplicationModule appModule = (OAApplicationModule)this.getApplicationModule();
            appModule.getOADBTransaction()
    

    See you soon

    AJ

  • How to call function befor curret line change _ jdeveloper 11g

    Dear all

    I need call a few rows of curret befor functions has changed.

    How can I do?

    Kind regards.

    If you are talking about an af:table, you can use the property selectionListener to do something when the selection changes.

    John

  • How to call function of a process Page PL\SQL Javasrcipt

    Hello

    I have a javascript function say - function1 () defined in the Page header.
    I have a page PL\SQL process after the header.

    How can I call the javascript function - function1 () - of PL\SQL Page process.

    Thank you
    Deepak

    Hi Michael,

    I have a page PL\SQL process after the header.

    Since it's after the header (in the rendering phase) process, I think that this will call the JS? Please correct me if I'm wrong :-)

    See you soon,.
    Hari

  • How to call a function in another function?

    When I press a button, I want a series of functions to be performed one after the other (they contain interpolations, but its not relevant) , all of them waiting for the previous must be filled. I want to put the series of functions within a function, so I can simply call this function to run all others. Animations work well, but I don't know how to call functions of in another function. It would also be necessary each function to wait until the previous one is complete, to run. This is a clear example of what I need to do:

    boton.onPress = animate;

    Function animate () {}

    Animation1 (onComplete: animation2);

    animation2 (onComplete: animation3);

    animation3;

    }

    Function () {Tween 1} animation1;

    Function () {Tween 2} animation2.

    Function animation3 () {Tween 3};

    any suggestions?

    which isn't really make sense unless you're tweening or do something of asynchronous (such as loading a file).

    Function b (): Void {}

    C() ;

    D() ;  C() executed when this line runs

    }

  • How to call the function

    Hello

    How to call functions defined by the user in the select statement.
    I have to concat all the result of columns, though kindly help me.

    When I run after sql statement


    SELECT orgin_pos. «, » || the sender | «, » || consigneename | «, » || vesselname | «, » || travelno | «, » || POS | «, » || ETD | «, » ||
    ETA | «, » || NOP | «, » || grossweight | «, » || CCube | «, » || ccontainer | «, » || CSize. «, » || CType | «, » || Goh | «, » || HBL | «, » ||
    get_sea_report (hbl) linername | «, » || CompanyName AS overseasagent
    OF vietanam_report_view_bd



    -of cluase not found where expected error is coming.
    Kindly help me.

    concerning
    Prakash P
    Handle:  808542
    Status Level:  Newbie
    Registered:  Nov 8, 2010
    Total Posts:  69
    Total Questions:  48 (45 unresolved)  
    
  • Problem accessing the service within my Document class

    Hello

    I have a Document class that dynamically adds a MovieClip to my Florida the MovieClip in the library FLA and has "Export for ActionScript" installation for him and that's how I access the My Document class MovieClip.

    The problem is that when the MovieClip is finished (he has a scenario animation and a stop() method applied to the last frame of the animation), I want him to call a function that is placed in my Document class, but simply call the function (for example displayEnterButton()); an error of...

    1180: call to a method may be undefined displayEnterButton.

    Can anyone help here, I'm sure it's a simple problem to solve.

    Thank you very much!

    Kind regards
    M.

    Hello

    I managed a work around that.

    Basically, my Document class, after the code that adds the MovieClip to the display list, I then put in place since a timer that called a function every 100 milliseconds. This function would then check the current image of the loaded MovieClip. If the current framework of the MovieClip is equal to the last frame of the MovieClip I know animation had finished and calls the following function that I needed.

    I pasted the code below in case anyone was interested...

  • Calling functions / set variables in loaded SWF

    You know how you can create a Movieclip object, add a function or a variable, and then call this function or change this variable to the SWF file that includes? I want to be able to do it, only with SWFs that are loaded at run time.

    My "main" SWF is just something the type of menu. The user clicks a button in my HAND. SWF and the HAND. SWF and then load the SWF associated with this button, using the AS 3.0 method Loader () - URLRequest () - addChild () that everyone always asks questions on prescribed.

    It works very well. But now I have a few custom and other objects (ie., not only the channels) in my HAND. SWF I want power sharing with the loaded SWF files. preferably, I'd use a function of the type of accessor (ie., LoadedSWF.GiveMeTheCoolObject (MyCoolObject)); Although at this point, I'm willing to hack the object itself (ie., LoadedSWF.CoolObject.CoolField = MyCoolObject.CoolField ;) if that's what it takes.

    I tried to call the functions and setting the fields, but the AS 3.0 compiler doesn't care for this kind of nonsense on its objects defined by the generically. Also note that, at runtime, a call to LoadedSWF.hasOwnObject ("GiveMeTheCoolObject") returns true.

    So my colleagues big brain, what is the magic?

    In advance, thank you for the help!
    Scott

    Kglad,

    Quote:
    Posted by: kglad
    the error message, seems, your function expects a member of the class MyCoolObject, correct?
    and MyCoolObject is not an instance of this class. so, you have to fix that. That is to say, create a member of this class, and use this class as a parameter of the function member.

    Heh, that's what the error message says all right. But the object IS actually an object of class MyCoolObject. I looked at this thing for hours and MyCoolObject IS an instance of this class. I tried different combinations of casting (including the cast on an object and passing that) but had no luck whatsoever.

    So I googled this particular runtime error message ("Error #1034: has no Type constraint: cannot convert '" ") and found a ton of links to other people with a similar problem. As a general rule, the problem was just as you say, someone passes a button as a string, that kinda thing. But a guy had a problem with an object that it has derived from the event class. Once the hours spent trying to make it work, he has tried to override clone() of the base class method and got it to work:

    http://www.assertTrue.com/articles/2006/10/14/custom-events-in-ActionScript-3-0

    As for my project, I took a long, hard look at the overall architecture of my project and decided it would be better if all the 'real work' is held in the HAND. SWF file. This approach would solve some other problems, and it makes sense in a mindset of "separating the display of data.

    If (and this is the interesting part) I changed the API for the LOADED. SWF to accept the pairs of strings (ie., LoadedSWF.AddToDisplay (String Name, String Data)) rather than accept MyCoolObj. Ran and Viola, now we work without any throw exceptions in. After this moment of glory, I created a couple of other APIs that comes from base classes (a type int, the other a type function) agreed and was happily on my way.

    On this basis, I understand while passing another base class objects (IE, the derived class) to load MovieClips via custom function API is... perhaps not so simple you'd expect. In the grand scheme of things well, not a big deal: as far as I'm concerned AS3 rocks.

    Kglad, thanks again for all the help: your comments on how this was the big push that I needed to get through the last barrier of this project.

    For those who read this topic for the ' how to call functions or set variables in a loaded SWF file?

    The short answer is cast to the SWF file that is loaded as a MovieClip content object and then call the function or change the variable:

    Load the SWF file (you saw this code a million times)
    var LoadedSWFObj:Loader = new Loader();
    var MyURL:URLRequest = new URLRequest("LoadThisSWF.SWF");
    LoadedSWFObj.load (MyURL);

    It is within your Event.COMPLETE Manager:

    Cast as a MovieClip object and work with it.
    var LoadedSWF:MovieClip = LoadedSWFObj.content as MovieClip;

    or another way to perform a cast:
    var LoadedSWF:MovieClip = MovieClip (LoadedSWFObj.content);

    Call yer function:
    LoadedSWF.CallMe ();

  • calling functions from c ++ JavaScript

    It seems to me that only the functions Q_SLOT can be called from an external javascript file. For example

    ButtonID.Clicked () works, while buttonid.isEnabled () does not work. How to call functions like this from javascript?

    Hello
    "Buttonid.enabled" work? (enabled is a property)

    It should also be possible to call the functions marked Q_INVOKABLE.

  • Calling functions PHP FB

    I have a project where I need to call specific PHP functions, but I'm having some trouble.

    I can call and execute PHP script, but not an individual function.

    How to call functions that exist within a PHP script?

    You can use AMFPHP. Here is an article that leads to an explanation of pdf:

    http://blogs.Adobe.com/mikepotter/2006/02/flex_and_php_us.html

    or you can google.

  • How to call a function in class library?

    Hi all

    Anyone know how to call a function in a library project?

    I have to call using a resource file in a library of a CLDC project project.

    So I write a simple test library and tried to access a function in my CLDC application.

    I tested with 2 following projects.

    1. a library project: TivitFirm

    Sorry I can't answer this from the point of view of the eclipse, I use JDE.  But I suspect that the approaches are similar, even if the detail is different, so maybe this will help you.

    In JDE, you have two options:

    (a) use a jar

    (b) create a dependent project

    (a) I usually use a jar.  So to do this I have a workspace is the library, I compile this, then in my project that uses it, I add the jar to build settings

    (b) in this case, you have two projects in the space of a job, and you say the main project that it is dependent on the library project.

    I hope this helps.

  • How to call a function of my html code to js created by animate cc, I had used 'exportRoot.functionName' and said this function in my document of flash pro with html5 canvas, but now on cc animate this way doesn't work.

    My html code created by animate cc was changed to php for me, because I send and received variables via get and catch the cookies and much more. the function that I used to call function on my .fla of the document is passId() and it worked before when animate was Flash pro with html5 canvas.

    Captura de pantalla 2016-09-27 a las 12.19.59 p.m..png

    And function of .fla, I frame_0 only assign to the variable "id_usuario", this is the feature on fla:

    Captura de pantalla 2016-09-27 a las 12.20.12 p.m..png

    First of all, the title of your thread is horrible. Titles are supposed to be securities, not paragraphs.

    As for your problem, you are probably trying to call catchIdUser before it is defined. handleComplete() is raised when the content is ready to run. He did not actually yet. I guess you should have script code call the function of window parent, not the other way around.

  • Hang the function call after Document Class' Event.ADDED

    I tried to load an external SWF (which contains the code below in its document class) with the charger of class but I keep getting Error #1009: cannot access a property or method of a null object reference. So I tried to use the Event.ADDED event listener in the constructor of MyDocumentClass of the external SWF file to leave the document class to be part of the display list, before I have to call createRandomGraph. But when I place createRandomGraph() inside onStageReady, the compilation process is suspended. When I left the createRandomGraph() inside the constructor, it works perfectly as isolated but will produce error 1009 so loaded in the SWF loader. Any ideas?

    public void MyDocumentClass)

    {

    this.addEventListener (Event.ADDED, onStageReady);

    createRandomGraph ( )

    }

    private void onStageReady(oEvent:Event): void

    {

    this.removeEventListener (Event.ADDED, onStageReady);

    }

    private void createRandomGraph(): void

    {

    var cRandomGraph:RandomGraph = new RandomGraph();

    cRandomGraph.x = 10;

    cRandomGraph.y = stage.stageHeight - nH - 25;

    cRandomGraph.setDimensions (nW, nH);

    cRandomGraph.createGraphBackground ();

    this.addChild (cRandomGraph);

    }

    use:

    public void MyDocumentClass)

    {

    this.addEventListener (Event.ADDED_TO_STAGE, onStageReady);

    }

    private void onStageReady(oEvent:Event): void

    {

    this.removeEventListener (Event.ADDED, onStageReady);

    createRandomGraph();

    }

    private void createRandomGraph(): void

    {

    var cRandomGraph:RandomGraph = new RandomGraph();

    cRandomGraph.x = 10;

    cRandomGraph.y = stage.stageHeight - nH - 25;

    cRandomGraph.setDimensions (nW, nH);

    cRandomGraph.createGraphBackground ();

    this.addChild (cRandomGraph);

    }

Maybe you are looking for