View Full Version : Workarounds...

10-25-2006, 01:52 AM
Okay so I was playing around with flash and felt a need to make a workaround to get flash files from the internet, well I got all the way up to the part where I just gotta save the file.. It should save but it doesn't.. Help please :)

function onCreated() {
function Flash(url) {
temp.req = requesturl("http://mywebserver.com/google.php?url=" @ url);
function onFlash(obj) {
temp.filename = "flashtest.swf";
echo("File Name?" SPC temp.filename);
echo("File Length?" SPC obj.fulldata.length());
obj.fulldata.savestring("levels/flash/" @ temp.filename,0);
echo(temp.filename SPC "should be saved to your flash folder!");

foreach ($_GET as $index => $val)
$$index = $val;
echo open_external_url($url);

function open_external_url($url) {
$ch = curl_init($url);
$data = ob_get_contents();
return $data;

10-25-2006, 05:35 PM
That's nice :D

10-25-2006, 06:14 PM
hmm, sounds nice

do levels/flash/ support .swf files in folder config etc..?

10-26-2006, 02:34 AM
Is it serverside or clientside? It might end up somewhere in scriptfiles/*. On clientside you can only write into scriptfiles/* (exact path depends on your servername if you don't specify a path in scriptfiles/).

10-26-2006, 05:14 AM
Ovbiously clientside...

10-27-2006, 12:33 AM
Yes, the folder config is working correctly.
No its serverside. Using requesturl() clientside never occured to me before mmm.. Also does the flash gui check the scriptfiles if it can't find the file on the server?

10-27-2006, 05:05 AM
Files added by script are not appearing when doing /find so it's not sent to clients either, that functionality can be added though if it's needed.

10-28-2006, 10:49 PM
Hmm.. so refreshing the file list should show the file? yet it doesnt.. Just wondering has anyone tried my script and had success?

10-28-2006, 11:02 PM
you have for example


isn't obj.savestring suppose to be for one string?
tried like obj.savelines? obj.savevars?

10-28-2006, 11:22 PM
We're not dealing with vars so savevars doesnt work

existing script and goes here
function onFlash(obj) {
echo(obj.fulldata.size()); // returns 0, cant be a array ( lines )
echo(obj.fulldata.type()); // returns -1

10-28-2006, 11:26 PM
temp.object = {obj.fulldata};
do that return 0?

10-29-2006, 12:03 AM
Congratulations Chompy that made it work :)
Heres some Rep..

//Working onFlash(obj)

function onFlash(obj) {
temp.filename = "flashtest.swf";
temp.object = {obj.fulldata};
temp.object.savelines("levels/flash/" @ temp.filename,0);
echo(temp.filename SPC "should be saved to your flash folder!");

Being able to request the url clientside and open the flash file in the scriptfiles folder would be neat and less strainful on the server :)

And just when I thought that worked, savelines is only letting me save the file as a txt. Good News though, when renamed the flash file works.

- Saving lines in .swf format, ex: temp.object.savelines("test.swf",0);
- Opening flash files from the client scriptfiles folder.


10-29-2006, 12:05 AM
:blush: I am happy that I could help ya,
and I'll use that script on my server if I'm allowed,
because that was interesting, that picture :o

All you need to make now is an database that can store swf files for later download/usage
like an library? :]

Would be cool if someone made, like a library storing files
that you have added manually, or by url etc..
I might wanna make that :O

EDIT; would be funny, like to add something in server options, like
formats=txt,arc,swf,ini,doc etc.. would allow files saved by scripts with that format etc..
but that would easily been abused... ( like add .exe, or for example .dll or .server etc..)

but would be better to allow writing some other files then txt and arc (there are maybe more, but I don't know them :p)

10-29-2006, 02:01 AM
I think it would also work if you do

temp.object = obj.fulldata;
temp.object.savestring("levels/flash/" @ temp.filename,0);

Need to add something to make created files downloadable yes.