The main time line control Movieclip symbol.

I am new to AS3. So what I did, is to create 3 buttons on the main timeline, each button will be goto a framelabel/keyframe. Presents all works, however in this picture-key, I have a symbol with a FLV video integrated in it. I want to push a button on the main timeline, goto that keyframe and the film plays. So far it works, the problem is I want to stop the movie when I slect a different button. If I select a different button, the film continues to play and if I hit this same but go back t the film, then the film begins to play and I have 2 bodies playing at the same time. I tried to get here, but I can't seem to find anything like what I'm doing.Untitled-2.jpg

So here is the main scenario, I have 3 buttons on the layer of the menu and the content of separte on each of the 3 images to label points.

Untitled-3.jpg

As you can see I have a video flv embedded in a symbol (type Movie Clip), so when I select button 2 he goes and plays the movie, but when I select key 1 or 3 to change the setting up, the film continues to play in the background, (I can hear the audio), was hoping someone can tell me how to add code to stop this When I select another button below is my code that I have now,

Untitled-4.jpgUntitled-5.jpg

Here you can see that the video is embedded in the movieclip. I do this because I want to have only 1 file, I don't want an external file. I am trying to create a mobile app, so I want only 1 file.

Any help is greatly appreciated.

use:

Stop();

var point: point;

btn_page1.addEventListener (MouseEvent.CLICK, onPage1);
btn_page2.addEventListener (MouseEvent.CLICK, onPage2);
btn_page3.addEventListener (MouseEvent.CLICK, onPage3);

function onPage1(event:MouseEvent):void
{

removedotF();

gotoAndStop ("page1");
}
function onPage2(event:MouseEvent):void
{
gotoAndStop ("page2");
dot = new Dot;

addChild (dot);
dot.x = 10;
dot.y = 10;
}

function removedotF (): void {}

{if (dot)}

dot. Stop();

removeChild (dot);

dot = null

}

}

function onPage3(event:MouseEvent):void
{

removedotF();

gotoAndStop ("page3");
}

p.s. Please check the useful/correct.

Tags: Adobe Animate

