Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

on(Press) == onPress???

Status
Not open for further replies.

p3t3

Programmer
Aug 21, 2002
46
0
0
GB
If you have a MC instance with a on(press) handler set at design time. You then duplicate that clip with actionscript. Now, is there a way to change the on(Press) handler of the new copy.

newMC.onPress = function() {trace("oioi");}

seems inefective, and the original on(Press) handler is still left in place...

any ideas...?? Pete

Digital Soma
 
This way of doing it seems to work for me...



Regards,

cubalibre2.gif
 
thanks. Couldnt get your fla to download unfortunatly. FOr anyone interested, I managed to find this document, which, informs that on(Press) and thisClip.onPress actualy exist together and independtaly.

So, it seems I have to

duplicate my Old clip
newClip.enabled = false //to stop old on(press) handler
newClip.onPress = function() {foo}

PS this situation has only come about as Im maintaing some code with hundereds of old on(press) codes, As far as I can tell there is no advantage to using this method anymore...?

Pete.

Digital Soma
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top