PDA

View Full Version : (Adobe) Flash Development



huevoloco
August 12th, 2007, 13:34
Hi all,

I'm looking into developing flash apps for the psp, but without access to Shared Objects to save data cross sessions most of my ideas won't work.

Does anyone know of a work-around? First thing I thought was using cookies, but it looks like they can't be set when offline.

Is homebrew possibly the answer? are there other psp browsers that allow cookies offline? or would it be worth trying to make a homebrew app that would save flash data via its sendAndLoad function?

any and all ideas welcome, even if it's "abandon flash" :D

b8a
August 13th, 2007, 12:28
Seriously, you can't save cookies offline? I usually don't develop sites that benefit from cookies, so I've never run into this. But there is a note in the Sony documentation that says that it only allows a certain number of cookies per domain (I think 3), so I wonder if the problem isn't related to that limitation.

In any case, if you absolutely need to use your app on a PSP and you absolutely need to save data offline, I would completely suggest the "abandon flash" route. You suggest various homebrew sollutions, but seriously, the greatest advantage of Flash is that it's available to non-homebrew users, and if you're going to pursue C/C++/Lua sollutions to help overcome this limitation, then you might as well ditch Flash altogeather and just take care of your business in one of those less restricted languages.

The PSP web browser does offer a few native functions for returning data from JavaScript (so you could build a web page that hosts your Flash app, and then when it comes time to save data to the Memory Stick you could append the data to the search string of the address of a seperate page that contains the JavaScript code to extract that data and then use the PSP specific functions to write that data out to the Memory Stick), HOWEVER, these functions are NOT available in the default browser as accessed via the XMB. You would have to build a wrapper EBOOT containing a C function that would call the browser, passing the browser all of the nessecary data to enable this functionality. The good news is that any such C program could get away with minimal coding, allowing you to focus solely on the ActionScript/JavaScript side, but the bad news is that you would still need a homebrew-enabled PSP to use it. It seems fairly obvious that Sony has to have official API calls for calling the browser from a C function, but I am completely unaware of whether or not anyone in the homebrew community has uncovered the syntax for those call(s) yet. Seems like it would be fairly trivial to uncover, so maybe somebody does know the process, or for that matter, would be willing to investigate it for you. Just need to find some application (other then the XMB) that calls the NetFront browser and then reverse engineer it to find the methouds it uses to do so.

Of course it may also be possible to do what you're talking about (via sendAndLoad) in custom firmware by creating a prx that starts up whenever the browser is called and sits there monitoring ActionScript activity, handling any statements that it's set to watch for, but that would be entirely dependent on whether or not any such prx would be capable of intercepting ActionScript calls, and whether or not it could watch for the requested calls efficiently.

Either way, I'd say that there are some (homebrew dependent) avenues that you could pursue that would result in a usable workaround, the only question I would have in your situation is "do I absolutely need to use Flash to accomplish this task?" My guess is that if you don't need to use the networking functionality of the browser (which I'm guessing you don't since you pointed out the offline cookie limitation), then you're probably much better off just developing in another langauge. Even Lua can write data to the Memory Stick and is much less hampered by memory limitations anyway. I'd only seriously consider Flash for apps that:
a) Absolutely don't need to write to the Memory Stick,
b) Would significantly benefit from the convenient networking functionality of the NetFront browser
or,
c) Would benefit from HTML integration
Other then that, I just don't see Flash apps being worth the hassle of their limitations.

huevoloco
August 15th, 2007, 01:48
Ah yes, thanks for the info - it's pretty much what I expected.

The main reasons for me exploring the flash route were a) AS is my usual development language and b) I only managed to acquire a free 2.81fw psp last week and want to see what I can do with it with minimal risk of brickage.

It's all looking pretty unlikely as I'm already running afoul of the browser's limited ram.

I might still look into flash->sendAndLoad<->prx since (if it's done right) it could be useful for a few flash games/apps.

b8a
August 19th, 2007, 12:08
First off, if you're not wanting to downgrade, you should be able to use a limited amount of homebrew through either the GTA or Lumines exploit (I think 2.81 is locked out of the TIFF exploit). It's not quite as easy as on 1.00, 1.50, or CFW, but it can still be done.

Luckily you can port AS pretty easily to C, so that should take care of your first point. As for the second, C/Lua programs run extremely minimal risks of bricking your PSP. You pretty much have to go out of your way to put it at risk. It's really nothing to worry about if you're creating your own software. Especially if you're used to creating Flash apps which are nothing but safe, high level functions.

As for the sendAndLoad detection, yeah, it would be useful, but it would probably be easier to find out how to call the browser from a C function. It would almost certainly be more useful as well since any apps that required that functionality could simply be pre-packaged with it instead of requiring a seperate prx (which would almost certainly need to be flashed to use -- putting your PSP at almost as much risk as just downgrading to 1.50) to be pre-installed.