Optimising Old AS3 Flash Project - actionscript-3

I have an old SWF project file which is a series of png sequence to produce a 3D tour of numerous stadiums (If you can get it to load http://tinyurl.com/7h2zpcb). When I initially created it I never intended it to be published on the web (it was a university project) however I now would quite like to show it on the internet. The structure is of a main timeline with 4 stadiums each with a png sequence, then, when clicking on one of the stadiums, 4 more png sequences. The only problem is that it is all in one file and is over 12mb, plus has no pre-loader.
It is written in AS3 and is rather complicated as I used movie names and trimming to have reusable functions. It does however have global variables already set-up if this could help.
I have 2 questions. First, is there an easy method of separating out the project movies to 5 individual swf files. i.e main timeline, and each individual png sequence? Or will I need to copy and paste and copy assets over to each FLA file?
Secondly, would it just be easier to try using a preloaded and hoping that users wait for the project to download?
If you have any thoughts on this please give them. Is there a way to optimise the project in another way I am unaware of? As a side note there are a lot of pngs and total over 300mb when combined so I think XML is out of the question?
Thank you for your time. Any suggestions are welcome

For completeness' sake.
I did some research and tests and realised the time it would take to change the project to use any other technology would be too great for my needs. I simply just added a pre-loader to the site and saved myself a lot of extra time. When linking to the site I affix a message explaining that is for an offline installation and there may be a long load-time.
Hopefully this will help others in the future.
Thank you to Marty Wallace, shaunhusain and grapefrukt for their time and advice on this.

Related

dynamically changing the playback speed of a sound in as3 without altering pitch

I'm making a game based on simple song creation, and I'm planning on having a feature where players can listen to the songs they've created with the game. the rhythm of the melody is controlled with a system of timers, but this will not work for the backing track presets I am planning on implementing, as each mp3 file in the backing tracks represents one bar instead of one note.
while it would be possible to use my timer system for playing the backing tracks, this would require several more audio files, much more coding and would push the project far behind schedule. therefore, i need to manipulate the playback speeds of the files I already have. I've commonly seen two examples of how to do this, here: http://2008.kelvinluck.com/2008/11/first-steps-with-flash-10-audio-programming/ and here: http://blog.andre-michelle.com/2009/pitch-mp3/
the problem with both of these is that they also alter the pitch as well. this is a problem for me, as I would very much like players to be able to alter the pitch and tempo of their songs separately. I think the code I need is similar to the examples above, but I'm having trouble understanding those since I haven't had much experience with bytearrays and such. I'd like to be able to understand the examples i included so that I can figure out what I need to do in order to get my game working the way it should, but help of any sort is appreciated. thank you =)
You can try https://github.com/also/soundtouch-as3
there is an early (alpha) demo at http://static.ryanberdeen.com/projects/soundtouch-as3/demo/player/stretch.swf
quality is "acceptable" if you are using 1.0x-1.5x factor (less than 1.0 gives very artificial distortion)
You could also try :
http://iq12.com/old_blog/2009/08/25/real-time-pitch-shifting/
test : Online demo
Their online demo didn't load a track for me (deleted MP3?), so I put a recompiled SWF on my server just for testing. It loads this MP3 audio clip, if you wanna compare results to original sound.
It aims to preserve audio length (time scale) whilst adjusting pitch (deeper when slow or higher when faster). You could possibly combine this with Kelvin Luck's Second Steps.... Thereby having example codes for speed and pitch.
It was inspired by some C# code ported from this C code as found at (with concept explanation) : http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/

Automatically Generated rhythm game Flash Action Script 3

Is it possible to create an automatically generated Rhythm game for Flash Action Script 3 ?
But not just randomly generated, generated from the notes of a song. Or is that something I have to do manually?
How would I go about doing either of these?
I am currently following this tutorial: http://www.flashgametuts.com/tutorials/as3/how-to-make-a-rhythm-game-in-as3-part-4/ so perhaps it can be made to fit around this? (Go to the final part and View Source to see the full thing)
Thanks!
Depending on what you mean by rhythm game, check out the computeSpectrum() function of the SoundMixer class: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/SoundMixer.html#computeSpectrum()
There's an example of it working in the link, but basically what it does is take a snapshot of the current sound wave and puts normalised (-1 to 1) values in a ByteArray. What you do with those values is up to you - e.g. you might use them as a height field to generate terrain for example.
Repeat this every frame, and you get the gist
Welcome to SO!
First off, there is nothing already built in, to my knowledge. There may be something lurking around Google that someone else wrote, but you'd need to dig around for that (though I assume you already did.)
Generated from the notes of a song. Hmm, this will take some serious ingenuity and coding on your part. I'll point you in the right direction, but it is up to you to write the code. No one here will do it for you, but we'll happily help with specific problems in your code.
The crazy (yet potentially more fun) approach MAY BE to derive the data in a similar manner that an audio visualizer does...but I can't guarantee that will work. This would work best with MIDI-generated, single instrument songs. Here is a tutorial on visualizers.
A second approach may be to actually convert MIDI files directly. Again, I can't guarantee it will work, but it would theoretically be possible, seeing how MIDI files store data to begin with. Here's an answer on playing MIDI files, to get you started. Consider looking through their class.
However, the "easiest" approach would be to come up with some sort of system by which you store the note values for a song. You can manually enter the values in an array, or in a data file (such as XML) that you can load.
I put "easiest" in quotes because you'd have to account for a LOT of information - not just note values, but note duration, rhythm, and rests.
Anyway, those are just a few ideas to get you started. Good luck!

Duplicating, multiplying and saving a H.264 movie file efficiently

I tried to look for free H.264 editors that could do such forementioned tasks, but i couldn't find any suitable results (probably due to my incorrect(?) search terms).
Basically, i have quite a few 20 to 40 second looping movie files (rendered with Adobe Premiere), and i would like to multiply an individual movie to about ten or twenty fold, and then save it again, preferably without the need to re-render (or re-encode?). Is this possible?
Hopefully i managed to make myself understood, thanks :)
After a whole bunch of searching and testing, i ended up with Avidemux and it did the task perfectly, this time around. I'm sure there would've been a way to automatize the appending / "multiplying" of the file, but with a tablet pen (main click set as double click) and specific folder it truly went by like a breeze.
I was also interested of Smart Cutter (i quite enjoyed the interface after getting used to it), but since it was trialware the choice was clear. Still, if i would have to do these kind of tasks more often, i might consider purchasing it.

