I have a flash app (chat) with the sources, which is .fla and 7 .as files.
Project is saved in CS6.
I can edit what I want, but I have problem saving it. I have poor knowledge about flash and Action Script, so I need some help saving the project.
Thank you!
Check the "compiler error" panel. If there's anything in there, Flash will refuse to execute any command and will just play the frames sequentially. If there's nothing there, the .fla file is probably not linked to the code in the first place. Look for the "class" attribute under "Properties" -> "Publish" and set to the name of the main .as file.
I assume you did not write the app on the first place. If you are trying to take some code & trying to learn from it (or get it to run), go step by step.
First find the entry point of the app. See any code in the timeline?? Anything on the frames?
If yes, starting following it.
If not, there would be a document class specified in the stage properties...start from there.
Beyond this, Share more details, for a better answer....
Related
Firstly, my environment. My question is if it's possible to do so using Flash Professional and not Flex, FlashBuilder or the like (I don't have those environments at the moment).
Here is the thing: we have several .fla files with a Document Class set. The .as file with the class is shared with all those .fla files, so all them have this same class set as their Document Class. The point is that because of that the Class is compiled into each generated .swf files, and as result any changes made to the Class would require all the .fla files to be recompiled.
After some research I found out about RSLs. But I'd like to know if it's possible to have the class as RSL while also having it as Document Class for each file? It would ease stuff because in case a change needs to be done in the class we wouldn't need to recompile each file, or regenerate each .swf files.
Aditionally, if it's possible, how could I implement a RSL through Flash Professional? All the documentation I have found shows that through Flex and others.
Please let me know if I wasn't clear enough.
As already pointed out, you cannot use a RSL with a document class. However, you can put classes in an RSL and load those at runtime likely achieving what you desire.
Here is a very simple example:
1. Create the RSL assets:
Let's say you have a class that changes from time to time and you want to load it's functionality at runtime:
//TestyMcTestFace.as
package {
public class TestyMcTestFace {
public static function go():String{
return "I'm Testy McTestFace";
}
}
}
So, what you can do, is make a new AS3 project in FlashPro/AdobeAnimate CC. Link up your class file so your project finds it (in this case I just put my TestyMcTestFace.as in the same directory as the new .fla I created).
Put a reference in the timeline code to the class(es) you want included. Without this reference the class will not get exported in the resulting swc/swf.
So for this case, I have a new AS3 project with just one line on the first frame of the timeline:
TestyMcTestFace;
Now, go to your publish settings, and make it so only Flash (swf) and SWC are checked.
Publish this new project (you now have a swf/swc you can use as a RSL for other applications).
2. Setup your other applications to use the swf/swc as a RSL.
In your existing flash project, go to the 'Advanced Actionscript Settings' (click the wrench icon next "Actionscript 3.0" in the publish settings).
Click the library path tab, click the plus button, then click the "Browse To SWC File" button (currently it's an icon with the flash 'f' in it). Find your swc file from the previous step.
Now, with your new entry highlighted, click the info icon (linkage options). Change it from "Merged into code" to "RSL". Then add a path to the swf file (where it will be when this application runs).
Now, in your application, you can reference classes from the RSL. So if we do this:
trace(TestyMcTestFace.go());
You should get the output "I'm Testy McTestFace".
FlashPro will automatically load the RSL for you. Be aware though, that if you aren't letting flash preload your app automatically, it won't be available right away.
If you changed and re-exported the swc/swf from step one, those changes should be reflected when you run your existing swf again (no recompiling necessary).
Caveats:
Be careful with code in RSL's. It's easy to get clashing classes. As a best practice, only put code that is completely standalone/de-coupled into RSL's. Code that has lots of imports should be avoided. It's also best if you don't reference classes with same names in your compiled swf's that you are loading the RSL's.
Also keep in mind that RSL's can have sanbox/security restrictions if not coming from the same domain.
not possible, RSL is only meant for runtime sharing not for compile time sharing which you need to access the class.
First thing is, one class is not that much in term of size so there's not really a need to make it unique a sharable between swfs.
Now you affirm that all swfs would have to be recompiled if you make any change but that's not actually accurate since only one class definition can exist in one given runtime. The first swf running is by default the one loading the class definition, all the loaded swfs following would have their class definition discarded by default so no you don't have to recompile them in theory.
So to resume yes you have to recompile all swfs if you make major changes to the class but not for minor changes. But that situation is symptomatic to your app design which might not be the most efficient and logical.
I'm working on creating flash games using actionscript 3, i'm trying to open a Flixel project with FlashDevelop but i can't find a way to do it, i cerated a new project and put the files inside but nothing it seems to work, this is the link for the project on Github :
https://github.com/monday8am/BigHeadFootball_FLA
Although 'nothing seems to work' is a bit of a vague description, you might want to consider the following:
1. When you have put all the files in the FlashDevelop project folder (so that means merging the existing src folder with the one from the project etc.) have you set the Document class correctly?
2. If you've followed step 1 and try to run it, what kind of errors come up? If it can't find certain classes or assets you might have to move these.
Basically, it should be possible to open the project with FD once you've set the correct Document class and merged the two projects correctly.
I would like some assistance with batch image processing - I need to save an vector ai image to fla+html+swf file formats using a script - What I have done is to open the software and open a folder with these image's in. Please advise how i can write a script to assist with this process as I have alot of images I have to save.
I need to save it in actionscript 3 and actionscript 2, so if there is a script that convert it from actionscript 3 to actionscipt 2 that can be usefull aswell.
Please help :)
If I understand you correctly, you want to be able to put an image found inside an .AI-file (Adobe Illustrator) and automatically place that image into two newly created .FLA-files (one with AS3 set as default programming language and one set with AS2 as the default programming language)?
There is no quick and easy solution for this, it would require a combination of a "main app (python, c#, java or similar)" combined with "JSFL" to do what you want. And in the end that app would probably become very complex.
If you can skip the requirement of each ai-file becoming a unique fla-file you can just import all the images into a newly created FLA-file. But if that's not an option, then you're most definitely out of luck :\
I downloaded some code earlier from a tutorial and I need to look it over so as I can see where I am going wrong, yet I am struggling with it. In theory, it should have rather a lot of code, 100 lines or so at least, but when I open it I get:
import TBG07a;
var mygame:TBG07a = new TBG07a(this);
and I'm unsure why. I checked the Actionscript (3.0) properties, nothing hidden, I checked everything I can think of but it's 1 frame, 1 scene, 1 layer.... I can't think where any of the rest of the code would appear. It is of course a .fla file and it works completely when I run it.
I'm probab;y missing something stupid here but I'm unsure, can anybody help at all?
Ta.
John.
John, check out the directory where *.fla file is located, if there are any .as files in that folder? If no files found, then check fla's Library pannel, if any movieclips there have "AS Linkage" property filled (if so, try editing those movieclips). Also you may check out "File"->"ActionScript Settings"->"Source Path" list (by default it consists only one "." folder).
After updating some sound files in the .fla library, I started getting 5001 (name of package does not reflect location) errors for every file in an unrelated folder.
I understand the 5001 error, had it many times during development, but it was usually a case of a package typo, or a file in the wrong folder. Here, however, it seems to be some sort of letter case issue.
In the "Location" section of the "Compiler Errors" output, it lists the locations of every error (ie, every class in the /options/ folder) as "C:\Users...\powerups\Options\ClassName.as", note the upper-case \Options.
However, when I look at the (Windows) properties of any files in the /options/ folder, it confirms that the folder is lower-case, listing its location as "C:\Users...\powerups\options".
When I let Flash auto-suggest the package path it just suggests what it already was.
I fixed it on one occasion without changing anything by closing Flash and reopening, but then it starting occurring again after a few successful compiles. Have not had any luck since - tried recreating a fresh folder, letting Flash recreate the project files, and restarting.
I'm fairly certain I haven't changed any relevant code - the only thing I've been doing is adding some sound clips to the library and updating old ones.
Are you shure that you have correct settings in the tab "Advanced ActionScript 3.0 Settings" of the Flash IDE?
Maybe this link will be usefull for you.