View Full Version : Stopping people viewing/ downloading actionscript files?
dezamp
August 1st, 2006, 03:39 PM
How do you stop people viewing or downloading external actionscript files? Please Help!
Jeff Wheeler
August 1st, 2006, 03:40 PM
You don't upload them… aren't they integrated on compile?
bwh2
August 1st, 2006, 04:01 PM
you could use a mod rewrite to prevent people from directly accessing certain file extensions.
Jeff Wheeler
August 1st, 2006, 04:02 PM
Or certain files…
bwh2
August 1st, 2006, 04:35 PM
or even simpler, just put it in a folder above public_html.
although one thing i'm not sure about is whether externally loaded AS files get thrown into temporary internet files. if that's the case, you might need some server-side scripting to decrypt an encrypted AS file. but like i said, i'm not sure about all that.
Jeff Wheeler
August 1st, 2006, 04:39 PM
Wait, SWFs don't include the external source when compiled? Doesn't that mean that somebody could just publish an SWF that loads in a certain file (passed by some argument), and then anybody could write AS without having Flash?
bwh2
August 1st, 2006, 04:46 PM
that's how i understand it. anyone with real flash experience care to clarify?
Anogar
August 1st, 2006, 05:08 PM
You can edit Actionscript (*.as) files with Notepad or whatever, so you certainly don't need Flash to edit them.
Jeff Wheeler
August 1st, 2006, 05:10 PM
Yeah, but I thought they weren't used after compile, as the compiler included them into the SWF source…
Jeff Wheeler
August 1st, 2006, 05:20 PM
Oh wow… anybody want to make me the proposed file, then? :lol:
senocular
August 1st, 2006, 05:23 PM
n00bs :sure:
AS files are compiled into the swf at compile time. They do NOT need to be uploaded to your server for your Flash movie to run - they are all part of the swf when it is created.
ramie
August 1st, 2006, 05:29 PM
and AS is compiled to bytecode at compile time, you cant edit swf with a text editor
You can easily extract the bytecode and read that, in some hardcore cases I've optimised bytecode, you can also easily decompile the swf back to AS, it's is very insecure and this is well known fact.
Swf is stored in the users cache, it can be got at, anything to prevent it server side can be worked around with proxy scripts, it's a nightmare.
Deterrents are the best way but are only that.
http://ramieb.com/swf.JPG
Jeff Wheeler
August 1st, 2006, 05:31 PM
Ah ha! I won! I win! I was right and I don't use Flash! Yeah! :lol:
Apologies…
bwh2
August 1st, 2006, 05:55 PM
why doesn't flash allow you to just load external AS files that rest on your server? wouldn't that be much easier to maintain in the long run?
senocular
August 1st, 2006, 06:34 PM
because they have to be compiled into bytecode for the Flash player to be able to interpret them correctly. Like with C, for a program to run, it needs to be compiled.
You can place compiled AS scripts online and load them if you want. That just means loading in a swf (which is what flash compiles to)
bwh2
August 1st, 2006, 06:41 PM
right... but i'm asking why doesn't the flash player just compile it? would it just take too long? if that's an issue, why couldn't the server just compile it?
to me it just seems logical that AS files could be loaded dynamically. i don't see why i should have to recompile the swf just to change one line of AS.
Jeff Wheeler
August 1st, 2006, 06:42 PM
Does it really make sense for software to be compiled by the player rather than the compiler? Think about it logically… that's silly.
senocular
August 1st, 2006, 06:46 PM
it would take too long and it would add extra weight to the player - something undesirable since we all want the player to have the smallest file size possible (part of the reason Flash has been so successful)
bwh2
August 1st, 2006, 06:54 PM
Does it really make sense for software to be compiled by the player rather than the compiler? Think about it logically… that's silly.yeah, i suppose that's true. i guess i just don't think of flash movies as "software"... but i see where you and sen are coming from. and to address my question of having to change small things, i was forgetting that you could dynamically load your variables from external sources such as txt, php, etc.
ramie
August 1st, 2006, 07:27 PM
Flash uses a pretty standard compiler stack model for a VM environment, Java is the same, they are interpreted languages, where bytecode is interpreted at runtime by the VM, the VM contains the libs and whatever, in something like c++ the libs are compiled into the exe at compile time, that process is called linking.
PHP, ASP (scripting languages) are interperted also, but in a slightly different way.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.