AardvarkBusiness.net - Business Search Engine AardvarkBusiness.net - Business Search Engine



 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

     

ActionScript mouse events(?)

 
 
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Programming Forum
View previous topic :: View next topic  
Author Message
foundThroughAdminSig
President
President


Joined: 24 Apr 2004
Posts: 6491

7611 ants

PostPosted: Thu May 01, 2008 9:41 am    Post subject: ActionScript mouse events(?) Reply with quote

I am modifying a certain ActionScript / Flash and I want to do something upon mouse click event. I look at the code and I see this:

Code:
LButton.onPress = function() {
   startFlip (-1);
}
LButton.onReleaseOutside = function () {
   flipRelease();
}
LButton.onRelease = function () {
   flipRelease();
}
RButton.onPress = function() {
   startFlip (1);
}
RButton.onReleaseOutside = function () {
   flipRelease();
}
RButton.onRelease = function () {
   flipRelease();
}


How do I modify this? Do I add something like ...

Code:
LButton.onClick = function () {
...
}


Do I need to make a few clicks here and there inside Flash to write a function like this? How do I do this???

(I started using Flash only several days ago by the way. This is why I'm asking a very basic question.)
_________________
Online Education :: Training Forum
Chat about health ... Finance Books
Back to top
View user's profile Send private message Visit poster's website
lawton27
PA
PA


Joined: 09 Jul 2008
Posts: 24
Location: Cumbria
27 ants

PostPosted: Thu Jul 10, 2008 10:25 am    Post subject: Reply with quote

this script is to basic there must be more of it in diffent locations, have you tryed using:

on(release){
"script for the acton here"
}

??
Back to top
View user's profile Send private message
planetZest
Executive PA
Executive PA


Joined: 12 Oct 2004
Posts: 51
Location: Reading, UK
58 ants

PostPosted: Thu Apr 21, 2011 9:05 am    Post subject: Reply with quote

That works for the object script on the button, but yes you can use two of your examples above:

LButton.onPress = function() {
//do whatever
}

OR

LButton.onRelease = function() {
//do whatever
}

I personally prefer the onPress for most buttons, but either will do the job, so long as the movieclip/buttons instance has been set to "LButton" then it should work.
_________________
Piers
Bespoke Web solutions < (needs updating lol 8 years old)
Personalised Handmade Cards
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Programming Forum All times are GMT + 1 Hour
Page 1 of 1

 
Google
 
Business Forum Sport Forum Travel Forum


Powered by php B B © 2001, 2002 php B B Group

AardvarkBusiness.net Business Search Engine & Directory