How can I port an Adobe Flash game to JavaScript? - javascript

So there's this simple game, http://www.zigzagphilosophy.com/, that I've enjoyed playing around with every once in a while for a few years. However, I recently learned it was written in Adobe Flash, meaning its unplayable on most browsers currently and will be completely unplayable in a few months. Since it's a simple game, I decided I would try to port it to JavaScript by looking at its source code. However, the file index.swf that makes up the game simply downloads to my computer, where it cannot be opened by any means. How would I go about opening that file and being able to read the source code in a compiled form (e.g., looking like lines of code instead of just data)?

i have very little experience with javascript, though i read through the comments on your question and as you don't mind rewriting it yourself, i can recommend an swf decompiler for you. it's called jpexs flash decompiler and is accessible here. pretty sure it requires java and the gui looks pretty crappy but i can tell you from personal experience that it works well.
you can extract audio, images, basically whatever's there, as well as exporting to an fla or exe file.
i'm sorry i couldn't be of any more help than this, but i hope what i've written is at least useful :)

Related

Download existing file in server root file system using HTML/JavaScript on a Lua/Luci Server

Let me preface by saying I have no idea of what I'm doing. I've inherited a system from a contractor that we hired to do a job. I'm not significantly familiar with web development, and I have no idea how the magic voodoo was configured or really works. If you're going to reply, be patient, and assume I don't know jack about what you're telling me - please don't leave anything "for the reader to figure out." I'm embedded by trade and would rather bang bits than develop back end code for a website.
Server is running on an embedded Linux platform (basis is OpenWRT). The core is Lua/Luci, but there's a plethora of HTM files that utilize both HTML and JavaScript.
What I want to do seems really, really straight forward, but I can't seem to make it work: There is a file in /etc that I want to be able to download from the server to the local machine. Needs to work with IE, Firefox, and Chrome.
I would have loved something like:
download
But it doesn't work for files outside the subdirectory area that lua/luci knows about (i.e. I can't "../../../etc/file")
I've tried several different things, but the biggest issue is I can't seem to get the lua/luci stuff to recognize anything new in the same directory that contains some of the htm files, nor anything from the server's root directory (e.g. /etc/file). Usually what I do goes back to the home page or displays:
No page is registered at '/admin/talon/file'.
If this url belongs to an extension, make sure it is properly installed.
If the extension was recently installed, try removing the /tmp/luci-indexcache file.
(And yes, I clear the cache before I reload the page).
I'm OK with creating a symlink to the /etc/, but that hasn't been fruitful, either - mainly because I really don't know what kind of magic the lua service is doing to find the existing files.
I'd prefer for the solution to be in just HTML and JavaScript.
Yes, I've looked around for a basic solution, but either the questions want to do more than just download, or there's not enough information for me to figure out what is supposed to be done.
Please post a full solution, not just snippets.
I was able to figure it out based on some other code within that same source. It worked on one page, but not another. Not sure why - just more sorcery. Had to work within the LUA scripting language to get to the file I wanted; HTML was straight forward. If I knew what the magic thing was to make it work, I'd post the actual solution, but I think the solution is somewhat unique to how the original developer put things together, so it wouldn't be useful to anyone else.

Audio Player on site fragile if code is tampered with too much

I am using codes on my sites that I have never used before just for the layout and music player.
The page/audio player works perfect on desktop and android devices if I use this page: http://chancetrahan.com/1abcd.html
The player only works on desktop versions if I use the index file at http://chancetrahan.com
I have followed the site speed up suggestions on pagespeed insights and have gotten it to work on desktop, but I just realized it's not working right, and not showing up right if I view from android browsers.
I'm not sure if it's broken because I compressed the .js and .css files when I transferred them to my site or not, but that is what I am thinking might have happened.
I noticed that when I remove the FB ROOT from the code, it breaks the music player, I have no idea why the music player uses FB ROOT, but it does, I'm not sure what rollups are, but it also says that common.js is running twice.
I have stripped down the code to the bare bones trying to replicate this layout/template/theme with minimal code use, and a speedy response. You might not be able to see some of the code because I am using cloudflare, but I would be happy to use TeamViewer to go over this and kind of get some insight form someone who understands this code.
If you could help me figure this out I would be really appreciative for all the help I can get. Thank you for your help and advice!
It's very common to break javascript files when trying to lower your pagespeed scores. If you're using Cloudflare, test it on development mode and see if it works. Often times rocket loader will cause a problem.
I hope you have a backup of the javascript files before you minified them. If you tried to minify code that was already compressed, there's a very high chance that you broke it.
Further, pagespeed is not as big of a deal as you'd think when it comes to SEO. I put a lot of development hours into making a Wordpress theme from scratch that can get a 100/100 Pagespeed score. It helps, but not a crazy difference in terms of search engine rankings. It's more about just being nice for your users.
Another thing to mention, if you're concatenating your javascript files, first check if your server supports HTTP/2 as this will actually make your site much slower if it does. HTTP/2 is the new version of the SPDY protocol which requires HTTPS, and will quickly and efficiently deliver many resources at once without the need for concatenation.

