Skip navigation
Currently Being Moderated

dynamicMovieClip into a SP

May 23, 2012 4:42 AM

I've got a movieClip on stage. (StudentsAttendance_mc) This clip keeps on updating untill frame 10, then in frame 11 I need this movieclip to be seen inside a scrollPane. How do I do this?

 

I tried creating a empty movieclip (temp_mc) with a linkageID and then used duplicateMovieClip inside temp_mc to see if I can create a duplicate of it and send it to the ScrollPane using contentPath - but no success

 
Replies
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 7:40 AM   in reply to Ron Colmen

    you can't reparent objects in as2 so you'll either need to use as3 or fake it (eg, add a copy of your movieclip to your scrollpane)

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 8:30 AM   in reply to Ron Colmen

    assign your on-stage movieclip a linkage id.

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 9:55 AM   in reply to Ron Colmen

    correct.

     

    they are not the same instance.  ie, your on-stage movieclip is not the same as the one added to your sp. 

     

    you'll need to update the sp's instance (using the sp.content property) and you'll need to remove your on-stage instance when you want to make it appear as if you're reparenting the on-stage movieclip.

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 10:25 AM   in reply to Ron Colmen

    on frame 11 of StudentsAttendance_mc, you should have:

     

    _parent.addToSP();

    this.swapDepths(this._parent.getNextHighestDepth());

    this.removeMovieClip();

     

    then on the parent timeline you should have

     

    function addToSP():Void{

    sp.contentPath="studentattendancelinkageid";

    sp.content.gotoAndStop(11);

    }

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 11:16 AM   in reply to Ron Colmen

    use the trace() function to make sure the frame 11 is playing and addToSP() is being called.

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 11:53 AM   in reply to Ron Colmen

    use:

     

    trace ("noProblem!!"); // not showing this

    _parent.addToSP();

    this.swapDepths(this._parent.getNextHighestDepth());

    this.removeMovieClip();

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 3:06 PM   in reply to Ron Colmen

    then that frame is not being played.

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 23, 2012 10:37 PM   in reply to Ron Colmen

    use the trace() function to confirm frame 11 is executing and, if it is, to also confirm addToSP() is executing.

     
    |
    Mark as:
  • kglad
    72,328 posts
    Jul 21, 2002
    Currently Being Moderated
    May 24, 2012 4:54 PM   in reply to Ron Colmen

    use the trace function to debug:

     

     

    trace(this._parent.getNextHighestDepth());  // if that's undefined, you're not publishing for fp less than 8.  either change or manually control depths.

    _parent.addToSP();

    this.swapDepths(this._parent.getNextHighestDepth());

    this.removeMovieClip();

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points