Calling a function within a symbol?

Hello

I am one of these flash devs who try to get edge animate to do what I usually do in Flash, so I could do this the wrong way, but I have a symbol with an "inner" function on my scene, and I want to call this function from the scene.

I tried to use () .getStage () sym.getComposition ().getSymbol("symbolName").functionName; but it does not work.

I have no problem handling the symbol itself by calling the . play() or . hide() so I know the path work... someone can show me the proper syntax to call a function within a symbol?

THX in advance

Hi Abnesher,

An important principle to grasp is that symbols (and the stadium is one of them) is located in parallel, despite instances of different symbols, nested one inside the other (and all ultimately nested in the scene).

The consequence is that from the inside of your nested symbol, you have no direct visibility of the function defined inside the step symbol!

Inside of the symbol of the step , in the document.compositionReady event handler:

sym.yourGlobalFunction = function (firstParameter)

{

your stuff

}

Inside another symbol, in one of its event handlers:

sym.getComposition () .getStage () .yourGlobalFunction (5);

Gil

Tags: Edge Animate

Similar Questions

  • How to call a function within a movieclip on the main timeline in CC animate canvas?

    Hello world...

    In AS3: Function (fnc name: myFunction) inside a Movieclip (mc1). I'll call you timeline mc1.myFunction ();

    But how to call AnimateCC canvas?

    If you have an instance of MovieClip named "mc" with the following code in to:

    This.Fun = function() {}

    Alert ("Hey!");

    }

    You can call this function (increased to 'this' within the MC) using the oon following the main timeline:

    var root = this;

    this.mc.addEventListener ("click", function() {}

    Console.log (root.mc.fun ());

    });

  • Call a function within the same CFC component

    Hello
    / * Niewbie Question * /.
    I have a strange problem. When I try to call one function on the other in the same CFC component, I get an error named: "Entity has incorrect type to be called as a function."
    I looked on many forums and searched in Google groups. I have yet found a work around for this problem.
    I thought I did caution o not use twice the same name...
    Can someone tell me what I did wrong?

    My sample code to reproduce this error is included

    The full error message is:
    Entity is of the wrong type to be called as a function.
    The symbol you provided superfunction is not the name of a function.

    The error occurred in C:\ColdFusion8\wwwroot\admin\_components\test.cfc: line 6

    4: < cfinvoke
    5: method = "superfunction".
    6: returnVariable = "myReturn" >
    7: < / cfinvoke >
    8: < cfset some_text = myReturn >

    OK, solved with all your advice!

    A big thank you to everyone

    Here is the final code for others...

  • PL/SQL anonymous block - try to call the function within cursor

    Hello-

    I need to create an anonymous block that contains a cursor and function. I want to call the function from the cursor and function will essentially have an ID as parameter and will return a list of values comma separated.

    However, when I try to do it I get the error 'function 'GET_PAYMENT_DATES' is not usable in SQL.

    Does anyone know of a workaround? I'm trying to avoid having to store this function.

    Thank you
    Christine

    Well you can't do this using an sql not stored function.
    What you could do is to increase your sort_area_size which can help you to overcome the performance Bug.

    for example: alter session set sort_area_size = 64000;

    other than that, it seems that you need a stored function

  • Then I call a function within a framework of another frame?

    In a HTML5 Canvas document. I use javascript and easeljs.

    I declare a framework 1 function:

    function ponerBicho() {}

    this.bichofuncion.cabeza.nariz.gotoAndStop (1);

    }

    then I call in image 9 (in the same timeline):

    ponerBicho.call (this);

    This.Stop ();

    It doesn't work.

    But if I put the statement in the same frame, frame 9, it works.

    function ponerBicho() {}

    this.bichofuncion.cabeza.nariz.gotoAndStop (1);

    }

    ponerBicho.call (this);

    This.Stop ();

    Where is the problem?

    I really appreciate your help.

    (Im begineer )

    You can declare the function as below and call from any image.

    var tl = this;

    Function definition

    this.getfno = function() {

    Console.log (TL.currentFrame);

    }

    Function call - of any image

    This.getfno ();

  • How to call other functions within the ScriptableFunction class

    I am trying to create an extension of javascript class which will record audio, but the problem is that I can't call other methods in the class.

    clear explanation about my problem:

    It's my Scriptable class

    public final class OCNUtilsNamespace extends Scriptable
    {
        VoiceRecord vr;
    
        public OCNUtilsNamespace()
        {
            this.vr = new VoiceRecord();
        }
        public Object getField(String name) throws Exception
        {
            else if(name.equals("VoiceRecorder")){
                return this.vr;
            }
    
            else if (name.equals("stopRecording"))
            {
                this.vr.stopRecording();
                return new String("Stopped Recording");
            }
            else if (name.equals("startRecording"))
            {
                this.vr.startRecording();
                return new String("Started Recording");
            }
            return super.getField(name);
        }
    }
    

    and here's my ScriptableFunction class:

    public class VoiceRecord extends ScriptableFunction {
    
        String status = "start";
        public Object invoke(Object obj, Object[] args) throws Exception{
            if(status.equals("start"))
                return new String("Started Recording");
            if(status.equals("stop"))
                return new String("Stopped Recording");
            return new String("nothing");
        }
    
        public void stopRecording(){
            status = "stop";
            return;
        }
        public void startRecording(){
            status = "start";
            return;
        }
    }
    

    in my javascript every time I call

    alert(OCN.OCNUtils.VoiceRecorder());
    

    I get the response as "recording started"

    but whenever I tried to call

    alert(OCN.OCNUtils.startRecording());
    

    I don't get all respose and the script will stop working at that time here.

    Why is happening like that?

    I'm doing something wrong?

    I did not understand this concept of scriptablefunction anyone please explain what is happening?

    have to apply Runnble to the future because I have to record the sound of the microphone

    I suggest that you simply pass an argument of your javascript in your extension like this:

    public final class OCNUtilsNamespace extends Scriptable
    {
        VoiceRecord vr;
    
        public OCNUtilsNamespace()
        {
            this.vr = new VoiceRecord();
        }
        public Object getField(String name) throws Exception
        {
            if(name.equals("VoiceRecorder")){
                return this.vr;
            }
            return super.getField(name);
        }
    }
    

    and on your class that extends a ScriptableFunction,.

    public Object invoke(Object obj, Object[] args) throws Exception{
    
                   String param = args[0].toString(); // Cast a parameter from your js to a string
    
            if(param.equals("start"))
                return startRecording();
            if(status.equals("stop"))
                return stopRecording();
            return new String("nothing");
        }
    
        public String stopRecording(){
            status = "stop";
            return status;
        }
        public String startRecording(){
            status = "start";
            return status;
        }
    

    Finally, call your extension via javascript like this:

    alert(OCN.OCNUtils.VoiceRecord("start")); // Call the startRecording() on your VoiceRecord class
    alert(OCN.OCNUtils.VoiceRecord("stop")); // Call the stopRecording() on your VoiceRecord class
    

    Hope this helps

  • Question about a view inline or function within SQL

    Hi all


    I would like to know if using a view inline with a sql query is better or a call of function within the sql query is preferable.

    When I check the plan explained in both cases I see no difference in the cost.

    Appreciate your valuable suggestions on this.


    Thank you
    Maddy K.

    A function of a query will be worse than an inline view, given the context of switching between SQL and PL/SQL engines.

    See http://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:60122715103602
    Bonus http://www.oracle.com/technetwork/database/features/plsql/overview/doing-sql-from-plsql-129775.pdf

  • Call a function in a function?

    Hello

    Anyway is to call my functions within a function?

    function musicPlayer() {}

    trace ("Music");

    function pauseMusic() {}

    trace ("pause");

    }

    }

    If I call musicPlayer function I get music output, now how can I call the pauseMusic from outside of the parent function!

    is this possible?

    Thanks in advance

    You can call functions in other functions, but you don't want to define functions within other functions... they have only worn within the service if they work at all.

    function pauseMusic() {}

    trace ("pause");

    }

    function musicPlayer() {}

    trace ("Music");

    pauseMusic();

    }

    musicPlayer();

  • Call a function on the stage of the symbol that is nested in a symbol

    Scenario of

    creation of complete scene

    stage = sym.getComposition () .getStage ();

    SYM.func_btn1 = function() {}

    code

    }

    symbol btn_1

    stage.func_btn1 ();

    It works well

    symbol Index

    symbol btn_1

    stage.func_btn1 ();

    No chance to fire service

    Where is my mistake?

    I write a little different functions, but I tested my way and it works.

    Create functions in compositionReady like that

    SYM. Test = function() {}

    SYM.$("element"). Hide();

    }

    When this function is run it will hide the element on the stage, called 'Element '.

    You can call this function in compositonReady leave a nested using this line symbol

    sym.getComposition () .getStage (). Test();

    I have install a sample project I hope it helps.

    http://www.mediafire.com/download/wv8k19pzqdg9b31/NestedSymbolFunction.zip

  • Is it possible to associate a function of ACEs within a symbol?

    For example, let's say that there is a symbol called "face" that contains three frames: frame 1 is 'sadface', frame 2 is "happyface" and frame 3 is "angryface". On stage, there is a symbol that contains two instances of the symbol 'face '. The instance of that symbol is called "twofaces.  Inside the symbol, there is a function of randomizer AS attached to frame 1 which selects and shows two faces at random whenever you click the instance. There is also another symbol on the stage, called "button". 'button' contains two frames: frame 1 says is a white button, frame 2 is a button with the word "victory" written on it.

    It is possible to write code that tests to see if "deal with" displays corresponding to both sides and said "button" to display the frame 2 / "win"?

    What this code would look like?

    Based on your description details, it is impossible to 'face' display two corresponding faces.  However, it is possible to "twofaces.

    The code could include the check currentFrame and currentLabel each of face symbols to see if they are identical.  If they are the code then tells the 'touch' to access the Framework 2.

    if(twofacesName.faceName1.currentFrame == twofacesName.faceName2.currentFrame) buttonName.gotoAndStop (2);

  • Function within the statement call box SQL

    I have a procedure with many cases not to validate inside statements that compare the data in a table and fill in a description of the error of the dates. (snip of the size of the code below)

    create or replace procedure "PROC_TEMP_UPDATE"
    is
    begin
    update temp_update
    set error_desc = 
        CASE
        WHEN (error_desc != 'MATCH')
            THEN 'PCFN/TCN combo not found in destination table.'
        WHEN (error_desc = 'SKIP')
            THEN NULL
        WHEN (ge_ata is null and az_ata is not null)
            THEN 'Enter GE ATA Date before entering AZ ATA Date.'
        WHEN ((ge_ata is not null and az_ata is not null) and ge_ata > az_ata)
            THEN 'GE ATA Date cannot be greater than AZ ATA Date.'
           end proc_temp_update;
    
    
    

    Instead of having to enter the bottom 2 when reporting for each date, I created these functions:
    (Function 1: check if Date1 is null and Date2 is not.)
    Function 2 these two dates are not null, check if Date1 is greater than Date2.)

    function Is_D1_NULL
                (Date1  DATE, Date2 DATE)
                return BOOLEAN is
    
          result     BOOLEAN := FALSE; 
       begin 
          if (Date1 is null and Date2 is not null) then  
             result := TRUE; 
          end if; 
          return (result); 
       end Is_D1_NULL;
    

    You cannot use Boolean in SQL queries.  You must modify your function to return something like Y/N or 1/0 and assess against that.

    That said, move the engine of SQL and PL/SQL is, relatively speaking, cheap, so I let just the comparisons as they are in instruction box instead of calling a function.

    John

  • Error 1 occurred Armijo rule stepsize reduction failed to reduce the value of function within the maxiters

    Hello

    I try to use the VI of unconstrained optimization to fit a measured spectrum. However, each call VI, I get the error:

    Error 1 occurred Armijo rule stepsize reduction failed to reduce the value of function within the maxiters

    Possible reasons:

    LabVIEW: An input parameter is not valid. For example if the input is a path, the path can contain a character not allowed by the operating system such as? or @.
    =========================
    NOR-488: Command requires controller GPIB be in Charge.

    Does anyone know what I'm doing wrong and how I can fix this problem?

    The VI for the stepsize Armijo rule reduction can be found here:

    \vi.lib\gmath\NumericalOptimization\qn_armijo rule stepsize reduction.vi

    In the current implementation, the spectrum is able to a rectangular spectrum. This may be the cause of the error?

    I have attached the screw that I use. They are written in LabVIEW 2010.

    Thanks Marc67 for your quick reply, but I found the error.

    It was pretty stupid, that I used a bad vector of departure for the unconstrained optimization VI, which was too low values.

  • How to call external functions without one. DLL (just using a.) H and. LIB file)?

    Hi all

    in fact, I am facing difficulties on how to get an external function is called in CVI (Version 2009).

    I was delivered with a. H file and a. LIB file to call an external function of my project CVI. The. H file looks like this:

    void exportedFunction(double *parameter);
    

    As far as I know, the external function was written with MS Visual C++ 6.

    So, I tried to link statically to the al extern like this function:

    -Add the. H file and the. LIB file to the CVI project

    -#include the. Folder H when I needed to call the external function

    -do the external function call

    During construction I get unresolved CVI external function call error, so this seems not work.

    I did some research autour and stood up with two possible problems. Maybe one of you can help me get a bit further and do work things out.

    (1) of the code of the 'real' function inside the DLL file that was not delivered to me. Or y at - it a way to get concrete results (calling external functions) with just one. H and a. LIB file (with none. Included DLL file)?

    (2) the external function does not export according to the rules of Style 'C '. The signature of the function in the. H file shows some things don't like

    extern "C" __declspec(dllexport) void __stdcall ...
    

    Or maybe it's a combination of these two issues (missing. DLL + bad export style function)?

    I guess I could get around the incorrect service export style when I managed to write a wrapper around the original function that actually uses Style C exporters. But I guess I need to the. DLL file for this test as well.

    Thank you very much for your answers.

    Best regards

    Bernd

    There is no need for the stuff of dllexport. There is also the option of a static library without any DLL.  But the "extern"C"' is essential, because it forces the C++ compiler, which was probably used to compile the library to use the C calling convention.

    If you are unable to ask the library vendor to provide a version that was compiled using C calling convention is the way to write a wrapper with VC ++ 6 around this library that functions using C calling convertion reexports. Something like

    extern 'C' myfunc1 type0 (type1 arg1,...) {

    Back to func1 (arg1,...);

    }

    for each function, you must use.

    BTW. "unresolved symbol" is the error message from the linker, you can expect if you try to bind the C code against a generation of library with the C++ calling convention.

  • Calling the functions to Iscript

    Hello world

    I hope you all do well. I just want to confirm one thing, is it possible to call functions in Iscript? If so please guide me. Right now I have an Iscript file in hundreds of lines of code. I want to break these lines of code in different functions and call the functions where they needed.

    Thank you

    Take a look at WEBLIB_PORTAL. PORTAL_ADMIN. FieldFormula

    Function: IScript_AdminSiblingNav()

    There are several calls to another position within the IScript.

  • How can I add css style to all elements within a symbol.

    How can I add css style to all elements within a symbol.

    For example.

    If I have a call symbol "data" and in this context, I have 4 elements called 1,2,3,4 How can I add a style to all of these without having to re - write the code for each item.

    I know that I can style a symbol called "data":

    sym.$("data").css("font-family", "baumans, sans-serif", "font-size", "15px");
    
    

    ... But this style not content items 1,2,3 and 4

    If I was using the standard HTML and CSS then all the div in a div named "data" would be will be the same.

    help to "my friends of the code.

    Hi Justin,

    (1) you have an error in syntax here: sym. $("données") .css ("font family", "baumans, sans", "-font size", "15px");

    SYM. $("données") .css ({"font family": "baumans, sans", "-font size": "15px"}); / / OK

    SYM. $("données") .css ('police', ' 15px baumans, without serif '); //correct


    (2) then, loading the jQuery file is not necessary. You can create a class or change the tags.

    • How to add a class:

    • Change the tags:

    You have 2 demo files (edge 5.0) here: class or tag.zip - Box


Maybe you are looking for