A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: (Flash 8) Drag and Drop Targets/Main timeline

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    2

    (Flash 8) Drag and Drop Targets/Main timeline

    In all of the drag and drop tutorials I've looked at, when you drag the object to the target, It goes to a keyframe within the target's timeline. Instead, how would I make the playhead switch to a different keyframe in the main timeline? This is the code I am working with (Inserted into the drag-able object):

    on (press) {
    startDrag (this, true);
    }
    on (release) {
    stopDrag ();
    if (this._droptarget == "/target") {
    _root.target.gotoAndStop(2);
    }
    }

    The '_root.target.gotoAndStop(2);' part makes it go to frame 2 inside "target" (which is a movie clip), but i'd like it to go to frame two in the main timeline. How would I edit the script to make this happen? Ahaha... the board description said nothing is a stupid question. I hope that holds true. Thanks for any help! (By the way I'm working on a simple flash game, but i'm pretty inexperienced with actionscript)

  2. #2
    Senior Member ilive's Avatar
    Join Date
    Aug 2006
    Location
    Philippines
    Posts
    195
    hi annelili, can you post the .fla?

  3. #3
    Senior Member EQFlash's Avatar
    Join Date
    Jun 2002
    Location
    where i'm at
    Posts
    2,735
    try removing the word .target from the _root.target.gotoAndStop(2)
    i.e
    PHP Code:
    _root.gotoAndStop(2

  4. #4
    Junior Member
    Join Date
    May 2008
    Posts
    2
    Quote Originally Posted by EQFlash
    try removing the word .target from the _root.target.gotoAndStop(2)
    i.e
    PHP Code:
    _root.gotoAndStop(2
    Thank you so much! That seems to have done the trick.

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