How to find Action Script in a flash file (.fla file) - actionscript-3

I have to analyse data in a flash file. I have given with swf file , which i decompiled and produced .fla file which contains 35000 lines of code.
In that .fla file how to find user written code (i think so Action Script ). I am struggling with this.
Meanwhile i am preparing environment for flash editor with flashdevelope software.
Can somebody please suggest me how to find user written code in a flash file(.fla)

You have to look on each and every keyframe which have an action symbol. I put an image to show how it will appear in flash file.
If your swf is targeted to AS3 then probably all the codes will decompiled in external ActionScript files. You will have to search in all the directories generated from your decompiler.
Edit
as #BadFeelingAboutThis suggests, there is another way by looking at the left panel within action panel.

Related

Compile error Flash CC 1017

Hi all I am trying to modify some flash files provided as part of a training package supplied on a DVD.
The DVD contains the final training packages as well as all the source files.
I have opened one of the source FLA files in Flash CC and fixed some typos in the text, then republished the SWF.
When republishing I get two errors.
1 Symbol 'noteBtn1' 1017: The definition of base class RolloverCursor was not found.
2 , Line 1, Column 1 5000: The class 'RolloverCursor' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.
I have looked at the noteBtn1 Symbol and cannot see any script attached to it ?
I have assumed that by simply hacking the original fla file all the correct paths and setting should be inherited from the FLA file.
If I try and run the resulting SWF file it doesn't initailise correctly leaving all the assets visible simultaneously.
The FLA file has a single scene in it with the first layer being a script layer.
There is only one frame in the scene
It has been a long time since I touched Flash so a little help would be gratefully appreciated !!
Regards
Gus
There must some Action Script along with it in a folder which you probably didn't copy along. This happened to me as well a lot of times. Just search for the folder containing the 'as' file of RolloverCursor.as (most probably) and make sure it is in the same folder as your flash file.
The original object in the Flash project causing the error was not used. I have removed it from the compile. This caused another error about a missing library
The missing library was a 3rd party actionscript library. This was then downloaded and installed in the same directory as the FLA file.
Import statements updated to reflect the correct package structure, the object has now compiled.
I still cannot see how to set the global class path in the Adobe CC 2014 version of Flash professional

delete external text file from .swf file

I have a swf file (game file) which reads the content of external text file which I have created. This swf file will not be used in any browser. It's for windows only. I was wondering if I can delete or update that text file after I read it's content without using air.
Your question isn't very clear, I'm not sure what exactly you wanted to know. But if I understood you correctly:
You cannot delete files from the filesystem in the through Flash Player, but you can however delete it from SWF file's memory.
Deleting from the file system (basically like putting into trash) is something that only AIR can help you with.
Deleting from memory would mean to remove all the listeners from URLLoader or Loader object instance and setting it to null.
You cannot write the file with Flash player to edit it's content (update), but you can load it again and check if anything changed in that file's content that also would be considered as updating.
Hope that answers your question.
you cant do that without air. but you can use an external application using fscommand().
or you can use Multimedia Zinc

Some way to change text of SWF without having Flash?

I have a FLA with some text but the person that will be sending the SWF doesn't have Flash and doesn't know anything about Flash either.
Is there some way to build the FLA so that the text can be changed simply by modifying the SWF somehow? Due to company policy, the SWF cannot read from external files.
We tried programming into the FLA that it read an XML in another server, but that's not allowed. I also cannot send the SWF with another file (ie. an xml file).
Thanks.
Use FLASM or SWFMILL which are free command line assembler/disassembler for swf files. Use any of the one to disassemble your swf. You can open the result file in any of the text editor, find and replace your text and assemble it as swf again. Hope it helps.
It is a strange logic to try to modify a FLA file without Flash. A FLA file is a binary file, you'll need an editor to read it and I'm pretty sure Adobe isn't allowing 3rd party editors legally.
But yes, it's fine to have a dynamic TextField where you can send the parameter and change the data. Please note - you need to send the data. Means it has to come from outside.
What are the options? Well, actually, there are few:
Loading from an external file or getting it from a server side script. You said it's not allowed, let's omit this method.
Read FlashVars. If you publish it within a HTML page, you can actually feed some data via FlashVars. Not only 1 variable, but as many as you want. And it's fine for small strings, but if you plan to pass a text larger than a sentence… Don't do it.
As a funny hack you could try naming your file with the text you want and read the URL of the SWF thus showing it's name and using it as a text data. But don't do it :)^
If you want to try it, you can access the URL with stage.loaderInfo.url, just make sure you have a stage defined - call in the document class or after the display object you're calling from is added to stage.
Use ExternalInterface to communicate with, for example, JavaScript and get the variables from JavaScript. It's actually not so bad, since your text will be tidily stored in a .js file and you can modify it on the run. That of course is a separate file and you need to have the SWF embedded in HTML for that, but it is one of the options you have.
Other than that you could have an external file that will hold the data and embed it in the SWF. Look more on embedding here: http://flashgamedojo.com/wiki/index.php?title=Embedding_XML_in_AS3 . It is about embedding XML data, but you can use the technique for any data, even binary.
Embedding data is a great thing, but you'll need to re-compile each time you make a change in the file, since it isn't loading the file dynamically, but embeds it into to the SWF itself on compile time.
Hope that helps!
JPEXS Decompiler can change text in an SWF pretty easily. It's still actively developed as of 2021.

Actionscript 3.0(Adobe Flash CS4) Loading external .as files without knowing name of .as file

I want to know how to load external class files(.as files) in actionscript but don't have to know the class file's name. Think of it like loading mods in minecraft with forge mod loader, it doesn't know the main class of the mod's file name, yet it successfully loads the mod. I want to know if something like this is possible in actionscript 3.0 because I feel like making a tower defense game that isn't like the others out there but have it so it can be modded and have mods loaded but of course I have to load the class file without knowing the class file's name.
Note: I don't got access to Adobe Air so I can't use anything that requires Adobe Air.
You want to load a particular .as file AFTER or BEFORE compilation? After the compilation it is hardly possible - the file would not be compiled and therefore it would be useless. Why don't you use a swf or some kind of XML/JSON with settings in that case? Before the compilation you would still need to identify it by it's package name/name.
Basically, you want a plugin management system.
In AS3, it is not possible to "load" a .as file on execution, because it is a (uncompiled) source file. But, it is possible to load another swf and to use the classes within it.
Your process should probably be something like this :
Get a list of the plugins/addons. If you were using AIR, it would have been possible by browsing the content of a folder. Since you're not, you'll probably need to use a listing file (basically, a file that say "Here's the list&path of the plugins you need to load".
Load each swf file
(possibly) call a initialization method for each plugin.
You may wish to look into the way OSMF manages plugins, for example : http://osmf.org/dev/osmf/OtherPDFs/osmf_plugin_dev_guide.pdf

How to I keep track of changes in FLA file (via version control)

I have all of my files in version control (SVN subversion). FLA file is not a text file, so when I change it and check it in, there isn't a way to see what has changed inside of FLA.
Is there a way to keep track of changes to FLA file and it's contents?
Flash CS5 has introduced a new file format called XFL which has been designed for use with version control systems. This format basically splits up your FLA file into a series of separate XML data files (all contained within the one folder) which means version control systems can accurately determine what parts of the file have changed.
Simply go to File > Save AS, and select xfl from the drop-down list.
If you're using anything before CS5, then unfortunately there is no similar way to accomplish this task. I will add, however, that if this is the case, then you can try and mitigate this problem by keeping all your code in an external AS file and load any data from external xml/image/etc. files. This way, there is at least some degree of tracking for certain parts of your project.