Similar Questions

  • How can I remove eventListener on the main time line off the loaded SWF?

    I have a Workbench where my main timeline is retouching of the marked sections. In one of the marked sections I have load and SWF file using greensock SWF Loader. In the loaded SWF file, there is a command where I need to remove/addEventListeners on the main timeline of the flash file in the loaded SWF file.

    The establishment with "MovieClip (parent.parent.parent.parent)." works for the navigation and loading and other functions. However, I get the error "1120: access of property unidetified" if I want to use a line of code like this:

    MovieClip (parent.parent.parent.parent) .mainNav_buttonsGroup_mc. Applications_b tn_mc.removeEventListener (MouseEvent.ROLL_OVER, overHandler_Applications_btn);

    I'm just writing this EventListeners again in the SWF file loading (thus repeating once again that they are specified on the main time line already) or there is a better method for her?

    appImgBtns_mc.testBtns2_mc.addEventListener(MouseEvent.CLICK, onClick_testBtns2);
    
    
    function onClick_testBtns2(event:MouseEvent) :void {
              /////////
                        ////disabling the button onClick by removeEventListener
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Applications_btn_mc.removeEventListener(MouseEvent.ROLL_OVER, overHandler_Applications_btn);
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Applications_btn_mc.removeEventListener(MouseEvent.ROLL_OUT, outHandler_Applications_btn);
                            //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Applications_btn_mc.removeEventListener(MouseEvent.CLICK, onClick_Applications_btn);
                        ////coloring the button
            MovieClip(parent.parent.parent.parent).Applications_btn_timeLine.play();
      
                        //Products_btn_mc
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Products_btn_mc.addEventListener(MouseEvent.ROLL_OVER, overHandler_Products_btn);
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Products_btn_mc.addEventListener(MouseEvent.ROLL_OUT, outHandler_Products_btn);
                        //MovieClip(parent.parent.parent.parent).mainNav_buttonsGroup_mc.Products_btn_mc.addEventListener(MouseEvent.CLICK, onClick_Products_btn);
                        //discoloring the button
            MovieClip(parent.parent.parent.parent).Products_btn_timeLine.reverse();
      
      
              MovieClip(parent.parent.parent.parent).sourceVar_AppPopUpsLoader_fromPrdcts="images/app_images/original/icysophistication_new_tl.swf";
              MovieClip(parent.parent.parent.parent).gotoAndPlay("appPopUps_fromPrdcts");
    }
    
    

    You can communicate with the main timeline by dispatching events from the child swf file.

    When the child Swf is loaded, dispatches an event, i.e. - dispatchEvent (new Event ("DoTimeLineCode"));

    Then on your main timeline, listen for the event and perform the desired functions:

    MovieClip (root) .addEventListener ("DoTimeLineCode", mainTimeLineFunctions);

    function mainTimeLineFunctions(e:Event):void

    {

         MovieClip(root).Applications_btn_timeLine.play();

    etc...

    }

    ChasingMovieClip(parent.parent.parent.parent) has always been a losing battle for me. It's best practice to use event dispatchers and listeners to instantiate "things" from the parent child paradigm.

    ~ Chipleh

  • Can I access a label inside a MC and then return to the main time line

    Here is my current set up.

    I have a section marked on the main timeline that has the icons of 12 different videos. Each icon acts as a button and brings a user to a section marked with a FLV Playback component work video to play the corresponding video. These marked sections are located on the main of the time.

    This methog is my very long time mainline. Is there a way to do an additional MC which will hold all the buttons of the video and then have this MC separated in marked sections.

    In other words can I access a label inside a MC and then return to the main time line?

    My current code to access the label placed on the main timeline is:

    HowTo_maininfo_mc.theArrangement_btn.addEventListener (MouseEvent.CLICK, theArrangement_btn_amimated_btnDown);

    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}

    gotoAndPlay ("theArrangement");

    }

    What it would be like if my "theArrangement" label would be located inside a MC?

    Is there a specific code of if I want to have a close button located on the label inside a MC and he needs to get on a label located on the main timeline?

    You should have an image with an flvplayback component and having each button assign the variable value from a source that is used by your component:

    var sourceVar:String;

    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {}

    sourceVar = "arrangement.flv";  for example

    gotoAndPlay ("flv_pb");

    }

    ///

    and as part of the "flv_pb", use:

    yourflv_pb.source = sourceVar;  where yourflv_pb is your component instance name.

  • access to the main time line function

    Hi all

    In as2, we use _root to access the main timeline inside the movieclip or button function.

    In as3 how to access the main scenario works inside the movieclip or button.can please tell me.

    'root' is the equivalent of AS3, but use it alone will often not wortk.  Most often, you will need to cast as a form of object until the compiler will recognize.  To aid "MovieClip" (root) will usually do the trick.

  • How to return to the main stage from inside a symbol

    Greetings,

    I'm going absolutely crazy trying to get back to the main stage from inside a symbol.

    To open the symbol on a click of the main stage...

    var mySymbolObject = sym.createChildSymbol ("practiceScene", "Stage");

    It works, I get the symbol

    To return to the main stage from within the symbol on a click...

    sym.getComposition () .getStage () .play () [0]; or sym.getComposition () .getStage () .play ('home');

    This does NOT work, I can't get the symbol.

    Help, please!

    R

    Obliously your symbols are hiding the main timeline. If you put this in your steps, click on events, it will remove the symbols and go to home label.

    I put a square home and hide it when not on the House. Thus, it shows only there.

    sym.getComposition () .getStage () .stop ('home');

    sym.deleteSymbol ();

    So basically, you will need to remove the symbols and recreate them when you need.

    But I could be wrong.

    Here is your file with this correction: I once on home and the other at the opening.

    sym.getComposition () .getStage () .stop ('open');

    sym.deleteSymbol ();

    https://app.box.com/s/aj0zapp11mc98gz3ghtj

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

  • How a class can access a variable on the time line of MovieClip?

    in my class, I declare a linked clip:

    a_mc = new LinkedMC ();

    trace (a_mc.testString);

    and on the time line of LinkedMC:

    testString var = "test string";

    but I can't access test string.

    clues?

    Thank you!

    you try to access the variable before it is defined.  have your LinkedMC send a rental event your knowledge the variable has been set and assign a listener to a_mc to detect this event.  in the listener function, use your trace() function.

  • What is the relationship between the main timeline and timelines of symbol in Adobe Flash Professional CC?

    I am new to Adobe flash and tried to create an E-card for a class. My teacher said that it is better just to have a keyframe for each layer in the main timeline and do all the clips of animation and film on the deadlines of each symbol. I'm having a hard time to understand how it works. To illustrate my confusion, let's start with an example.  I have a kite I want to start flying to frame 20. The kite is a symbol, so I create movement to 20 image interpolation in chronology of the wing. 20 on the symbol Timeline frame occurs at the same time as frame 20 of the MAIN scenario, or are they completely separate instances of time?

    Part of my mission, is should I use code snippets to add an element of interactivity to the Ecard. My confusion about the timeline affects my ability to do so. My teacher said that you need a stop on the first keyframe code to make sure that things will not start before you click the play button. Can I put the stop action on the main timeline or in the timeline of each symbol, or both?  Let's say I want to create a button that makes the kite flies when I click it. Where to play action 'go to and play', in the Assembly of the wing?

    I would greatly appreciate any help from the community. I'm the kind of person who needs to understand how things work. I searched for days, watch videos and read articles, but I still need to find a resource that effectively dissolved my confusion on this subject. So if anyone knows of any tutorials that explain how the main timeline and symbol timelines coincide, please share them with me. Thank you very much for your time.

    (P.S. are CC Animate Adobe and Adobe Flash Professional CC the same?)

    Thank you both for responding. Yes, your answers were useful, but a bit Advanced. I hope that you don't mind me asking a few follow-up questions.

    For Pete47-

    So I put my stop() in the main timeline. How the actionscript in the main timeline code works on the chronology of the wing if the two are separate?  Why not put the ActionScript on chronology of the wing? Clearly, there must be an interaction between the main timeline and symbols, right?  When you say "you can drag the symbol on the main timeline and it will run when you start", what do you mean by that? Like GETTING started, in the main timeline or in the scenario of the symbol? As you can see I am very confused by there!

    For Colin.

    I thought that Pete said you want to only have a keyframe in the main timeline. Then, when you said... "you can do it with an interpolation of the main timeline... from the beginning to the final position," why would you animate the motion on the main timeline? Why not in the chronology of the wing, can create another symbol of the tail in this period?

    And if the schedules of chronology and main symbol are separated, how SYNCHRONIZE you together different symbols to their movement to work together? And why should it be like that anyway?

    I am new to the community here, the last thing I want to say because you two sounds very knowledgeable on the Flash. How did you get your start? Did you start by watching the tutorials, read the manual, or something else?

    Once more, you have my abundant thanks for taking the time to help.

  • How to target the element of the main stage of in a symbol

    I have a symbol where I want to put an action click here to do something to another item on the main stage, how can I do this?

    Check out my tutorial here:

    Targeting of the symbols: discovering the mystery l EdgeHero

    This was made with a previous version of Animatebut the principles still apply.

    In addition, if you use the snippet window, it will give you good scope.

  • How to access the chassis lable on the main stage of a nested symbol

    All-

    I have two buttons

    btnA on the main stage

    btnB is nested inside btnA

    How to access a lable of frame on the main stage of btnB

    Hi, zontaluma-

    This should work:

    sym.getComposition () .getStage () .play ("label");

    -Elaine

  • Pass a variable to the main class to a MovieClip

    Hello!

    I have a document with the main class.

    I have also a few clips that have their own class and functions.

    I'm trying to pass a variable in my main class to one of these clips.

    I tried a few things, nothing has worked.

    Who can help?

    Match_Easy looks like a class name.  You must use the name of the instance.

  • Movie Clip on the main timeline to control

    I have a button in a mc and I want that he plays on the main timeline, it does, however, when it gets to the last specified image I want to go to another frame.
    Here's my actionscript I was that day.
    on (release) {}
    _root.gotoAndPlay (75);
    }
    Basically I want all my buttons to play 75 weft, however after each button corresponds to a different image that I need to go to play. 75 frame is essentially a transition to other pages. Each page has the same transition. Any ideas on how to achieve this?

    Well, I have a layer called actionscript, which is for my codes. Where you found other ActionScript where I don't know. But thanks for all your help. Whatever it is, problem solved.

  • Digital time line controlled PXI-6251

    Hello

    I need to create a Boolean control moment.

    For example, a digital line is set to False. I would like to change to true status for a certain period of time (e.g., 150ms).

    Is this possible with PXI-6251?

    Thank you

    Hello

    Yes you can. Set a task in the buffer output as e.g. "digital - end Output.vi.

    You can use an external clock, it generates throught counter output or use ananog/output sample clock.

  • question for the Red time line

    Hello forumers.

    I accendently clicked on one of my diapers and a time red line appeared on the screen how can I dispable it?upload to adobe.jpg

    You have opened the layer view.  To close, click on the small x on the tab at the top of the layer display window.

  • Make an express airport only connect to an another AE and not the main Time Capsule.

    Hi all

    I have a Time Capsule airport and 2 Airport Express. The Capsule is far and an of the expressed airport is in the middle (call this) 1 and the other far from it, I'm calling this 2. As it is now, the 2nd Airport Express terminal connects to Time Capsule. However, it gives me much lower speed (Interruptions during the game). But if the 2nd Airport Express connects to the AE first, which is the extension of the network of transport CANADA, significantly improves the speed.

    I've tried everything. All devices are relatively new (think of the last model). I called the Apple Support, but their solution was to any wire. I asked if the 2nd AE can be configured statically, but they have quoted me their policy, which is not supported and took my info and never called back. I read the posts of the forum, but could not find any relevant information.

    Can someone tell me how I can do the 2nd AE connect only to the AE 1 (in the middle) so I can get faster speed for the game device wired to the 2nd AE? Your feedback is much appreciated.

    Kind regards

    B.

    When you try to extend using the wireless, there will be a loss of speed associated with the process.

    When the two Airport Express connect to Time Capsule, it will be more loss of speed because the 2 devices are connecting and extending.

    If the 2nd Airport Express does not connect to... Time Capsule and it connect instead to the 1st AirPort Express... then 2nd Terminal AirPort Express doesn't have to extend the network.  The 2nd Airport Express could be used for AirPlay, or to connect to a remote printer on the USB port, but it cannot 'expand' or 'repeat' in this case the signal of the wireless network.

    So you're wrong bing into thinking that the network is the extension more quickly if the 2nd Express connects to the 1st. Your network will behave at the faster speed even if you just turn off the 2nd Express.  It is not at all in any case extending the network, and you don't need.

    Here's another way to look at the same thing... using an illustration of the Apple support document for the extension of a network:

    IF... you can connect the 1st Terminal AirPort Express at the time using an Ethernet cable Capsule... then... the 2nd Airport Express would extend the signal from the first... but speed would be because you are trying to extend using the wireless.

    SO... connect the AirPort Express devices using Ethernet... then you will have maximum coverage at the highest speed... Since there is no loss of signal via the Ethernet cable.

Maybe you are looking for