Gamepad SWF

gurigraphics

  • Posts: 657
Gamepad SWF
Gamepad for Flash Games


Platforms
Works only in Flash.
Tested in Google Chrome 47.0.2526.106 and Firefox 43.0.2

About this extension

Gamepad SWF use Gamepad API and ExternalInterface for to access joystick in flash games.



Get it

- Download Gamepad SWF Extension
- Download Javascript Source
- Download Stencyl Project

----------------------------------------------

Version History

Version 1.0 - 25/12/2015

----------------------------------------------

Notes

- It works only on flash.
- It requires jQuery.
- Use html template: html_js.zip
- Do not change in HTML this: id="flashObject" name="flashObject".
- For test use a local server: http://www.uniformserver.com

License: The MIT License (MIT)
Copyright (c) 2015 Gurigraphics

« Last Edit: July 30, 2016, 03:45:26 am by gurigraphics »

Wow! Awesome job man! Cant wait to try this out!

gurigraphics

  • Posts: 657
Merry Christmas. ^ ^

Strange that does not work in dropbox. Must be HTTPS security problem.

So this works for Xbox controllers also, correct?



henkass

  • *
  • Posts: 16
Hey I'm having some issues with this extension. It doesn't seem to work in the flash web player. How does it actually work? Do I use regular controller input after I've enabled it through the extension block? Do I have to run it with the html5? There's so much that's unclear. Otherwise it's great that you made this extension. And what do you mean when you say I have to use html template? And jQuery?
Also your stencyl projec uses an extension with a diffrent name, which completely ruins the point of having a stencyl project because all of the blocks are removed that's supposed to help you.
Sorry if I sound negative about this. Thanks in advance for an answer!

« Last Edit: February 01, 2016, 05:46:58 am by henkass »

gurigraphics

  • Posts: 657
Quote
Hey I'm having some issues with this extension. It doesn't seem to work in the flash web player.

The Online Demo worked with his control?
http://criarjogos.16mb.com/gamepad

Quote
How does it actually work? Do I use regular controller input after I've enabled it through the extension block?

It's simple. This use bool game attributes: BUTTON_0, BUTTON_1, BUTTON_DOWN, etc. If bool is true, then button = press.

The extension has a single block to activate it.

Quote
Do I have to run it with the html5? And what do you mean when you say I have to use html template? And jQuery?

In html template, insert your game.swf. Only this.

Quote
Also your stencyl projec uses an extension with a diffrent name, which completely ruins the point of having a stencyl project because all of the blocks are removed that's supposed to help you.

Ok. I updated the new file of project. Anyway, after enabling the extension you need to restart Stencyl.

Quote
Sorry if I sound negative about this. Thanks in advance for an answer!

I wonder if it were not free how that would be.

« Last Edit: February 01, 2016, 02:54:42 pm by gurigraphics »

henkass

  • *
  • Posts: 16
Ok I used your stencyl project, and the extension was enabled, and I put the Game.swf in the html template, and then I created a test project on newgrounds, the program loads, it seems, but the controller does not work for some reason. Your test program works though, with the same controller. And I checked, the extension was loaded into the program and it had the create block just where it's supposed to be.

gurigraphics

  • Posts: 657
If it works on the local server the code is ok. I tested it on dropbox and not worked.
So I put this site.

Anyway, the technology Gamepad API is still beta. I do not know what can be.

You can try using https Jquery:
Code: [Select]
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>

Nikkita31

  • *
  • Posts: 126
Hi Gurigraphics.

I think I am missing something here. I've been playing around with this extension for hours but I can't make this thing work.
I was able to install the extension and able to export the sample game you provided in flash.  I think there will be an animation when you pressed a button. Anyway, if it's possible can you provide any flash game link that has this extension enabled? Thanks.

-renegadequarters

gurigraphics

  • Posts: 657

In Google Chrome "Ctrl+Shift+I" open the Web Inspector and you check the error that occurred.

In this case, the javascript file was with another name in html.

I will add here an example that work.