I need help to embed a game into HTML, If I did replicate the game in html, it`s complicated so is there any code to do it?
PS: It has to be an element in the site not opened in a new window
You cant embed an exe in html. You can either rewrite the game in a web-friendly language such as javascript, flash, or java, or you can just make it be a downloaded game. If exes were allowed to run from webpages, viruses would be even more prevalent than they are now.
Extremely wild guess here, but if you made the game with Game Maker, there is GameMaker:HTML5 available, which allows you to take the same code as you wrote for the Windows EXE and export it to valid HTML5/JavaScript.
Aside from that, there is no way to embed an EXE into a webpage.
Related
I will admit I'm very unfamiliar with html - I've only really worked with object-oriented programming and not markup languages.
I'm working on audio controls for a website for someone else, I feel like I understand how the control tag itself works, but I cannot make the urls I link or function in audio players. I think it's the because of how I'm uploading the files, but I don't know if a website directly uploads the files. (I've tried using dropbox/google drive, but I don't think I can get the link I would need for that.)
Because of requests from the employer I'm working through go-daddy's iframe and not creating from scratch if that is relevant.
The upper line is my attempt at writing audio controls, the second controls are just an example I've been trying to mimic.
Code in question
I am fairly new to Flash and AS3.
My questions is do I actually still need to use Flash CS6 to setup the stage and library files.
Or can it all be done from FlashDevelop ?
Thanks
Flash CS6 is an application similar to Photoshop, you generally use it for creating/structuring/positioning graphical resources and then makes it possible to animate these (from keyframe to keyframe) and then access the graphical content from code.
So, the answer is no, you can create a SWF file without Flash, you can embed content to use in AS3-code without flash and you can use flex-components and position them without flash.
But creating any bigger project like that would be pretty unnecessary since you just as well could use some other language or tools for doing that kind of stuff. Tools and languages that were designed to do this specific thing.
Few months ago I switched completely to FD and since today I successfully built everything only in FD. The reason was that I had huge project to publish, and I couldn't compile it in Flash because of memory shortage for JVM compiler. With FD that was not a problem.
So in short, no, you don't need flash any more.
Though maybe there can be some things that you can create quicker and easier way in Flash than in FD (for example: some timeline animation and then publish to SWC to use with FD).
I still have Flash installed, just in case for quick animation jobs.
You need it if you want to create graphic objects to use them later in your code. The alternative is to create everything by code
It depends. If you need to use vector graphics, drawn in Flash, then the easiest way to incorporate them in your project is to use the IDE-based project (http://www.flashdevelop.org/wikidocs/index.php?title=Projects#AS3_Flash_IDE_Project). This isn't the only way, but it's easier than packaging them up and using libraries. In this case you are effectively using FD just as an external AS editor (and it's worth doing it just for this, since it is a much better editor than the one built in to Flash Pro.
If, on the other hand, you are working with objects drawn in code, with text, or with external bitmaps, then no, there's no real need to use CS* at all.
The advantage to OOP is having an environment like Flash for layout. It's been pretty crucial for me as a designer and when implemented correctly with a proper class structure, becomes extremely powerful. It really depends on what you are using as3 for. I find the Flash architecture to be most advantageous in the context of interface design, but for things like games or "static" interactives, sometimes its much more efficient to do everything in code and compile outside of Flash.
I want to produce a simple, static HTML file, that has one or more embedded MP3 files in it. The idea is to have a simple mean of listening to specific parts of an mp3 file.
On a single click on a visual element, the sound should start to play; However, not from the beginning of the file, but from a specified starting point in that file (and play to the end of the file). This should work all locally from the client's local filesystem, the HTML file and the MP3 files do not reside on a webserver.
So, how to play the MP3 audio from a specific starting point? The solution I am looking for should be as simple as possible, while working on most browsers, including IE, Firefox and Safari.
Note: I know the <embed> tag as described here, but this seems not to work with my target browsers. Also I have read about jPlayer and other Java-Script-based players, but since I have never coded some JavaScript, I would prefer a HTML-only solution, if possible.
Update: By now this has become a live tool, located at http://quir.li/player.html. I ended up using the excellent mediaplayer.js by John Dyer
I'm sorry but I don't think it is possible to skip to a specific position in a track without any form of client-side scripting. It is possible to just play a track without client-side scripting using a link with its target pointing to an iframe on your page.
Eg.
Play audio
<iframe src="nothingplayingnow.html" name="myplayer"></iframe>
If you'd like to embed the audio file itself into the html document, I think the closest you'd get would be to use the data URI scheme. All the pros and cons are explained nicely in that article.
But all of this is of course possible if you use a bit of client-side scripting. This flash MP3-player lets you skip to certain positions via a javascript interface. The site also has a generator which lets you make your own player interface very easily.
Sorry, but I think you'll have to use at least some javascript to achieve what you're attempting.
I have made an application that is coded only in ActionScript 3.0, and uses HTML and JavaScript for the display.
I would like to have the same result, but using Adobe AIR. I do not know Adobe AIR at all, so I was wondering if you could direct to some good tutorials that will teach me how I can move my .html/.js/.as files to Adobe AIR please. I am using Adobe Flash Builder 4.
Thank you very much,
Rudy
Are you using HTML and JavaScript for anything other than embedding the SWF? If not, you can create a Flex project from Flash Builder (at least that was the way in Flex Builder 3 - I don't know if they've changed it) and mark output format as AIR to start with. The easiest way would be to add the main Sprite of your AS project as a child to the rawChildren of the WindowedApplication class of the AIR from the creationComplete event handler.
It is hard to say more without knowing what type of project you're talking about.
You could still do this, but you would have to embed your own browser. Look at HTMLLoader:
At the very simplest, your air app would create an html display, where you would then embed your swf into an html page. (almost exactly like what you're doing now). However, AIR's webkit seems fairly old, and they didn't import everything, so some css stuff like corner-radius, etc, will not display as you would in any other browser.
However, this will only get you so far, as you won't have AIR capabilities yet. You would have to extend HTMLHost to create an API for the javascript container to access desktop'y capabilities, when you when then again have to use ExternalInterface again. This is probably where things will get a lot more tricky.
Are there any tips / best practices / secrets for optimizing the size of AS3 SWF files? In particular, any way to get a breakdown of what is taking up space inside the SWF, like you used to be able to in the old Flash 7/8 days? I'm not using the Flash IDE any more, but now I'm using either Flex Builder or FlashDevelop, so it needs to be something that I can do without the Flash IDE.
If you're interested what in the code is taking up space, you can get that information from the link report. It's not as detailed as what you can get out of the Flash IDE, but it shows the size of each class (uncompressed.)
To create a link report, use the -link-report <filename> flag on mxmlc. It creates an XML file with information about the classes linked into your SWF.
I used the .XSL file described in the link below to clean it up and make it more readable:
http://blog.iconara.net/2007/02/25/visualizing-mxmlcs-link-report/
One tip would be to try Joa Ebert's "Reducer" tool which can greatly reduce the size of any PNG files in your SWF if you used the embed tag.
http://blog.joa-ebert.com/2009/08/08/reducer/
Make sure, you use PNG-8 where it is possible and PNG-24 where you need alpha-channel.
Use pngout tool to optimize them.
And there are some tools that can obfuscate and optimize SWF files.
I'm not sure what can be done with Flex Builder or FlashDevelop but what I always watch out for is font embedding. I take care to embed only the characters which will definately be used in the final swf.
Hi I previously posted this link in a related question about link report analysis (here), I've used this in the past and its quite a nice tool
LinkReportAIR