A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: garr! parent issue in as3!

  1. #1
    Senior Member
    Join Date
    May 2002
    Posts
    359

    garr! parent issue in as3!

    hi guys!

    i know this has been covered a million times but im running into troubles repositioning a movie clip in as3

    i have an mc that has this code on the timeline at frame 50:

    Code:
    var xpos:Number = Math.random() * 500;
    
    trace (xpos);
    
    var mymc:MovieClip = MovieClip(parent); 
    mymc.x = xpos;
    my movieclip is called star1

    how do i get this working!!? its driving me nuts!!
    Last edited by flashX; 01-18-2011 at 02:59 AM.
    FlashX

    ________________________
    The mind lies, it only hears what it wants to hear.

  2. #2
    FK Romeo martiansam's Avatar
    Join Date
    Oct 2001
    Location
    Bombay, India
    Posts
    223
    Try

    Code:
    var xpos:Number = Math.random() * 500;
    
    trace (xpos);
    
    var mymc:MovieClip = this.parent as MovieClip
    mymc.x = xpos;
    sameer rao

    there...you see!!

  3. #3
    Senior Member
    Join Date
    May 2002
    Posts
    359
    oh you rock! thank you that worked!!
    FlashX

    ________________________
    The mind lies, it only hears what it wants to hear.

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