Flash bone tool actionscript 3 RagDoll

I've made a character, and used the bone tool to make it move in runtime.
This works fine, but now I want to add gravity/physics, so I can throw my character and it lands on the ground like a real ragdoll. How do I do this in actionscript 3 ? And is it possible to do this within the fla (no class file).
Thanks in advanced!
I'm not a bones tool expert but it's really really really unlikely.
You can do it without the class file, coding only on the timeline, but not without code, which is probably what you asked.
http://box2dflash.sourceforge.net/
This is FlashBox2D, physics engine for flash based on a C++ engine by Erin Cato. Since you asked whether it can be done without the class file, you should probably pass over over this particular engine since C++ programing is very complicated because of the way C++ programing "pros" force you to micromanage every minute detail of the program for ultimate in memory management. Just creating a basic circle shaped body is on the order of 10-15 lines of code. Creating the world is close to that as well. Luckily, there is copy paste.
I don't know if other engines are less verbose (they should be), but I suggest you check them out as well, in case one of those suits you more.
Nice thing is that you can just reuse their example code for your needs if you can get your head around it.
http://www.flashrealtime.com/flash-game-library-engine-list/#Physics
Have fun.

Program for diff-ing binary files?

(The story is relevant...mostly)
So I'm over at my buddy's house playing some RE5 Gold Edition, beat the game, unlock a bunch of stuff, and then I copy the save file to my memory stick so I can take it home with me.
Of course, the save is locked to his profile so I can't play it on my PS3, even though I was there beating everything with him. Lame.
So, I've got this save file sitting on my memory stick, I want to see if I can hack it to work with my profile.
I figure if I just create 2 new saves on different profiles and do nothing else, they should be identical except for the profile information. Then I just have to replace my friend's profile info with mine, and it should work, right?
So I need a tool for diff-ing these 2 binary files so I can quickly locate the parts of the file that are different. I know there are plenty of tools for text, but what about for binary?
(Actually, there are 3 files, DATA0.DAT, PARAM.PFD, and PARAM.SFO... not sure if anyone knows anything about PS3 save files, specifically for Resident Evil 5 Gold)
Don't think it's going to be possible. Apparently the save file is "protected". All it would take to prevent me from tampering with it is if they hash the contents of the data using some unknown algorithm, and then verify the hash matches up upon load. Not sure if they're doing that, but... guess it would be kind of dumb if they weren't doing something similar.
Hex Workshop is one of the premier hex manipulation applications and it has a file compare function.
But be aware that the game may not use a straight foward data saving mechanism, you may be dealing with a custom database structure, or the data may be encrypted. Game developers typically don't make it easy to hack save files, for obvious reasons...
I thought most of compare tools can do that (like Beyond Compare which I love). For example, there is FC.exe in Windows 7 in System folder. Compares ASCII and binaries. See http://support.microsoft.com/kb/159214 for some details.
check out hex workshop. most other hex editors out there should have this feature as well.