0

Is there a way to check if a cakePHP action is being called from an swf/flash movie like there is for Ajax using the requestHandler?

designvoid
  • 431
  • 1
  • 6
  • 19

3 Answers3

1

Put a named parameter in the URL that Flash is requesting:

eg. http://www.example.com/controller/action/flash:true

Check for this named parameter in your controller (or AppController) code:

if (isset($this->params['named']['flash'])) {
    ...
}
deizel.
  • 11,042
  • 1
  • 39
  • 50
0

I don't believe so. A better option might be to create discrete controller actions that you only use from your Flash app.

brettkelly
  • 27,655
  • 8
  • 56
  • 72
0

Not the way I think you mean. The requestHandler can detect the type of request, but I think you're looking for the request source. It might be worth trying the getReferrer() method, but you may end up needing to add a click handler to the swf (if it's yours and you have that access).

Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192