Movieclip within movieclip

I have a movieclip called Room, and within this movieclip, I
have another movieclip called newspaper_mc. When the newspaper
image is clicked, newspaper mc plays hence the code:
newspaper_mc.onRelease = function() {
newspaper_mc.play ()
But, newspaper_mc has several buttons and when these buttons
are clicked they play different frames within that movieclip. I put
some code for the buttons, but seems to ignore this code, so when
the newspaper is clicked with the mouse, it plays the next frame
and the next because of the code I wrote above.
How do I get the buttons to work?

no because of what kglad said.
Once you start the newspaper_mc (which is the parent clip for
your other buttons) playing, do you still need to continue to
listen for clicks on it .If you don't need that then try this:
newspaper_mc.onRelease = function() {
newspaper_mc.play ()
delete newspaper_mc.onRelease
then you could do something like in your last post.

Similar Messages

  • Getting frame number of movieclip within movieclip

    Hey guys, really simple question--how do I get the frame number of a movieclip within a movieclip? Say I have mc2 nested within mc1. Whenever i try to say mc1.mc2.currentFrame, I get
    TypeError: Error #1010: A term is undefined and has no properties.
    at blobgame2_fla::MainTimeline/loop()
    I would attach my fla if this forum would let me.

    You shouldn't be doing this. For one thing, you're likely to wind up with race conditions that mean you can never be sure what exists yet and what doesn't. For another, if you need to change the way mc1 is built, then everything with a "hard" reference to mc2 will break until you dig around and fix it. You should build mc1 to do whatever needs to be done or generate an event (depending on your real end goal).
    What are you trying to do that you need the frame number for?

  • Stop(); within movieclip doesn't work and all my other code doesn't run

    Hey guys,
    I've got a movieclip which has the code stop(); written within it, so that it doesn't play unless i interact with it. What happens now is that when i run the swf file, the entire movie keeps looping, and all my other code just doesn't run.
    I've named my instances buyButton and so on but yeah, somehow it just ignores all my code and just loops. Help!

    Hi Ned,
    In the main timeline it's just one frame yes. So on my main timeline there is a movieclip. Within that movie clip is an animation that adjusts the 'shine' on it. That animation is 20 frames long and i put a stop(); on the first frame inside that movieclip, with the intention that when i publish the swf, the movieclip doesn't loop, but should stop on the first frame. Only if i start to move my cursor over the movieclip, then it has feedback, which is to play the 'shine' animation. That sorta thing. So i had some code in the actionscript layer which edits the text property of the movieclip and it changes from "Click to Buy"(as shown in the screenshot) to "Buy a Shirt!".
    However, when i publish the swf file, the other code, like the one which changes the text property of the movieclip is ignored and also the stop(); function within that movieclip too. And i end up having a movieclip which constantly loops within itself. Other code which i put in, like setting the buttonMode = true and useHandCursor = true are also ignored. The odd thing is that there are no error in my output window. and my publish settings are set to use Actionscript 3.
    EDIT: sorry i used my other account on this haha

  • Buttons not working within movieclip inside scrollpane

    hey I have a couple buttons that work outside of the ScrollPane but dont work within it. This is my exact code, how do i get them to work?
    scrollPane.source = myContent;
    scrollPane.setSize(173,500);
    K1Button.addEventListener(MouseEvent.CLICK, playVid);
    function playVid(e:MouseEvent):void{
    myVideoPlayer2.myFLV2.source = "video/K.mp4";
    myVideoPlayer2.myFLV2.play();
    T1Button.addEventListener(MouseEvent.CLICK, playVid2);
    function playVid2(e:MouseEvent):void{
    myVideoPlayer2.myFLV2.source = "video/T.flv";
    myVideoPlayer2.myFLV2.play();

    still cant get this any ideas?
    cant seem to get the buttons within the content movieclip to work.
    they are supposed to play a video when clicked.
    they do exhibit the rollover glow action, just not the down action of playing the movie.
    if i take them outside the scrollpane they work fine.

  • Help with setting variable within movieClip

    I am a relative begginer with ActionScript so please bare
    with me.
    I have a button within a movie clip. I have the following
    code assign to it:
    on (release) {
    _root.gotoAndPlay(1);
    startMovie = "intro";
    I have a conditional statement at root frame 1 that will load
    movieClip "intro" if startMovie = "intro"
    The script executes as is if startMovie is undeclared.
    I have tried declaring the value as _root.startMovie =
    "intro"; as well.
    I know I must be missing something simple here.
    Any help would be appreciated

    Thanks kglad.
    I did try _root.startMovie = "intro"
    Maybe I am missing something else. Here is the code for root
    timeline:
    I know this code works. I have tested it sending a query
    string.

  • Embed Button Within Movieclip--not finding button in script

    I want to now edit my movieclip to include another symbol (button) that will be recognized by script...I tried embedding..and adding the normal event listener however it doesn't see my button within the mc...what am i doing wrong...im sure it is something simple.
    My changes are in bold, and work as long as the button is not within the movieclip.  Any Ideas?
    ignore filename :/ i was making sure i didn't overwrite my original fla
    var xVel:Number = 0;
    stop()
    stage.addEventListener(Event.ENTER_FRAME,moveMC);
    tour_mc.addEventListener(Event.ENTER_FRAME,
    play_btn.addEventListener(MouseEvent.CLICK,forwardPlay);
    back_btn.addEventListener(MouseEvent.CLICK, backPlay);
    stop_btn.addEventListener(MouseEvent.CLICK,stopPlay);
    ff_btn.addEventListener(MouseEvent.CLICK,ffPlay);
    fr_btn.addEventListener(MouseEvent.CLICK,frPlay);
    kit2_btn.addEventListener(MouseEvent.CLICK,mvFrame);
    function moveMC(myEvent:Event):void {
         tour_mc.x += xVel;
         if(tour_mc.x <= stage.stageWidth-tour_mc.width){
             tour_mc.x = stage.stageWidth-tour_mc.width;
         if(tour_mc.x >= 0){
             tour_mc.x = 0;
    function forwardPlay(myEvent:MouseEvent):void {
         xVel = 2;
    function backPlay(myEvent:MouseEvent):void {
         xVel = -2
    function stopPlay(myEvent:MouseEvent):void {
         xVel = 0;
    function ffPlay(myEvent:MouseEvent):void {
         xVel=6;
    function frPlay(myEvent:MouseEvent):void {
        xVel=-6;
    function mvFrame(myEvent:MouseEvent):void{
         gotoAndStop(14);

    This is the answer...i figured it out not too long after i setup this question
    movieclipname.button.name.addEventListener(MouseEvent.CLICK,function);
    in my case it was :
    tour_mc.kit2_btn.addEventListener(MouseEvent.CLICK,mvFrame);

  • Controlling Variable Movieclips (within Variable Movieclips...)

    okay, so i have a really complicated question, but hopefully it's just complicated for me and not for you brainiacs out there. ;)
    on my main timeline there is a movieclip ("sampleMc") which contains a number of labeled frames containing movieclips of gallery images (for example "dyerBikiniMc"). in turn, each of THESE movieclips contain a number of frames of detail shots of the main image (for example "dyerBikini00Mc, dyerBikini01Mc, dyerBikini02Mc, etc.").
    on the main timeline i have a gallery navigation bar with thumbnail buttons determining which image will be displayed. there's also a right arrow shaped button "detailsBtn" that i'd like to allow the user to click frame-by-frame through the detail shots of the image. i also have a before/after toggle button on the main timeline that needs to control the movieclip one level below that, where the before/after images of that particular detail shot are stored!
    so the question is, how do i program a button to do something inside a movieclip, if the movieclip (and even its immediate parent and grandparent, for that matter) are variable?
    i hope that makes sense (it only barely does to me). i would be very grateful to get some suggestions on this!
    robin

    Yeah, I switched to the webforums too after getting to much garbage from 'rich' formatting and what not.
    Personally I would try to make updating a little as a hassle as possible. This sadly usually means doing more work to get the whole thing initially up and running. The updating and the imagesize (will the be zoomable?) you require all data to be external I suppose.
    I think I'd go for an XML file with a structure looking like:
    <samples>
        <!-- title & thumbnail for the toplevel menu -->
        <sample title="dyerBikiniMc" src="thumb_dyerBikiniMc.jpg">
            <!-- detail info, thumb, before and after -->
            <detail src="thumb_dyerBikiniMc001.jpg">
                <before src="dyerBikiniMc001B.jpg" />
                <after src="dyerBikiniMc001A.jpg" />
            </detail>       
            <!-- detail info, thumb, before and after -->
            <detail src="thumb_dyerBikiniMc002.jpg">
                <before src="dyerBikiniMc002B.jpg" />
                <after src="dyerBikiniMc002A.jpg" />
            </detail>
            <!-- etc. -->
        </sample>
    </samples>
    The main menu should filter out all the src attributes from the sample nodes and display those images.
    Once an item is shown, the submenu should filter all the src attributes from the detail nodes that belong to that particular sample.
    Once a detail is choosen, the before and after images would be loaded and shown. The last maybe just on top of each other with a button toggeling the visibility of the topmost.
    All objects below the top level menu displaying images should be made so that if they show new images, the old ones are removed/unloaded.
    It does require some code though but with the proper self defined classes it would not need to be really much.
    Alternative could be to make a self contained clip for each sample including all navigation and have the main menu load such a container as needed and unloading it when an other sample is requested.
    All loading, except for the xml loading, would be done with the Loader class.
    hth,
    Manno

  • Button functionality in a movieclip within another movieclip for another movieclip

    Ok so i have this looping thumbnails bar that goes like this:
    Scene1-imagebar-imagebarinside
    The buttons symbols are in the "imagebarinside" movieclip and i am using this code:
    ss1.addEventListener(MouseEvent.CLICK, play1);
    function play1(event:MouseEvent):void
    gotoAndStop("ssbox1");
    ...in this movieclip to play another labeled frame in another movieclip (Scene1-Bara)
    Problem is it wont work :-< if anyone has a better ideea i'll really apreciate it

    Hey!
    So, trying to understand the distribution of your MovieClips inside the flash file, this is what I understand:
    Scene1 contains a movieclip with the instance name "imagebar" and another movieclip with the instance name "bara".
    "imagebar" contains a movieclip with the instance name "imagebarinside". If that is the case (And the code being on the first frame of "imagebarinside"), I would use something like:
    function play1(event:MouseEvent):void
         Object(this.parent).parent.bara.gotoAndStop("ssbox1");
    Hope this works!

  • Scene jumping within movieclip

    I have a movieclip that I would like to play up to a point,
    then jump to another scene. I've tried:
    gotoAndPlay("scene", 1)
    but the movie clip ignores it and loops. Any advice?
    Thanks!

    NEVER use scene-named based script .. it is very buggy.
    Instead, put a frame label on the frame you want to go to,
    and use
    _root.gotoAndPlay("xyzzy") .. where xyzzy is replaced with
    whatever label
    you give that frame.
    Jeckyl

  • Drag function disabling button actions within movieclip

    I'm building an interactive map and i've run into a problem. The map is draggable and I have a start and stop drag function running as well as an onEnterFrame function which restricts how far you can drag the map. The map is displayed inside of a masked area. On the map is many locations which when rolled over should pop up a little dialogue box with contact info. My problem is that it only works when i've disabled the drag functions. When the drag functions are running the buttons inside the map movie clip all stop working. How can i get around this?
    Drag function:
    // Start Dragging sequence
    map_mc.onPress = function() {
        this.startDrag();
    // Stop Dragging sequence
    map_mc.onRelease = function() {
        this.stopDrag();
    onEnterFrame = function() {
    //Restricts player to stage
    if(mc_map._x <= -1400) {
      mc_map._x = -1400;
    //Restricts Bottom
    if(mc_map._y <= -400) {
      mc_map._y = -400;
    //Restricts Left
    if(mc_map._x >= 50) {
      mc_map._x = 50;
    //Restricts Top
    if(mc_map._y >= 50) {
      mc_map._y = 50;
    Sample button function:
    //Distributors
    santafespringsDI_btn.onRelease = function() {
    distributorLabels_mc.gotoAndStop(11);
    distributorLabels_mc._x = _root._xmouse + 10;
    distributorLabels_mc._y = _root._xmouse - 80;
    santafespringsDI_btn.onRollOver = function() {
    distributorLabels_mc.gotoAndStop(11);
    distributorLabels_mc._x = _root._xmouse + 10;
    distributorLabels_mc._y = _root._xmouse - 80;
    close_btn.onRelease = function() {
    distributorLabels_mc.gotoAndStop(1);

    I got it working, but i managed to break it again. I think this is why i was having difficulty with your suggestions earlier. I added a bit more to my code and broke it.
    I have a movie clip full of captions that i assign to each location. the button will make the movie clip jump to a certain frame revealing the appropriate caption for the appropriate location and then on rollout go back to the first frame of the movie clip to hide it again. Adding this functionality in stopped the dragging and I'm wondering why it did and how i get around it?
    The button code i added to activate the caption movie clip was this:
    btn.onRollOver = function() {
        captions_mc.gotoAndStop(11);
        captions_mc._x = _root._xmouse + 10;
        captions_mc._y = _root._xmouse - 80;
    btn.onRollOut = function() {
        captions_mc.gotoAndStop(1);

  • How to call child movieClip within childMovie clip  by others layer MovieClips.

    Object(root).my_movieclip2.my_movieclip3.my_movieclip24.gotoAndPlay(18);
    not working,,,

    Assuming you do get this to work the way you're asking, what happens when the structure of my_movieclip2 or my_movieclip3 changes? You're either going to have to search through and find every place that references them or you're going to wind up in a situation where you're scared to make any changes because of the sheer amount of work that's involved.
    A more robust approach is to do this:
    dispatchEvent('someEvent', true);//true says "bubble this up the display list"
    then in movieclip24, something like
    stage.addEventListener('someEvent', onSomeEvent);
    function someEvent(e:Event):void {
         gotoAndPlay(18);
    Note that in my own work I wouldn't do it this way, but you have to start somewhere in terms of understanding concepts.

  • Sound MovieClip in MovieClip (k)

    I have this ActionScript in a MovieClip (call it MovieClip2)
    within
    another MovieClip(call it MovieClip1):
    mySound = new Sound();
    mySound.attachSound("TYPEKEY.AIF");
    mySound.start();
    It won't play the sound while in MovieClip2, but if I put
    this in
    MovieClip1 it will play.
    Any ideas?
    I need to get this working tonight.
    -Kirk

    I was wrong. I thought I had tested it by making Btn1 a typo like "Bttn1" or something.  It's not seeing the instance Btn1 at all.  I get the same problem no matter what I put after ButtonsGroup.xxx.
    Can you reference a moviclip like that at all? Like:
    mc1.mc_Inside_mc1.gotoAndPlay("mcInsideFrame")
    I think I need to learn more about the "addChild" methods.  How do I incorporate that in my code?
    Edit:  Like what you said:
    "if Btn1 is created on mc's timeline and your on the timeline that contains mcs, you use:
    mc.Btn1 to reference Btn1."
    Only that isn't working for me.
    Edit Edit:
    Resolved.  I don't know what was causing it, but I broke apart the mc, and remade it.  Now it works fine.

  • Navigate movieclip to movieclip

    i need help to this seemingly simple, yet frustrating issue i am having with AS3.
    issue
    i have multiple movieclips on a timeline and i need the first one to load, play through all frames, than i need flash to move to the next movieclip in the timeline [load, play, than stop and wait for user input].
    -     i am completely new to AS3, i have used AS2 for years.
    -     i am moving all production in our studio to AS3 [so no AS2 comments or recommendations]
    -     i have been able to do this in AS2, but i understand that AS3 does not use roots, levels, etc.
    -     i have tried the gotoAndPlay(); [but i am not setting it up correctly to navigate to root timeline to find the frame name that the next movieclip resides in.  in otherwords i can not get flash to go back to the root timeline]
    -     is it better in AS3 to find the movieclip or the frame it resides in?
    please help

    i tried the following to no avail
    -     this.home_m.gotoAndPlay("home");            [this one reported no errors, but stopped at the end of the first movieclip and did not move to the next movieclip in the root timeline]
    -     home_m(this.root).gotoAndStop("home");     [this one moved along the root timeline to the end and then started over, did not completely load the fist movieclip or the second movieclip in the root timeline]
    home_m = 2nd movieclip instance name / home = the frame label in the root timeline where movieclip home_m resides.
    -     i placed the actionscript in the actionscript layer in the first movie, in the last frame.
    -     i have a stop(); in the root timeline below each movie clip.  [usually i have the movieclips in the root timeline in 2 frames, so flash can enter the first frame, play the move and i have the stop(); in the second frame, in the actionscript layer]

  • Movieclip to movieclip communication

    I'm pulling my hair out over something that is probably
    really simple, but I can't find the answer anywhere.
    I have a movie clip with a button in it that I want to use to
    navigate to another movie clip (residing on only the 1st frame of
    the maintimeline) and to stop play at a certain frame of that 2nd
    movie clip. I could get the button to work in AS2 with the
    following code:
    on(Press) {
    _root.gotoAndStop(1);
    _root.sample_mc.gotoAndStop(35);
    I've figured out that I have to write a function to determine
    what the button should do in AS3, but I just can't figure out how
    to write the dot syntax to navigate to the correct frame in the
    second movieclip. Replacing _root.gotoAndStop(1) with
    MovieClip(root).gotoAndStop(1), I manage to navigate to the
    sample_mc movie clip, but it keeps playing. If anyone can help a
    relative newby, in easy-to-understand terms, with getting the
    second movie clip to stop at the correct frame, I'd really
    appreciate it. Thanks.

    Thanks very much for coming back to try and help me; I
    greatly appreciate it.
    I've done all that you've said with the instance name, the
    addEventListener and the function, but I'm still having problems
    with navigating to the second movie clip. The 6 lines of code I've
    written are as follows:
    function gostop(event:MouseEvent):void
    MovieClip(root).gotoAndStop(1);
    MovieClip(root.sample_mc).gotoAndStop(35);
    goto_btn.addEventListener(MouseEvent.CLICK, gostop);
    If I omit line 4 [MovieClip(root.sample_mc).gotoAndStop(35);]
    then the movie navigates to frame 1 of the maintimeline and plays
    the sample_mc movie clip. So far, so good.
    But I want the movie to stop at frame 35 of the sample_mc.
    When I add line 4, I get error messages. I just don't know how to
    get the button in the first MC to control the playback of the 2nd
    MC.
    Besides
    MovieClip(root.sample_mc).gotoAndStop(35);
    I've tried
    MovieClip(this.parent.sample_mc).gotoAndStop(35);
    and
    root.sample_mc.gotoAndStop(35);
    and
    MovieClip(this.sample_mc)gotoAndStop(35);
    and
    this.parent.sample_mc.gotoAndStop(35);
    but none of these variations work. It's probaby really
    simple, and really basic, but none of the (expensive) books I've
    bought, or the online manuals, or even the built-in
    &quot;Insert a target path&quot; hinting can give me the
    proper syntax. I'd greatly appreciate help with this. Thanks again
    for trying.

  • MovieClip in MovieClip in MovieClip in ....

    Hello!
    We have two main MovieClips, loaded from library.
    var BigCircle:MovieClip = new BigCircle();
    BigCircle.name = "BigCircle";
    addChild(BigCircle);
    var BigSquare:MovieClip = new BigSquare();
    BigSquare.name = "BigSquare";
    addChild(BigSquare);
    When added, BigCircle has child with name SmallCircle, which itself has child SmallerCircle, which itself has child TinyCircle.
    When added, BigSquare using ENTER_FRAME wants to get TinyCircle, for example its x.
    BigSquare don't wanna see any vars, it wants a link!
    In AS2 it was very easy:
    trace(this._parent.BigCircle.SmallCircle.SmallerCircle.TinyCircle._x);
    or
    trace(_root.BigCircle.SmallCircle.SmallerCircle.TinyCircle._x);
    AS3 has getChildByName. Let's try it:
    trace(stage.getChildByName("BigCircle").getChildByName("SmallCircle").getChildByName("Smal lerCircle").getChildByName("TinyCircle").x); //ERROR 1061, even if use only two get...
    or
    trace(stage["BigCircle"]["SmallCircle"]["SmallerCircle"]["TinyCircle"]); //ERROR, even if use only two [ ], or dots between them
    or combine
    trace(stage.getChildByName("BigCircle").["SmallCircle"]); //AND WHAT NEXT?
    TASK:
    Give BigSquare a link to TinyCircle.
    PLEASE HELP!

    So:
    package
              import flash.*;
              import flash.display.*;
              import flash.events.*;
              public class Whatever extends MovieClip
                        public function Whatever()
                                  var bC:MovieClip = new BigCircle();
                                  bC.name = "bigCircle";
                                  addChild(bC);
                                  var sC:MovieClip = new BigCircle();
                                  sC.x = sC.y = 100;
                                  sC.name = "smallCircle";
                                  bC.addChild(sC);
                                  bC.sC = sC;
                                  var tC:MovieClip = new BigCircle();
                                  tC.x = tC.y = 100;
                                  tC.name = "tinyCircle";
                                  sC.addChild(tC);
                                  sC.tC = tC;
                                  addChild(new Wtf());
    package
              import flash.*;
              import flash.display.*;
              import flash.events.*;
              public class Wtf extends MovieClip
                        public function Wtf()
                                  var bS:MovieClip = new BigSquare();
                                  bS.name = "bigSquare";
                                  addChild(bS);
                                  bS.addEventListener(Event.ENTER_FRAME, bS_ef);
                        function bS_ef(e:Event):void
                                  var bC = MovieClip(root).getChildByName("bigCircle");
                                  trace(bC.sC.tC.x); // WORKS!!!
    Last question, I suppose, : How can I turn this:
      var bC = MovieClip(root).getChildByName("bigCircle");
      trace(bC.sC.tC.x);
    to ONE line, may be not using new var?
    trace(MovieClip(root).getChildByName("bigCircle").sC.tC.x);  //Is not working, flash does not find property 'sC'

Maybe you are looking for

  • ITunes V12.1.2.27 on Windows 8 does not detect iPhone 6 with IOS v8.3

    Hello there, It all began when I installed the latest IOS 8.3 and iTunes V12.1.2.27. iTunes simply does not detect my iPhone 6 any longer, but it does detect my old iPod mini. Everything used to be working just fine until the software update was done

  • Need The Doc of Sales Order Interface

    Hi, I would like to import the Sales order Through Sales Order Interface. I need the Proper Metalink document ID who guides me to detail process of import sales order interface tables and complete scnerio. Please tell me the Doc ID of Sales order Ope

  • Recovery Window

    Am I correct in assuming that if I configure "recovery windows" like this... CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS; ...that RMAN will keep/store all the datafiles required to restore my database to 7 days ON DISK? Which means that I

  • Left headphone audio output is slow as compared to right ear phone

    I have Macbook Pro and since last few days left headphone audio output has became very slow as compared to right headphone audio output. I have tried multiple headphones but no luck so its problem with audio jack I think. Did anyone experience same p

  • Premiere Elements 10 screen redraw problem

    Been using PE 9 for a while and works fine. But, the PE 10 trial seems to be buggy. When I place something on the timeline, then try to move it, the program redraws the top half of the screen into the timeline, and you can no longer see the timeline.