Using Flash CC to convert AS3 to HTML5,

I’m a complete beginner in HTML/JS, though I’ve written a lot of games in Flash, which I’d like to convert, or at least be able to re-use most of the graphical assets when converting them.
Flash CC proposes to do just that, using the CreateJS libraries, and provides a very basic tutorial, but somehow I cannot make it work (http://blog.gskinner.com/archives/2015/04/introduction-to-the-flash-cc-html5-canvas-document.html#comment-376140).
Can somebody give a step-by-step set of instructions for the first time you try to run a canvas app produced with Flash CC? something like: Do I have to set up some plugIn in the browser? how do I do it? do I have to download stuff? what? where do I put it?

is game made with html 5 canvas (javascript API) open source?

I'm planning to build a 3d game using html5 canvas, which is javascipt API. I'm a noob who doesn't know anything about Javascript. From what I heard, every javascript code line will be visible to users like html. Does it mean the entire game that is built using Javascript API such as html5 canvas will necessarily become open source by its nature? I'm worried if someone can copy and paste the core mechanics of my game.
Copyright still applies even if you can see the code. Just as you can read the text of a book doesn't mean you can (legally) photocopy it and sell it to everyone.
Normally, Javascript is somewhat obfuscated via minification anyway, which makes it much harder to study. But it doesn't offer much protection against others duplicating and using the code. Minification does make it much harder for someone to reuse portions of the code, or modify the code to do what they want, which limits people to just wholesale copying of your site. Copying of the whole site is usually rendered useless by the fact that the frontend (JS) talks to some backend. So for example I could copy Gmail's JavaScript but that won't help me make another GMail since I don't have 1 million servers implementing GMail's database and APIs for it to talk to.
If your game runs entirely client-side and doesn't contact a server at all, then it could be copied whole.
So to summarize:
Copyright still means it's illegal for someone to do it without your permission.
Technically, your best defense is minification/obfuscation and ties to a backend.
No, just because someone sees your code doesn't mean it is "open-source." Open-source code requires a license that states that others may study, change and distribute the software to anyone and for any purpose.
This may guide you a bit more: http://opensource.com/resources/what-open-source
Edit: but they will be able to see your code. (Well as much of it is HTML/CSS/JavaScript)
Edit: This site may help you learn more about different software license https://tldrlegal.com/

How to make a Console plugin to interact with facebook games or other flash apps

I'm playing a flash game on facebook. I know I can decompile it to find out all the commands and would like to make scripts to automate the game by calling procedures in the actionscript of the game. So I guess I would like to make a plugin also that would insert this console into any flash app and this would be handy for a lot of things. Then if anyone wants to hack a new game, u just decompile it and make a handbook of methods for people to make scripts with. So how would I go about making this console? I don't know if I could make a swf interact with the game or if it has to be compiled into the game's swf. Or if it is easier with javascript, that is cool too. maybe we can make a javascript library just for this. anyone can tell me more?
Sorry, but you can't do this, the Flash security model won't allow it.
The console would need to be compiled into the original SWF, which you could only do as the original swf author.
Well, you could interact with the original game servers as the flash (.swf File) does it.
I tried it too, but it is pretty tricky because some parts of the package content is being encrypted.
I don't know how to decompile the game files so you could maybe write the same algorithm inside your program and communicate with the servers. Clientless.

Categories