Go to a function on the main timeline of the timeline of the object

Hello

I have an object on the stage, MovieClip, with an animation inside.

The animation is called from a class file.

I would like to call for a function, addBubbles, when the animation of the MovieClip is completed.

The function, addBubbles, is described in the main timeline, in the first picture.

But I would like to call from inside this MovieClip, and write the code in the last image.

How should I reference, so it would work?

Both ways would be to use just...

MovieClip (root) .addBubbles ();   OR MovieClip (parent) .addBubbles ();

Another way would be to have the MovieClip to dispatch a custom event for which you have a listener assigned in the main timeline.  This listener in the main storyline would have an event handler function that calls the addBubbles function.

Tags: Adobe Animate

Similar Questions

  • Function returns the object type

    Hello
    This isn't a duplicate of another thread, I posted earlier with the procedure...
    Now I try the subprogramme with the service, as required by the client., so I opened the question in another thread
    CREATE OR REPLACE TYPE Type_Rt IS OBJECT
        (Rt_Type      VARCHAR2(2000),
         cdtRt       VARCHAR2(2000),
         lqdtRt    VARCHAR2(2000),
         Olk              VARCHAR2(2000),
         cdtwh       VARCHAR2(2000) )
     
    CREATE OR REPLACE TYPE Rt_Type_Var IS TABLE OF Type_Rt;
     
     
     
    CREATE OR REPLACE FUNCTION FUNC_RAT (
                                Cp_Id  VARCHAR2,
                                             St_Id    VARCHAR2,
                                             cdt_Rt   VARCHAR2,
                                             liq_Rt      VARCHAR2,
                                             Olk      VARCHAR2,
                                             cdt_Wh VARCHAR2)               
    RETRUN Rt_Type_Var IS
       v_typ_rat_List   Type_Rt ;
       var1_nri varchar2(100) := 'ST';
    BEGIN
       IF ( Cp_Id = 'NTE' AND St_Id = 'Y' ) THEN   
        --select distinct ne_rt_issue into var1_nri from rt_con where ltr_ener = cdt_rt;
             
         v_typ_rat_List := new Type_Rt ('STRT',var1_nri ,liq_Rt,'Stle' ,null);    
       END IF;      
         RETURN v_typ_rat_List;
    END;
    / 
    I get the following error:, I tried it but no luck on my side
    PLS-00382: expression is of wrong type
    After you create the function, I have to call this function as
    SELECT * FROM TABLE(FUNC_RAT ('NTE','Y','AB','C','Y',NULL))
    Could you please help me with this

    The same basic problem as in your previous thread. Confusion between creating an object from a collection/table of this object.

    Here's a basic example:

    SQL> create or replace type TScalar is object(
      2          id      integer,
      3          name    varchar2(10)
      4  );
      5  /
    
    Type created.
    
    SQL>
    SQL> create or replace type TArray is table of TScalar;
      2  /
    
    Type created.
    
    SQL>
    SQL> --// creating a scalar
    SQL> select TScalar( 1, 'John' ) as OBJ from dual;
    
    OBJ(ID, NAME)
    --------------------
    TSCALAR(1, 'John')
    
    SQL>
    SQL> --// creating an array/collection
    SQL> select
      2          TArray(
      3                  TScalar( 1, 'John' ),
      4                  TScalar( 2, 'Tom' )
      5          )                               as ARRAY
      6  from       dual;
    
    ARRAY(ID, NAME)
    --------------------------------------------------
    TARRAY(TSCALAR(1, 'John'), TSCALAR(2, 'Tom'))
    
    SQL> 
    

    So in your function, you will need to place objects in the collection.

    return(
        Rt_Type_Var(                      --// instantiate the collection
               Type_Rt ('STRT',var1_nri ,liq_Rt,'Stle' ,null)  --// place an object into the collection
        )
    );
    

    And use appropriate type names and the object. Poorly chosen and non standard naming conventions just add to the confusion.

  • function outside the object

    Hello

    How can I use a function that is declared outside the object or layer?
    I like that I can group all my functions in a single layer.

    Thank you

    layers are not referenced. MovieClips and buttons, but not diapers. If you have the code on the same chassis, it doesn't matter what layer--with the exception of the procedure questions, but you should look at those if it were on a fram anyway, so no biggie.

  • : Error 35 call external function of the object

    I get "error 35: error when calling external object function driverinit on line 302 of the event open"and impossible to open a program. " A few solutions that I found for this search refer to an update to the SQL Server.  The only thing I tried to do lately is to update a printer driver, all was working fine before this.  I got an SQL error on a website trying to access the FAQ section.  I found an article to download an update to the original version of SQL Server 2005 SP2 but not sure if that's what I really do.  Can anyone help?

    CRTet,

    Error 35 is not a common Windows error. It is very likely that the registry scanner above will only cause more problems.
    The error you get is from your application. Given that this is not generated by Windows, I highly recommend directly contacting the support of bookkeeper.

    Cody C
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • 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 ());

    });

  • How to remove a function on the main timeline in a clip

    How to remove a function which is coded on an image of the main timeline of a clip?  I tried this, but no dice:

    infoGraphicDisparity.addEventListener (MouseEvent.CLICK, fl_ClickToGoToScene);

    function fl_ClickToGoToScene(event:MouseEvent):void

    {

    parent.removeEventListener (Event.ENTER_FRAME, parent ["enterFrameHandler"]);

    MovieClip (this.root) .gotoAndPlay ("disparity");

    }

    It's the event that I am trying to remove:

    stage.addEventListener (Event.ENTER_FRAME, enterFrameHandler);

    any help would be appreciated as always.

    Thank you!

    any image (which runs after enterFrameHandler is defined) in any display in the display list object

    stage.removeEventListener (Event.ENTER_FRAME, MovieClip (root) .enterFrameHandler);

  • functions in the document class when the main timeline reached a framework

    Hello

    I have 3 functions in my document class main I want to run when the main timeline reaches a specific frame number.

    How do I do that?

    See the code and comments

    public void mainClass()

    {

    //stage declaraction

    stage.align = StageAlign.TOP_LEFT;

    stage.scaleMode = StageScaleMode.NO_SCALE;

    stage.addEventListener (Event.RESIZE, stageResized);

    wrap these next 3 lines in an if statement so maintimeline currentframe = x

    position().

    loadXml();

    initArrowButtons();

    slideTimer = new Timer (timer_delay);

    slideTimer.addEventListener (TimerEvent.TIMER, nextSlide);

    }

    You can always know what the current picture is by reading currentFrame peoperty:

    public function mainClass() {     addEventListener(Event.ENTER_FRAME, onEnterFrame);}
    
    private function onEnterFrame(e:Event):void {     switch(currentFrame) {          case 1;              frame1Function();          break;
    
              case 2:              frame2Function();          break;
    
              // etc.}
    
  • Use the MC button to perform function on the main timeline

    I was wondering how (or if it is possible) to use a button that I have in a clip to perform a function on the main timeline. Specifically, I want the button in the clip to stop on an image of the main timeline. Any suggestions?

    Hello
    _root is the main scenario.
    So if you have your button (say button1) the code would be

    Button1.onRelease = function() {}
    _root.gotoAndStop (20);
    }

    This would prevent the main timeline to frame 20.
    This is for actionscript 2 (flash 8).

    for cs3 (actionscript 3) this would be it

    Button1.addEventListener (MouseEvent.Click, clickHandler);
    function clickHandler(event:MouseEvent):void {}
    _root.gotoAndStop (20);
    }

    Hope this helps
    Alan

  • How can I access a variable on the main timeline of a movie nested in HTML5 Canvas

    Hello

    This should be pretty simple, but for some reason, it does not work if I have the wrong syntax.

    But I have a movie clip with a bit of code in it.

    It is a timer.

    I want to be able to program the wait time: since the main scenario and that the timer read this variable on the main timeline.

    I implemented the delay var = 1000 on the main timeline, but then I do not seem able or knows how to get this variable in my code in the nested MC. It is quite difficult to find the reference of the paradigm flash timelines on H5 support pages, so I really appreciate the help.

    tl2 var = this;

    TL2. Stop();

    var delay = delayMain;

    var startTime is createjs. Ticker.getTime ();

    createjs. Ticker.addEventListener ("tick", f);

    {function equation

    If (createjs. Ticker.getTime () - startTime > delay) {}

    TL2. Play();

    createjs. Ticker.removeEventListener ("tick", f);

    }

    }

    If you want to get to a variable defined by a feature any at any depth, you can use the window. As:

    Window.Delay = value;

    in a deeply buried movieclip, can be read in any other level of the project.

  • Addressing the main timeline via the code on a HTML5 canvas file

    Of course you can target to _parent, _root etc. in Actionscript.

    and create.js using 'this' to the current timeline, but what happens if you want to target the root/parent?

    I have this 'this.stop ()' who of works, but also want a 'root.play ()' can do such a simple thing?

    Thanks in advance.

    The root of an application createjs is the window. I don't know if the window has a play() function. So, I think you mean how would you play at the level of the main scenario for something from deep inside the nested clips. Who could possibly be achieved by looking at the document and find the element with an ID which is "canvas", or you have your named.

    A simpler solution would be to put a variable somewhere. At the beginning of your main timeline you could say:

    Window.main = this;

    then, from any depth you could say:

    Window.main.Play ();

  • Control loaded swf on the main timeline

    Hello

    I'm working on loading external swf files for ios. I am able to load swf files and assembled visible or invisible in different settings. I have trouble controlling the swf files loaded on the main timeline. Specifically, I would like to have a button on the main timeline, that when you click on will move a swf loaded to frame 1.

    Here is a code that loads a swf file:

    var myLoader1:Loader;

    var loaderContext1:LoaderContext = new LoaderContext (false null, ApplicationDomain.currentDomain),

    if(myLoader1 == null)

    {

    myLoader1 = new Loader();

    addChild (myLoader1);

    }

    myLoader1.load (new URLRequest("folder/file1.swf"), loaderContext1);

    myLoader1.visible = true;

    backbutton.addEventListener (MouseEvent.MOUSE_DOWN, backbutton1);

    function backbutton1(myEvent:MouseEvent):void {? myLoader1.gotoAndStop (1) ;}}  (this line does not work)

    (Once I load file1.swf, in the file1.swf I click a next button to move on to different periods.) My question is: hHow do I code the "backbutton" on the main timeline so that it causes the file1.swf to go to frame 1?)

    Thank you for your help.

    After loading is complete (and assuming that you load an as3 swf), you can use:

    MovieClip (myLoader1.content) .gotoAndStop (1);

  • How to set a variable in the main timeline of in a symbol?

    Just get started with Animate and coming from Flash, it may be apparent to my question. How do you define a variable for the main timeline of in a symbol?

    I have 24 pairs of clickable elements, each in their own symbols, and 24 of these symbols to sit inside another symbol. I want every 24 to set the global variable even when you click on it. I do not find that this question is anywhere, which makes me think that I can be stuck in a mentality from Flash and approaching the task in a bad way. (However, there are MANY discussions address showing how objects to different levels in the hierarchy.) Which is well covered).

    By the way, how to access a function on the main timeline of in a symbol?

    Adobe should consider putting on foot (or pages) support just for people migration form Flash. In the documents that I've met so far there seems to be a studied effort to refrain from mentioning Flash somehow. I imagine that there are many people out there like me who have a deep background in coding Flash, but start with Animate. We don't need help with most of the basic concepts, but we still have some pretty basic questions on how to achieve certain things in Animate because our knowledge of Flash gets in the way.

    Hi Bill,

    There are a lot of discussions here on the scope, but here's a way to create a global variable:

    code on Stage.compositionReady

    sym.myGlobalVar = 1;

    Then, anywhere in your project, you can check/set this var as follows:

    sym.getComposition () .getStage () .myGlobalVar = 2;

    And here is a way to create a global function:

    code on Stage.compositionReady

    sym.myGlobalFunction = function() {}

    Console.log ('myGlobalFunction');

    }

    Then, anywhere in your project, you can call this function as follows:

    sym.getComposition () .getStage () .myGlobalFunction ();

  • Toolbox for CreateJS: how to control the main timeline from outside the canvas.

    Hey everybody,

    I'm currently doing something simple, but my animation film breaks whenever I try to change my code. I created a basic animation in Flash where an object moves from the left side of the canvas, to the right and then loops of the last frame of the first image. Nothing else. The animation is simply placed on the main timeline. I exported the animation with the Toolbox for CreateJS through the extension of the Flash and animation series as it should. I'm trying to start and stop (reboot of the first image) the animation with the mouse on and off mouse events. I want that the events to fire when wriggling over/stop a div outside the animation canvas tag. Is this possible with CreateJS? I'm trying to find a way to control the main timeline without being inside the canvas tag.

    HTML example:

    http://www.thephotoncore.com/testing/example_test.html

    Example Code:

    < id article 'container' = >

    < canvas id = "canvas" width = "550" height = "400" style = "background-color: #cccccc" > < / canvas >

    < section id = "animation_control" >

    < p > hover over to start and stop animation. < /p >

    < / section >

    < / section >

    Thanks again for the help!

    -DJ

    Hi DjPhantasy5,

    All the clips on the scene are children of the scene,

    So now the "mouseover" all clips on the stage could be stopped with stop and on the "mouseout/mouseouthandler()" all the children could be restarted with gotoAndPlay like this:

    function Stop()

    {

    If (stage & stage.children)

    {

    var t = stage.children.length;

    for (i = 0; i< l;="">

    {

    child var = stage.children [i];

    If ('stop' in child)

    Child.Stop ();

    }

    }

    }

    function Restart()

    {

    If (stage & stage.children)

    {

    var t = stage.children.length;

    for (i = 0; i< l;="">

    {

    child var = stage.children [i];

    If ("gotoAndPlay" children)

    child.gotoAndPlay (0);

    }

    }

    }

    See http://www.liauw.nl/forums/adobe/djfantasy5/index.html

    But it is also possible to expose "ball1", for example, by adding it to the document.

    This can be done by adding the code for "ball1" as follows:

    / * js

    document.ball1 = this;

    */

    Then stop the animation would look like:

    function Stop()

    {

    If ('ball1' in the document)

    document.ball1.stop ();

    }

    etc.

    Have fun!

    Ronald

  • Goto frame within a movieclip on the main timeline button

    So what I have is a button (then named) on the main timeline. I have a clip on this framework (on the main timeline) and the clip has 3 images I want to be able to scroll using the "Next" button located on the main timeline. How can I do this?

    Thank you

    assign the movieclip an instance name (in the properties panel - for example, mc) and use:

    Next.addEventListener (MouseEvent.CLICK, f);

    function f(e:MouseEvent):void {}

    mc.nextFrame ();

    }

  • in actionscript 3.0 how do a nested movie clip button go to a section on the main timeline

    I do a site based in flash actionscript 3.0, I have a button nested in its own clip, because I have the button bigger to be able to read what I realized the only way to do it is by creating it as a film clipa nd inside the clip in a button

    I've added an event listener for the button of blog, saying:

    blog.addEventListener (MouseEvent.ROLL_OVER, gotoblog);

    function gotoblog(evtobj:MouseEvent) {}

    gotoAndStop (2)

    }

    This part of the code it goes to 2nd part of the scenario that it is and stop wich is a version of the origanal symbol breath

    I added a second order on structure 2

    blog.addEventListener (MouseEvent.CLICK.gotoblogpage);

    function gotoblogpage(evtobj:MouseEvent) {}

    gotoAndStop ("blogframe")

    trace ("the blog button has been clicked")

    }

    I have named the blog of symbol and use the name from where will the blog page to be "blogframe" this line of code at the bottom is where I run trouble the window output in Flash says "blog button has been clicked" I like it. no errors are accouring why that which is at the playhead does not attend the image "blogframe"? If the button does not work when I click on it the code is correct, I think the problem here is he does not want the read head go to the section I want it. So I gues, my question is, how can we make a button less, a clip interact with the main timeline?

    One way to do this is to target the root timeline...

    MovieClip (root) .gotoAndStop ("blogframe");

Maybe you are looking for