problem:Website and Flash loading an older version of my SWF client - actionscript-3

I have a swf game client that's being hosted on my website. Users mostly use flash projector to connect directly by opening the swf's url.
My problem is that, when I upload a newer version of this swf client on my website, the users still manage to load the older client, that is no longer there. older and newer clients had the same name, but I want to keep it that way.
I would appreciate any suggestions :=)

Like Organis's comment, here is one way to work out.
Your game will start from index.swf, and index.swf did't contain any game logic,its only job is to get the version number from index.html(use loaderInfo.parameters) and load the main game swf use the version num

Related

GameInput API doesn't work once the SWF is embedded in a HTML page

I've built a small demo application to test the GameInput APIs that Adobe released a little while ago. It works perfectly in debug mode, via the .exe and via the .swf that get generated via Flash CC, but when I test the application embedded on a web page, I can no longer use the controller (I am using an Xbox 360 Controller).
I've spent some time researching, and can't find any references to the GameInput classes either working or not working when the SWF is embedded on a web page.
Does anyone know if it is possible to get working (perhaps via some extra data in the HTML embed code) or whether this is an obstacle I won't be able to get around?
The GameInput classes absolutely work in the browser. Support has been there since Flash Player 11.8 (in beta), then officially added with 11.9.
It does come with some caveats:
Not all devices work; some fringe devices may get ignored by Flash.
Sometimes the addition of devices that are supported don't really work - you may have to disconnect and reconnect them to get them to work.
Sometimes when using multiple controllers of the same type they get mixed up and only one of them will work.
Actual reported control ids vary between the Plugin/ActiveX version of Flash (Firefox/Safari/IE/etc) and Pepper (Chrome).
You usually need to press a button with the proper SWF focused for the GameInputDevice to be detected and reported.
An XBox 360 controller is guaranteed to work. That's FP's main "target", if such a thing exists. I have personally performed dozens of tests with different devices and the (wired) XBox 360 controller is the only one that never gave me any headache.
I have a published SWF that works for testing which devices have been properly detected, and their reported controls, with source code available as well.
As a final note: as is the norm with any HTML-embedded SWF, be sure to always test in a server, not using file:///. A local server with XAMPP or whatever will do. Loading SWF content without a server always gives you a lot of restrictions that you have to circumvent and it's generally more effort than it's worth. I wouldn't be surprised if GameInput support was unavailable for SWFs loaded from file:/// on some given browser.

Developing a video player app

I want to build a video player on android platform which is actually for E-learning purpose and thus here protection and piracy of videos is major concern. The video player will be connected to a server which has all the videos and only on subscribing to the video, the user can download the video.
But now i need to protect the videos from being shared also. So what I thought is to make a hidden password protected folder from my app which would contain only the downloaded videos, so that even if someone accesses the folder cant get the videos in them, and thus piracy will reduce.Here the password is not available to the user also because the file should only be played on my media player which has the decrypt code. No other player can play that file.
My major doubt is do you think this idea is feasible?? Actually I am new to Android development so if you could guide me as to how could this be done?? I plan to use either the media player class or the VideoView class for the same? What do you suggest would be better for this application?
Is is possible to stop the installation of any app without internet connection, even if the user has the .apk file??
Instead of bundling the video with your app - why not host all the media on a remote server? The users can then download/stream from there after authentication.

VerifyError out of the blue. Help!

I'm the developer of ShellShock Live, a free online artillery game:
http://www.newgrounds.com/portal/view/564049
Everything has been running smoothly, but every once in a while for a period of 4 hours or so, hundreds of "VerifyError: Error #1026" will show up in my error log. Then, they will stop.
I looked into VerifyError and found that "The VerifyError class represents an error that occurs when a malformed or corrupted SWF file is encountered." The SWF on Newgrounds is just small loader SWF that loads the full game SWF from another site, so there must be a problem there. I'm stumped, because the game will run fine for days, and then just start getting these errors out of the blue, after no changes to either SWF.
ShellShock has hundreds of players online at any given moment, so I would like to fix this ASAP. Any help would be appreciated! Thank you!
I know the original post is a couple of years old but since I've just spent many days trying to work around a similar issue, and since this thread does not contain what I believe is the correct explanation I'll post the conclusions of my own investigation here, for anyone else to use:
The VerifyError events are almost certainly being logged because the loader SWF on NewGrounds targets a lower Flash Player version than that of the game SWF that causes this error.
The Flash Player on the user's system will accept the NewGrounds SWF loader because it targets a version equal to or lower than the version installed. After that, an external SWF that targets a higher Flash Player version can be loaded without any complaint from the Flash Player, unless it tries to access unavailable features in that Flash Player, and then it will throw the VerifyError.
The sporadic nature of this problem, in 4-hour surges, is likely related to the different penetration of later Flash Player versions in different parts of the world (and hence different time zones). During very active periods of casual gaming (weekends and evenings?) in countries with low penetration of recent Flash Player versions you will likely see batches of these VerifyErrors logged.
The bad news is that after many days of trying to find a workaround for this very problem we have been unable to find any way to catch the VerifyError. It does not even get caught by an UncaughtErrorEvent handler!
The only thing I can suggest that might help in your case (not mine, unfortunately) is to determine the target version of the NewGrounds loader SWF (check the 4th byte in the SWF) then do one of the following :
Compile your game to target the same version of Flash Player as the loader targets. That way you can be sure that if the NewGrounds loader SWF is successfully loaded into the user's Flash Player your SWF will also work in that version without problem, or
In the initialization code of your game, check the Capabilities.version to determine the Flash Player version installed on the user's system and use that to branch control so that advanced Flash Player features are only used in appropriate Flash Player versions.
In my case I have access to the loader code, but not the code of the thousands of SWFs it loads. Since the external SWFs are stenciled into copies of the loader SWF as ByteArrays I can check the SWF's Flash Player target version byte (byteArray[3]), and compare it to the installed Flash Player 'major.minor' version obtain from Capabilities.version, but since SWF Flash Player target version bytes are (currently) incremented with every minor version increment of the Flash Player, it is impossible to map the SWF target byte (byteArray[3]) to future Flash Player 'major.minor' versions, until we know what the maximum minor version number of the current Flash Player will be.
Hope anyone else encountering this will have better luck than we did.
I think it may be a flash player error, try disabling any graphics acceleration or caching. It may be helpful to figure our what graphic card they are using.
Have you made changes to your socket server? Are you using like smarfoxserver?
I had this error in a very small project with cs3 flash9. So I was able to track this error down.
NOTE: this error is emitted incorrectly. The reason the error was emitted in my project was NOT because of a faulty swf because I do not import any swf into my project.
REASON:
I had a code line written like this:
_mc.my_counter && _mc.my_counter--;
SOLUTION:
I changed the line to this:
if(_mc.my_counter) _mc.my_counter--;
... and the verify error message was gone as fast as it appeared. Looks like this is a real as3 bug.

