A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: AS2 - Get the position of a movie clip, on a particular frame of a MC

  1. #1
    Senior Member ExpertAnimators's Avatar
    Join Date
    Sep 2005
    Location
    On top of a mosh pit
    Posts
    131

    AS2 - Get the position of a movie clip, on a particular frame of a MC

    I am trying to get the position of a movie clip called "Shooter", returned to a variable called spitballYpos.

    The movie clip is sitting on frame 6 (labelled "Shooting") of a movie clip called PDFstanding.

    The position returns perfectly if I place the .shooter MC on the first frame of PDFstanding, but on frame 6 the variable result just returns "undefined".

    What have I missed? If I need to reference the particular frame the 'shooter' movie clip is on, then what is the correct syntax?

    Here's my code...

    Actionscript Code:
    spitballYpos = _root.PDFstanding.shooter._y;

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    you cannot talk to or hear a movieclip that is not there. that's for the logical explanation.

    If your clip is on frame #6 of the PDFstanding instance, that's where the tracking code should also be. OR, better since it allows you to centralize your code on the main timeline, have that clip on frame 1 of PDFstanding, where it works, and set it's _alpha to 0. Set its alpha back to 100 on frame #6.

    gparis

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center