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?

Similar Messages

  • Get Frame number of pre-composition

    Hello.  I want to get frame number of pre compositions.
    For example there is "composition A" and it has "pre compositon A".
    When I play composition A, pre composition A also starts playing, but pre composition A start's at frame no 3.
    It means if composition A is on frame 1, pre composition A is on frame 3.
    I want to get this frame number of pre composition A. What should I do?
    In Action script 3 I can easily get frame number of layer's like "mcA.currentFrame "
    I want to do something like this in AE. like "thisComp.mcA,currentFrame" .

    If I understand what you're doing, and both comps have the same frame rate, this might do it:
    timeToFrames(time - thisComp.layer("precomp A").startTime)
    Dan

  • Get number of character within a String by number of pixels

    How can i get the number of character within a String
    by a width value...
    for example..
    i have a String = "1234567890abcdefghi.........."
    and when i give the width "10"
    i will get the String "12".
    or the number of charcter..
    or somthingggggggggggggggg
    please help..
    Shay

    i solved this...
    by doing somthing similar..
    i made a for loop on all character
    and evrey time i am get a sub string from the 0 till the loop index..
    and i am chashing the last string
    so when a sub width is greater the the requested width
    i am returning the lst cashed result
    thanks.. all..

  • How do you run loop functions on specific frames of nested Movieclips?

    I'm still pretty new to AS3 and I've run into a problem that I never had with AS2.  I have a project where the 1st frame of the main timeline is the loading screen and the second frame has buttons and a title bar that I want to be on every "page" of my project.  There are 7 buttons that take the user between 7 different "pages", which consist of 7 frames of a movieclip I have filling the content area on frame 2 of my main timeline.  I'll call this movieclip "pages_mc".
    The problem is that frame 6 of the pages_mc movieclip has the following code:
    var moving = 0;
    var xmoved;
    var xbegin = pano_cont.pano_image.x;
    parts_mc.addEventListener(Event.ENTER_FRAME, moveImage); // constantly moves the image 1 pixel left or right depending on the button pressed
    btn_left.addEventListener(MouseEvent.MOUSE_DOWN, moveLeft); //changes the variable "moving" to 2 on mouse down
    btn_right.addEventListener(MouseEvent.MOUSE_DOWN, moveRight); //changes the variable "moving" to 1 on mouse down
    btn_left.addEventListener(MouseEvent.MOUSE_UP, stopMoveLeft); //changes the variable "moving" to 0 on mouse up
    btn_right.addEventListener(MouseEvent.MOUSE_UP, stopMoveRight); //changes the variable "moving" to 0 on mouse up
    function moveImage(e.Event):void{
    xmoved = xbegin - pano_cont.pano_image.x;
        if(moving == 1)
            pano_cont.pano_image.x -= 1;
        if(moving == 2)
            pano_cont.pano_image.x += 1;
        if(xmoved < -(pano_cont.pano_image.width/2)+180)
            pano_cont.pano_image.x = -2538;
        if(xmoved > (pano_cont.pano_image.width/2)- 180)
            pano_cont.pano_image.x = -2178;
    function moveRight (e:MouseEvent):void
        btn_right.gotoAndStop("down");
        moving = 1;
    function moveLeft (e:MouseEvent):void
        btn_left.gotoAndStop("down");
        moving = 2;
    function stopMoveLeft (e:MouseEvent):void
        moving = 0;
        btn_left.gotoAndStop("active");
    function stopMoveRight (e:MouseEvent):void
        moving = 0;
        btn_right.gotoAndStop("active");
    This is all just some code to allow users to move a panaromic image around on the screen.  But when I navigate to a different page from of my pages_mc movieclip I get the following output message:
    TypeError: Error #1099: Cannot access a property or method of a null object reference.
         at SampleProject_fla::Content_MC_1/moveImage()
    I'm thinking this is happening because the "parts_mc" movieclip I referenced for the ENTER_FRAME event listener no longer exists (unless you go back to frame 6 of pages_mc).  I'm not sure how to remove this event listener when the user moves to another frame of pages_mc.
    Any help would be greatly appreciated.

    kglad wrote:
    what's parts_mc.parts_mc???
    Not sure where you see that.  I see pages_mc.parts_mc which is just because the parts_mc movieclip is nested on the 6th frame of the pages_mc movieclip.
    At any rate, I was able to get it working by moving all the code onto frame 2 of the main timline and declaring all of my vairables on frame 1 of the main timeline.  I then added an ENTER_FRAME event listener onto one of my movieclip buttons (main_btn) on the main timeline and had it check what frame the pages_mc movieclip was on.  If it was frame 6, I then executed the moveImage function and had it remove the event listener from the main_btn movieclip if the frame changed away from frame 6.
    Seems to be working so far.
    Here's the code:
    Frame 1
    /* Declaring variables. */
    var pagenumber:Number;
    var moving:Number = 0;
    var firstTime:Number = 0;
    var xmoved:Number;
    var xbegin:Number;
    Frame 2
    pages_mc.addEventListener(Event.ENTER_FRAME, pageNum);
    pages_mc.addEventListener(Event.ENTER_FRAME, BtnSelParts);
    /* Keeps track of current page. */
    function pageNum(e:Event):void
        pagenumber = pages_mc.currentFrame;
        title_bar.gotoAndStop(pages_mc.currentFrame);
    function BtnSelParts(e:Event):void
        if(pagenumber == 6)
            btn_parts.gotoAndStop("current");
            if(firstTime == 0)
                btn_main.addEventListener(Event.ENTER_FRAME, moveImage); //moves the panorama image left or right
        else
            if(btn_parts.currentFrame == 32)
                btn_parts.gotoAndStop(1);
    function moveImage(e:Event):void
        if(pagenumber==6)
            if(firstTime == 0)
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_OVER, overLeft); //animates left arrow button on rollover
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_OVER, overRight); //animates right arrow button on rollover
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_DOWN, moveLeft); //changes the variable "moving" to 2 on mouse down
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_DOWN, moveRight); //changes the variable "moving" to 1 on mouse down
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_UP, stopMoveLeft); //changes the variable "moving" to 0 on mouse up
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_UP, stopMoveRight); //changes the variable "moving" to 0 on mouse up
                pages_mc.btn_left.addEventListener(MouseEvent.MOUSE_OUT, rollOutLeft); //animates left arrow button on rollout
                pages_mc.btn_right.addEventListener(MouseEvent.MOUSE_OUT, rollOutRight); //animates right arrow button on rollout
                xbegin = pages_mc.parts_mc.pano_image.x;
                firstTime = 1;
            xmoved = xbegin - pages_mc.parts_mc.pano_image.x;
            if(moving == 1)
                pages_mc.parts_mc.pano_image.x -= 1;
            if(moving == 2)
                pages_mc.parts_mc.pano_image.x += 1;
            if(xmoved < -(pages_mc.parts_mc.pano_image.width/2)+180)
                pages_mc.parts_mc.pano_image.x = -2538;
            if(xmoved > (pages_mc.parts_mc.pano_image.width/2)- 180)
                pages_mc.parts_mc.pano_image.x = -2178;
            if(pages_mc.parts_mc.pano_image.pano1.currentFrame == 1)
                pages_mc.btn_sel.gotoAndStop(1);
            if(pages_mc.parts_mc.pano_image.pano1.currentFrame == 2)
                pages_mc.btn_sel.gotoAndStop(2);
            if(pages_mc.parts_mc.pano_image.pano1.currentFrame == 3)
                pages_mc.btn_sel.gotoAndStop(3);
        else
            btn_main.removeEventListener(Event.ENTER_FRAME, moveImage);
            firstTime = 0;
    } // controlls the panaromas
    Let me know if you see any problems with this.
    Thanks again.

  • How to get the frame number of a label in a different scene.

    I am completely stumped on this.
    I have my project setup as the gameplay in one scene, and another scene for the outcome.
    The outcome scene, say called, GameDone, has 2 frames. The first frame for win, labeled it WON, the second frame for lost, labeled LOST.
    I could do the very simple thing and just gotoAndStop("GameDone", 1); but thats a bad practice, I believe.
    Ive gone through google and found the closest thing needing a MovieClip. I could not figure out what to give it? A random MovieClip? a new one? one from the next scene? one from the current scene?
    import flash.display.Scene; 
    for (var i:uint = 0; i < mc1.scenes.length; i++) {
         var scene:Scene = mc1.scenes[i];
         trace("scene " + scene.name + ": " + scene.numFrames + " frames");
    That was an adobe sample.
    So how could I, in the gameplay scene, the frame number for either WON or LOST in the "GameDone" scene?
    Thanks.

    Try doing the simple thing that you think is a bad practice.  I don't know why you think it is.  The only problem with it is that you appear to have it backwards for AS3... in AS3 it is gotoAndStop(frame,scene);
    Why don't you use the frame labels instead of frame numbers?  gotoAndStop("Won", "GameDone");

  • Target a frame in a movieClip

    I have buttons in a movie clip which are placed on the main
    time line. I also have movieclips placed on single frames (25, 30,
    35, etc) on the main time. When a button is released I want two
    things to happen -
    - the playhead to go to a frame on the main time line where
    the movie clip is placed - which I can do with this code -
    on (release) {
    this._parent.gotoAndStop("25");
    - then I'd like it to target a certain frame inside the
    movieClip with a var number (var number already generated). This is
    where I'm stuck. What is the path I use to target the frame inside
    the movie clip???
    Thanks for any help,
    Dave

    It's still not working....
    I named my movieClip (classifieds_mc) and my Var (collapse -
    which is a Number). I attached this code to the button (note:
    button inside movieClip than placed on main time line) -
    on (release) {
    //Movieclip GotoAndPlay Behavior
    this._parent.classifieds_mc.gotoAndStop("collapse");
    //End Behavior
    Nothing hapens when the button is releases. If I just target
    the frame on the main time line with this code it works
    on (release) {
    this._parent.gotoAndStop("25");
    But I'd like to also target a a frame inside the movieClip
    with a var Number.
    Any help on what I'm doing wrong???..??
    Thanks,
    Dave

  • Large number of movieclip slowdown the application

    Hi,
    I have a scrollbar function.In the content area i attached movieclips.Those moviclips have dynamic textfield.The scroll bar working for small list of contents.up to 500 or 600 moviclips
    When i attached 2000 or larger number of movieclip the Entire flash get slows. How to i fasten them with same number of movieclip.
    why flash player slow when attaching large number of movieclip? it takes near by 58% cpu usage at this time.What is the reason for this?
    Thanks,
    Siva

    imm also if you put much media inside the flash library (Audio,images, videos) those will be uploaded on Ram,,,
    so instead you can export your library as external library
    or
    use AS3 loader to load your media, immutablility will be fine here!! ^_^
    Goodluck

  • Frame action between MovieClips

    Hello Everyone,
    I have a little problem with actionscript/behaviors. What I
    want to do is create a frame action or behavior that takes you from
    one frame in a MovieClip to a label in the scene 1 timeline.
    Any Ideas?
    Thanks,
    Todd

    I tried that but I can only get it to work if the action is
    in the same timeline. I'm trying to go from a frame in a
    movieclip's timeline to a frame in the scene 1 timeline, separate
    timelines.
    Can I do this using frame action of gotoandplay?

  • How to get the number of rows in a repeating frame ?

    Hi all,
    When I launch a report from forms then sometimes there are data in the report and sometimes there are no data. And the problem is that when there are no data then the frame containing the repeating frame is still displaying and a blank page displays on the report.
    So I want to get the number of rows from the repeating frame so that I can code a format trigger on the frame to display or not the enclosing frame depending on the existence of data from the repeating frame.
    Thank you very much indeed.

    Dear Friend,
    You can achieve this. Define a summary column (say cnt). Select summary type as "COUNT". select any one of columns that are getting displayed in your repeating frame as summary column and provide "reset at" group name (or set this to report if you are defining this field at report level) . This "cnt" variable will contain how many records that will be fetched for your repeating frame (i.e. Group of Repeating frame). You can use this "CNT" variable in your format trigger.
    In this case there is no need to write before report trigger or anything.
    Regards,
    Manish Trivedi

  • How to get the footage's current frame number in expression?

    There are 2 layers.One is text layer,one is sequence layer.
    Footage has begun from the 20th frame.
    Therefore, the number of composition's current frame number and footage's frame number has shifted.
    I want to show footage's frame number in text layer . not composition's frame number.
    How to get the footage's current frame number in expression?
    Tatsuya

    >Footage has begun from the 20th frame.
    Do you mean that the footage layer has been trimmed (so that the start of the footage lines up with the start of the comp, but the first 19 frames are not visible), or moved to the left (so that frame 20 lines up with the comp's frame 0), or that the sequence actually begins with the 20th frame (at frame 0 of the comp), or something else?
    Are the frame rates of the comp and the footage the same?
    Dan

  • Goto next frame in a movieclip from main timeline button

    So what I have is a button (named Next) on the main timeline. I have a movie clip on that frame (on the main timeline) and the movie clip has 3 frames that I want to be able to cycle through using the "Next" button that is on the main timeline. How can I go about doing this?
    Thank you,

    Thanks kglad! Works like a charm. :-)
    I had already named the instance of the movieclip and button so I just needed to change the code to match and it's working great.
    One other issue I've come up with now is that when it goes to the 3rd frame of the movieclip and I click next, it doesn't do anything. shouldn't it go back to frame 1 of the movieclip?

  • Change Stage Frame From Inside MovieClip?

    How Do I Change Stage Frame From Inside MovieClip?
    Heres my code so far:
    hh.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
    function fl_MouseClickHandler(event:MouseEvent):void
        gotoAndStop(2);
    i tried (root).gotoAndStop(2); but i got an error , #1061 ..
    Thanks in Advance...
    ASAP would be nice..

    well your a smart *** now arnt you   Haha..
    I missed 1 painful word in that line of code thanks heeps..

  • Get week number for day from a list of days within a year..

    I am beginning in ORACLE / SQL and wondering how I can use this query to work with a column of Dates that span over a number of years?
    Ideally, I would like to use this script to add a number for the week of the year based on this.
    Then when a new year begins to start over..
    I am referencing an old thread..
    TO_CHAR with dates to get week number issue
    Here is what I have so far:
    I keep getting an error stating "Bind Variable "p_date_beg" is NOT DECLARED"..
    Thanks in advance for any help you can provide.
    DECLARE
    p_date_beg DATE;
    BEGIN
    SELECT RETRIEVAL_DATE
    INTO P_DATE_BEG
    FROM OBS_SELECT_LST12_SPG;
    WITH TAB AS
    (SELECT TO_DATE(TO_CHAR(:p_date_beg,'YYYYMM')||'01','YYYYMMDD') + LEVEL -1 DATE_COL
    FROM DUAL
    CONNECT BY LEVEL <=TO_NUMBER(TO_CHAR(LAST_DAY(:p_date_beg),'DD')))
    SELECT DATE_COL, TO_CHAR(DATE_COL, 'FMDAY') DAY,
    (CASE
    WHEN TO_CHAR(TRUNC(DATE_COL, 'mm'),'FMDAY') = 'SUNDAY'
    THEN TO_NUMBER(TO_CHAR(DATE_COL,'W'))
    ELSE CEIL((TO_CHAR(SYSDATE, 'dd') + 1 - TO_CHAR(NEXT_DAY(TRUNC(SYSDATE, 'mm'), 'SUNDAY'), 'dd'))/7)
    END) WEEK_NOB
    END;

    hi, referring to this link about ISO week, http://www.epochconverter.com/date-and-time/weeknumbers-by-year.php, here is the code:
    /* Formatted on 2012/06/13 06:32 (Formatter Plus v4.8.8) */
    WITH t AS
         (SELECT     MIN (TO_DATE ('20120101', 'rrrrmmdd') + LEVEL - 1)
                                                                       start_date,
                     1 week_th
                FROM DUAL
               WHERE TO_CHAR (  TRUNC (TO_DATE ('20120101', 'rrrrmmdd'), 'mm')
                              + LEVEL
                              - 1,
                              'FMDAY'
                             ) = 'MONDAY'
                 AND (   TO_DATE ('20120101', 'rrrrmmdd') + LEVEL - 1 <
                            TRUNC (NEXT_DAY (TO_DATE ('20120101', 'rrrrmmdd'),
                                             'THU'
                      OR (TO_DATE ('20120101', 'rrrrmmdd') + LEVEL - 1
                             BETWEEN TRUNC (NEXT_DAY (TO_DATE ('20120101',
                                                               'rrrrmmdd'
                                                      'THU'
                                 AND   TRUNC (NEXT_DAY (TO_DATE ('20120101',
                                                                 'rrrrmmdd'
                                                        'THU'
                                     + 7
          CONNECT BY LEVEL < 15),
         v AS
         (SELECT     t.start_date + 7 * (LEVEL - 1) start_date,
                     t.week_th + LEVEL - 1 week_th
                FROM t
          CONNECT BY LEVEL < 53),
         u AS
         (SELECT '20120501' dt
            FROM DUAL
          UNION ALL
          SELECT '20120502'
            FROM DUAL
          UNION ALL
          SELECT '20120503'
            FROM DUAL
          UNION ALL
          SELECT '20120504'
            FROM DUAL
          UNION ALL
          SELECT '20120505'
            FROM DUAL
          UNION ALL
          SELECT '20120506'
            FROM DUAL
          UNION ALL
          SELECT '20120507'
            FROM DUAL
          UNION ALL
          SELECT '20120508'
            FROM DUAL
          UNION ALL
          SELECT '20120509'
            FROM DUAL)
    SELECT *
      FROM u, v
    WHERE TO_DATE (u.dt, 'rrrrmmdd') BETWEEN v.start_date AND (v.start_date + 6);output:
    DT     START_DATE     WEEK_TH
    20120501     30/04/2012     18
    20120502     30/04/2012     18
    20120503     30/04/2012     18
    20120504     30/04/2012     18
    20120505     30/04/2012     18
    20120506     30/04/2012     18
    20120507     07/05/2012     19
    20120508     07/05/2012     19
    20120509     07/05/2012     19

  • Find the frame number of a label?

    Is it possible to find out the first frame of a label without going there then put it in a variable in AS2 or AS3?
    Thanks for the help,

    I actually had the same question. I've worked out a way of doing it in AS3.
    So first you can get all the frame labels on the MovieClip in question by using the currentLabels property (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/MovieClip.html). Then going through the array you can find your label as a FrameLabel object which has a frame property that will tell you the frame number (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/FrameLabel.html).
    Hope that helps

  • Varying number of columns within same text box

    I am reposting this here as suggested. This has been submitted to the feature request. If you are also interested in this feature, please also submit it there.
    here is original posting with replies:
    http://www.adobeforums.com/webx?224@@[email protected]
    One feature still missing (correct me if I am wrong) is to have number of columns applied to paragraphs not text boxes.
    This is a constant hassal having to interupt the text box with a new text box and then another one after that just because you want a paragraph to be in muliple columns to save space for instance, or using some other work around like inline text boxes.
    This is useful when trying to save space on a page, if you have short bullets, such as a list of items which if just left in a single column would leave a lot of white space to the right side of the column. Use this paragraph as an example. Pretend this is the lead in paragraph referring to the followng list. Include these items in your recycling:
    -plastic bottles
    -paper cups
    -styrofoam
    -tires
    -fruit
    -vegetables
    -glass jars
    -batteries
    -cans
    -drink boxes
    -bones
    -dairy products
    -pet hair
    -newspapers
    -magazines
    As you can see the list can get very long, and so breaking the list across a number of columns would really save space, as the bullets are just single words.
    I have this situation everyday in the work I do and it is a real pain to have to redraw a new text box for each instance, and then another one to follow it.
    And of course there is the whole headings that span multiple columns issue too.
    I could forsee a feature where you would simply select the number of paragraphs and then change the number of columns. If it went to another page, then the number of comumns would still be applied as it is applied now to a text box.

    Thanks for your suggestions, Eugene. That's what users helping users is all
    about!
    However, we build the document (a book with hundreds of pages)
    automatically, importing and autoflowing tagged text. Manual intervention
    doesn't meet the need.
    It's silly that a title or introduction should have to be in a different
    frame from the rest of the text, just because the title/intro is
    single-column and the text is multi-column. Ventura Publisher supported
    paragraphs spanning columns 20 years ago. Adobe, get with the times!
    Darrel Eppler
    Global Publishing Services
    SIL International
                                                                                    Eugene Tyson                                             
                 <[email protected]                                        
                 >                                                          To
                                           DARREL EPPLER                  
                 05/21/2009 03:18          <[email protected]>        
                 AM                                                         cc
                                                                                    Subject
                 Please respond to         varying
                 clearspace-118700         number of columns within same text
                 4112-1NVP-2-8iM2@         box                            
                 mail.forums.adobe                                        
                       .com                                                                               
    If you need to make it go from 1 column into multiple columns in a layout
    then it stands to reason that you also need the content to remain in the
    multiple columns.
    There are various ways to do this.
    1. Using Tables: You can have as many columns and rows as you like. The con
    about this is that tables cannot break over pages, so you have to manually
    split the cell so that the content fits.
    2. Use Tabs: This can be awkward if your text is already in a list format,
    it involves cut and paste and isn't "that" easy to implement. If the text
    is already in a layout format that suits then putting in tabs would work
    fine. The advantage is that this can break easily over pages/columns etc.
    It's flexible to adjust the spacing etc. But it can be awkward to setup,
    especially if there is a long list that needs to be in 2 or columns...
    so then you have this option:
    3. Use an anchored text frame: If you cut the content from your text frame
    and paste it into a new text frame: Then anchor the new text frame into the
    layout. You can specify the amount of columns in the anchored text frame.
    The frame will move with the text, but just like tables, they won't split
    over pages.
    I've used all 3 on many occasions depending on what scenario came up -
    different layouts need different workarounds.
    But they shouldn't be work arounds, it should be just select this text and
    put it into x amount of columns, and it should all flow without having to
    do much else.

Maybe you are looking for

  • How to implement AZAX call for a input field in webdynpro java.

    Hello everyone, I want to make a AZAX call , when I click on the input field.Anybody has already implemented this earlier, plz let me know how to do this. Thanks, Srikanta

  • Playback in viewer and canvass broken since QT update

    I have a Macbook (OS10.5.8) 4 GB RAM, running FCP 7.0.3 that I use to capture video when I'm on a dive trip. I am working with HDV 1080 captured from a Sony DC9 camera.  Everything worked fine until I updated QT to 7.6.9.  Now playback in the canvass

  • How to manually uninstall j2re ?

    hi all, i have problems with j2re 1.4.0 installation and i would really appreciate any help. here's my problem : i first installed j2re 1.4.0_02 and then j2re 1.4.1, without uninstalling the first version. so, i had two plug-ins running on my pc. i d

  • HT201514 "sparsebundle is already in use"

    My Time Machine has failed on one computer. 3 currently backup to the same Time Capsule. The error I get is "sparsebundle" is already in use. The backup then fails. I get this message with each scheduled backup

  • Imagebrowser tagging

    ImageBrowser EX is not finding some Tags. I have tagged about 20 pictures with my fist name, and last name. These were separate tags. It finds my pictures if I search for my last name, but not with my first name (Larry). I tested other tags and some