Skip to main content
Known Participant
January 14, 2011
Question

as2 controlling button function in a movieClip within a movie

  • January 14, 2011
  • 1 reply
  • 581 views

Ok, trying to figure out  as2 and I'm not doing too well

I have a main timeline and on frame 6 I have  a game1_mc to be controlled from the main timeline, that has start drag on it.  The cursor changes to a hand but the movieClip won't drag. Could someone tell me how to get this to work?

After trying many things, I currently have  on a frame on the main timeline:

game1_mc.purpleTri.onPress=function() {

this.startDrag();

}

game1_mc.purpleTri.onRelease=function(){

this.stopDrag();

}

what am i missing?

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
January 14, 2011

That code would have purpleTri being dragged, not game1_mc.  What is going on with game1_mc prior to frame 6?

schugabugAuthor
Known Participant
January 14, 2011

Hi Ned,

That is what I want, to drag the purpleTri.

Its a matching game in a movieClip holder called game1_mc which is

sitting on frame 6 of the main timeline;

the purpleTri won't drag. the cursor turns to a hand tho.

schugabugAuthor
Known Participant
January 14, 2011

I figured it out.

I rebuilt a new version with test symbols and it worked, so when I looked at what I had done I realized that I changed the  movieClip purpleTri to a button on another frame and thats why it wouldn't work, the dragable item must be a movieclip.

Thanks!