ForumsProgramming ForumRight Click in AS3?

6 4182
No_Thumbs
offline
No_Thumbs
20 posts
Nomad

is it possible use a right click function in as3 if so how?

  • 6 Replies
LonLonRanch
offline
LonLonRanch
172 posts
Nomad

Well the right click is, and has always been, built for the Context Menu, if you're looking for info on how to edit and customize the context menu check out the livedocs here

clipmaster3
offline
clipmaster3
104 posts
Nomad

Other than what lonlon said I don't think it is, as flash is meant to be cross-platform and macs don't have the same right-click capability as pcs

LonLonRanch
offline
LonLonRanch
172 posts
Nomad

macs don't have the same right-click capability as pcs


Uhh, just because the mighty mouse (the default mac mouse) doesn't come with a right click button, doesn't mean you can't right click on a mac. Macs have the same right-click capabilities as PC's do. You can purchase regular mice for Macs or control+click to get the same effect.
No_Thumbs
offline
No_Thumbs
20 posts
Nomad

is it possible completely disable the right click add use it in a function

LonLonRanch
offline
LonLonRanch
172 posts
Nomad

hmm, I'm not 100% positive but I don't think you can completely disable the context menu and make the right-click a function. Otherwise we would see it a lot more often.

Erasmus_Darwin
offline
Erasmus_Darwin
59 posts
Nomad

I don't think you can completely disable the context menu and make the right-click a function.


You're generally correct, though there are a few ways to cheat. The first is to make an AIR application -- but that's not really an option if you're making a game that's going to be played in a web page.

The other way to cheat involves sticking Javascript in the page that intercepts right-clicks before they get to the Flash app. It then passes the coordinates to the app via a separate means, so as far as the Flash player is concerned, there's no right-click. That works if you can control the page that the app is embedded in, but it wouldn't work for something being distributed across the web normally. If you're interested in the details, you'll have to google them -- I came across the technique once, but I didn't bother bookmarking the page.
Showing 1-6 of 6