Flash CS4/AS3 Writing local file from local game without save dialog prompt?

I'm writing a game to be run locally, on the user's computer. NOT over the internet.
I want to have a file that will hold the usernames and avatar indices (they're in an array).
I want to know if there's a way to write to files through Flash with AS3. I'm using CS4.
I'd also like to know if you can delete files through Flash, though that's just optional.
Thanks in advance for any help you can give.
If you want to make a game that runs locally on someone's computer, you should make it in Adobe AIR. AIR apps can read and write files, and do all sorts of useful things like show updates in the taskbar, etc. Whereas a simple SWF that you download and run locally can't do anything useful that it couldn't already do in the browser - it can't write or delete local files, for a start. (It can read local files, but only if you disable it from accessing the network.) Moreover, the standalone Flash player is not generally disseminated, so unless the user is a Flash developer they're just going to view your SWF in a browser anyway (unless you plan to publish projectors, which I also wouldn't recommend).
With all that said, however, even if you do your game as local flash content, you can still store information by using SharedObjects. They work the same way offline as online. You can't write the data out as a separate file, but you can store it between sessions easily enough.
if i understand what you are trying to do then why dont you use Adobe AIR? this is flash for the desktop

How do I produce a screenshot of a flash swf on the server?

I'm writing a flash app using the open source tools. I would like to load a data file in to the app and capture a screenshot of the stage on the server. The only part that seems mysterious is running the app on the server. In fact, I don't even care if it's the same app running on the server and in the browser--if I can use the flash stage and drawing routines to produce an image server-side, I'm happy. If I have to delve in to flex, fine. Right now I'm having problems finding any starting point at all.
I gather Adobe has some commercial products that may fit the bill, but I'd like to stick with open source, apache, and linux. I know this is probably possible with haxe/neko, but I'd like to use more mainstream tools if possible. Am I asking too much?
EDIT/CLARIFICATION: Many thanks for the responses so far, but I think I've been a bit muddy in my description. I've already written the actual stage-grabbing stuff using the same PNGEncoder class as was suggested. The problem is in actually running the swf on the server side. I don't want to let the client take the screen shot itself, because this opens up the possibility of the client maliciously submitting a screenshot which does not correspond to what is on the stage, that is, I don't want users uploading porn. If I could run the the actionscript code on the server, then I could generate the screenshot from my data files and be sure that the screenshot matches the data, but I have no idea how to run the actionscript or swf on the server.
Swfs run on a client computer, not on the server. The only way it would run on the server would be if you set up a special environment on your server so that it ran a web browser, opened up the page and ran the swf. But even then it would have no correlation to what an external user was doing.
You'll need to run it client side. As far as your security concerns, the best way to get rid of those is to have the php writing the actual image only accept an encrypted form of the image file, which the flash can encrypt. That way they can't simply use the PHP file to upload whatever image they want unless they happened to encrypt it the exact same that your swf did. Next encrypt the swf itself (I recommend SWF Shield) so that a potential hacker cannot read the code to know how to encrypt the image.
We just completed a similar project where we rendered JPGs from SWFs that loaded dynamic data, we used IECapt
Did you try actionscript print commands?
Try and look at this:
http://www.phpclasses.org/browse/package/4312.html
I know this question is long dead, but I had a similar problem and ended up writing a script using applescript + ui scripting to grab the inside area of the preview window of the standalone flash player in OS X. You can grab it off github here.
How about swfdec-thumbnailer from the swfdec-gnome package? It's used to create thumbnails of SWF files but can accept arbitrarily large resolutions with the -s argument.
EDIT: swfdec-gnome has been deprecated in Ubuntu 10.10 in favour of Gnash. Here is a guide on taking screenshots with Gnash (note that certain features like gradients are not yet properly supported).