Hidden code in Flash CS6 - actionscript-3

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).

Related

How to save flash and actionscript

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....

Flash AS3: Spontaneous 5001 error, relating to letter-case of 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.

Getting Type not found error implementing source in as3

I am trying to just compile and run the demos from this article:
Flash talks to max msp via osc
I am using Flash Develop and Flex SDK with an up to date version of air.
When I run the demo: "as3_MaxFlashHarmony" I get an error I don't know how to fix. The source for the entire project is here:
the project
But specifically the error I am getting says:
col: 30 Error: Type was not found or was not a compile-time constant: OSCMessage.
here is the as3 file that it is specifically referencing:
//IHarmonyApp.as
package
{
import org.tuio.osc.OSCMessage;
public interface IHarmonyApp
{
function updateOSCData(msg:OSCMessage):void;
}
}
It uses the libraries Tuio, MinimalComps, and MonsterDebugger. The thing I don't get is that how can it not find OSCMessage if OSCMessage is properly imported? the IDE is making fine references to it and I can open it's declaration. OSCMessage is a public class. I don't get it.
To give some extra info for potential answers, the IDE flashdevelop can find the library org.tuio.osc.OSCMessage just fine, it gives the error regardless of if org.tuio... is a source path or not, and the overall path does not contain any special characters. I don't know if that might matter, but I feel like this is me making a stupid mistake somewhere. I can provide my project zipped if need be.
Thanks!
Edit 9:48, 8/25/12
I do have the file path org/tuio/osc/OSCMessage.as in my project, and the file OSCMessage exists. FlashDevelop can find it just fine and I can navigate to declaration at that location. This is why I got stumped.
Thanks again
In your AS3 folder apart of your de folder you would need to have org folder with relevant folders and classes.
For example to import org.tuio.osc.OSCMessage you would need a file:
../YourPackageRoot/org/tuio/osc/OSCMessage.as
The other way is including a SWC file (all folders and classes zipped into one swc file).
You can include the swc file in FlashDevelop by right clicking the swc file and selecting Add To Library

Hard link to a file not working as expected on OS X

I've a file in a folder and I don't know anything about this file (how it's generated and updated) because it comes from an application running on my system of which I don't have the source code.
The file format is clearly json and I successfully created an hard link to it (using the shell command ln file hardLinkToFile) and placed it on another directory.
At this point I check the "2" files and they are exactly the same as expected, but when I perform an action in the application that cause an update of the original file the hard link doesn't get updated.
Any idea on how I can solve this problem?
UPDATE: As pointed out by both Vlad Lazarenko and mvds the file probably get deleted and a new one is created, is there something I can do to obtain a solution equivalent to the hard-link one I thought initially about?
If a hard link is not getting updated, it means that application is removing the old file and creates a new one. Thus, you still have a hard copy of the previous file, but new file has a totally different inode, though path is still the same. You can verify it simply by changing the content of that file yourself - the link should get updated.
I am getting the same behavior in TextEdit, but not in TextMate. I would suspect this is due to the revision control built in to OS X Lions document architecture. TextEdit uses versioning, while TextMate does not. Most likely this function replaces the file instead of changing it, as described by #Vlad Lazarenko.
#Vlad and Francesco. It's really in this way. I verified that vi leaves the inode unchanged and the src and dest file are both changed, while e.g. the kate editor doesn't and I was getting mad to understand why the changes I made in the src file weren't also in the dest file.
You can easily check this with the command ls -li srcfile destfile before editing one of them with each editor I mentioned.
By the way it's not nice that the hard link are application dependent
I guess it is a bit too late...
Anyways, accidentally I found that, if you change the default app for the file, the hard link gets separated from original file. Even if you click on change all and do not relate to that specific file.

Flex Builder not building changes

I'm having a very strange bug in Flex Builder where none of the changes I make are appearing when I debug/run my program. It only happens with a particular AS3 project, on others, it works fine.
For example, I have a line,var x:int = this.prevX + this.x;, whose value is 400 if I don't make any changes. I change the line to var x:int = 0; and set a breakpoint on the line. When I debug the program, it breakpoints just where it should, but the value is set to 400, even when the line is x = 0! What gives!
I've tried cleaning the project and deleting the project and re-importing it. No matter what I do, it won't show any changes I make, even if I just toggle a boolean. It still won't let me compile with errors, but once its done compiling, it completely ignore whatever changes I made. It's like it has the bytecode for the swf cached somewhere and its just ignoring doing the actual build step.
Any ideas?
Check if you have a copy of the swf in the html-template folder. The newly compiled swf will be overwritten by that old one after each build. Happened to me once.
Right click the project in the Flex Navigator and then click Refresh. Refreshing the project worked for me.
Changing from IE to Chrome worked for me.
I was having trouble with this as well, and deleting the html-template folder didn't fix the problem for me. I then renamed the project and it worked after that.
I get this too.
This is the first time I've found this referenced on the net. It's a BIG problem. I get it periodically. For me, it's not the html-template folder.
I've got a couple of ways around the problem at the moment
Delete the bin-debug swf
Overwrite it with a release build.
Delete the release swf
Export the release build elsewhere.
Build a debug version again.
This works - sometimes immediately sometimes after a few repetitions.
One other technique I tried today was to change the compiler options to -dump-config=somefile.
This worked immediately, however, I'll need to wait next time to try again.
It might be a situation of changing the -dump-config filename output when this happens.
Just tried another possible fix (which seems to be working really well) - Change the browser that Flex builder is using to a different one. This immediately fixed the problem. I'll post back here later if I find that this is a reliable fix. - Casp