I have a project that is getting pretty large. Large meaning lots of library assets and a pretty complicated folder structure in the library. The FLA file itself is 3,700kb and exporting a 630kb SWF …not too big. I’ve done much larger.
Starting yesterday when I save the FLA, the saving dialog appears and then I get a not responding on the dialog and I have to ctrl-alt-delete out of the flash. It happened at least 5 times yesterday over the day. It doesn't do it every time, but after I first open it, it gets progressively slower at saving then the not responding occurs.
I googled around and there’s a big thread on the adobe forum about it, but no real solution. People say its fixed in CS5 .5 but that isn’t an option for me. Has anyone experienced this or have a solution?
I've experienced this before and have tracked it down to a corrupt image in my library. First, try a Save & Compact.
If Flash crashes during this process, or if it still doesn't work when you do a regular save, go through your library and click on the images one at a time with the library preview open. One of the items in the library should cause Flash to freeze up, and that is your problem image.
Reopen Flash, hide the preview window of the library, and then delete the offending file. Try a regular save now. If it still crashes repeat the step above with the remaining images to find more corrupt ones. Hopefully this works for you, your milage may vary.
Related
I've got a Flash project that was occasionally freezing, then after a few seconds catching back up. I figured it was probably just spending too much time processing unnecessary data, so I wanted to look under the hood and see what was going on.
I popped open my project in Flash Builder, hit "Profile ", then the project launched… and nothing else happened. I stared at it for a while wondering where the profiler was. No dialog opened up with profiler options or anything. After 60 seconds I got an error. I wish I could reproduce this error again now, but it was along the lines of "Unable to connect to the profiler after 60 seconds."
Google'd around and no one could really help. Debugging was already enabled, I'm using the debug flash player, all the project configuration was correct… I tried right-clicking the video while it was playing and clicking "Debugger" to manually connect to the profiler, however when I tried this it just said "A connection to the debugger or profiler could not be established". I tried connecting with the IP and port, as well, but no luck.
So I gave up and decided to just insert several trace() statements to figure out where I was getting lost. After adding a few I hit Run and nothing happened… I waited for a bit then hit Run again. Still nothing. I walked away to get a drink, came back, and my browser was open to a blank page. No project. I tried right-clicking and the right-click menu wouldn't open. I closed the browser, removed all the trace() statements, then before I could click run the right-click menu popped up… It was the Flash Player menu even though the browser was now closed and I was in Flash Builder.
I cleaned the project, tried Run again, it took FIFTEEN MINUTES for my project to display in the browser. (It used to take just seconds)
I tried restarting my computer but that didn't fix it. I tried rolling back to an old git commit in case something changed in the project settings but that didn't fix it.
When I go to other sites Flash loads just fine. When I compile a build release and open this in my browser it loads just fine. But when I try to open the development release it all but crashes my machine.
Any ideas?
After paying to speak with a Flash consultant, I've been informed that Flash just doesn't play nicely with profilers. When I informed him that I tried to plug in a profiler he laughed and said "Crashed, didn't it?"
Although not an ideal response, the only safe way to trace execution in Flash is the old fashioned way - lots of trace() statements and break points.
As for fixing the really slow playback, I resolved it by re-installing Flash Player.
First of all, sorry for poor english :)
I will start by making a few clarifications: I decided to ask three questions together 'cause in my research I only found solutions incompatible with each other or mainly for platforms that I don't need.
Fact: I'm developing a game with Flash CS6. Not for browser, or mobile (not yet, at least) but a desktop game for Windows, Mac and Linux. I'm searching for:
1) I need to save the game progress. Nothing complex, mainly numeric vars. What is the best way to do it (file format, encryption etc)? How I do prevent rough solutions depending on events like cache cleaning etc? Can I choose where to save the files? Is there a difference between an automatic save mode and a manual mode?
2) Consequently, what is the best way to load this data?
3) What is the best way to create a splash screen at game start and at save game loading?
I'm very sorry for noob questions like these but I really can't understand by myself.
Thank u in advance.
ps: I think I'm going to use Zinc to build a standalone application.
For saving data, especially numeric values, you can always use SharedObject class. You can save any data, but works similar to cookies - different browser or computer - no access to the previously saved data, but for desktop game I don't think that is going to be a problem.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html
If you decide to use external files, you can use xml files - they are the easiest, at least for me. Just google loading external files, and you'll find easy what you need. You can also try to use JSON format file.
As for the question 3 - I don't really understand what you're asking - best way to creat splash screen - in what way?
Greetings everyone...
I've made a little flash, with AS3, to view the data generated by some program I wrote... The data is in a .csv file and are loaded to the memory with a URLLoader object.
The flash loads well .csv files which can come to almost 50 MB in size... But when I try to load a file with 160 MB, the player just stop working... I run the last flash player version, outside of the browser...
I've heard that the Flash has limitations on the amount of memory it can store... But in another question, they say it has not.
What may be causing the crash? - I don't think it is the code, since it runs smooth for small files...
Thank you in advance!
I did some quick googling and it looks like URLLoader stores the download in memory so there could be some limitations. Another Stack Overflow answer recommends using URLStream along with FileStream. I'd think this would be the most appropriate way to deal with large files based on my experience on other platforms. Are you loading from an http:// or a file:// url?
Working with flash now, it came to me the error:
Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
In the menu File > Publish Settings..., we can make the timeout period longer on the Flash tab.
I also found an implementation of something like asynchronous processing in actionscript... It's a very interesting approach and I'll try to implement my loading method that way...
Thank you all for your help!
Very strange one.
Our air application loads multiple swfs, which together make up a lesson.
If we load them serial, rather than parallel, the code inside all swfs is broken. (There's a previous stackoverflow q on this issue). If they are loaded in parallel all timeline top level code works.
On Mac, all code works, including deeply nested code inside MCs inside MCs, all the time, regardless of the order in which loading of the swfs completes and inits.
On PC, top level (of each swf timeline) code always works, but deeply nested code is only running dependent on the order in which the loading of the swfs completes and inits.
Referring to the swfs as A,B,C and D, if the init order is A,B,C,D then code in swf A (deeply nested code only) does not function - even stop() is not working. This only happens on PC.
If the swfs init in the order B,A,C,D or even C,B,A,D then everything is as it should be. (It has been a fairly long process identifying this pattern!)
On occasion more than one loaded swf is having problems - I haven't been able to spot an obvious pattern behind this.
All 4 swfs run fine as stand-alones. All 4 swfs run fine in the Mac version. All 4 swfs should be loading into their own application domain as Air doesn't permit anything else, and the application domain is also being specified as a new domain each time. There are no detectable domain problems - no errors are being thrown.
Clearly something is borked. I don't believe the borked thing is in my code, as the application functions perfectly on Mac, and is only broken dependent on load complete order in the PC version, and only deeply nested code is borked.
The items which are borked (MCs with non functioning code) are not exported in the library as symbols.
Has anyone come across this, or anything similar to it?
Some variations I will experiment with:
1) Exporting the symbols for MCs with code in the library so that they load in frame1 (before the init event fires) even though they don't need this.
2) Not manually specifying the application domain but letting it default (to the same value)
I'll document my findings here. Can anyone think of anything else worth varying to see if there's an impact?
I think I've found the source of the problem.
The load order and the broken movieclip code are both symptoms of the same problem: the swf has not loaded into memory correctly.
The broken swfs are usually the largest, and when they INIT ahead of much smaller swfs it's probably a sign of incomplete loading, hence the correlation with Level-1 code not running. (Level-0 is timeline, level-1 is code inside MCs on that timeline etc).
Having run the tests hundreds of times I've found that this problem occurs approximately 50% of the time in a Parallels-XP virtual PC, and occasionally on a Windows 7 machine that has been down-versioned to windows XP (and hiccups in many other areas). So far it does not happen on a Mac book pro bootcamp XP install, or a stable Vista install.
I guess it's a genuine thread crash in the Air app, most likely some sort of memory issue?
I have not been able to find a way to prevent the problem from happening. Instead I have a work around:
Each swf contains a MC on the timeline on frame 1 with a line of code with the sole purpose of notifying the application (via the sandbox bridge) that level-1 code has been loaded correctly. If this notification is not received for a particular swf by the time the 'COMPLETE' event fires, the swf is deemed to have loaded incorrectly, and is unloaded from memory and loaded again.
This process is repeated until the load is correct. The files are local so the delay to the user is minimal.
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).