Strange problem with Class files

6 posts

Flag Post

Hi there, strange problem tonight, thought I would ask someone else see what they think.

I have a .fla file that is using the code

import Player;

To import code for a class from I spent about 2 hours programming this and that, things seem to work fine at first. Then when changing variables in I noticed that nothing was happening. After some other testing, I deleted the contents of the file and saved it, the game still worked as before. So, I closed Flash, opened again, tried it out and same thing, no matter what changes I made to the game would still behave exactly as it did before. Then I copied the exact same file from and named it, changed the import and class reference statements to Player2, and my changes were included when publishing or previewing my .swf file.

Any suggestions to make it work with the original name, or ways to avoid this strange bug or whatever it may be?

Flag Post

The Player class sound suspiciously like something that the flash player might have reserved or something. What if you just gave it a more identifiable name like ‘mainCharacter’, ‘Player1’, ‘PlayerA’, etc.

Flag Post

Well its a Class file, so Player1 and PlayerA don’t really make sense. And it worked fine before, and in two projects also, so if flash is going to randomly stop updating my class files I’d like to know how to make it stop.

Flag Post

Actionscript files are cached as compiled .aso files in your LocalData / Flash folder for quicker publishing, and sometimes these files dont get renewed. As a result you get stuck with an older version of your file and no changes seem to take effect.

In Flash 8 and up you can do “Control > Delete ASO Files” specifically to help with this problem. In older versions you have to delete them manually out of the ASO folder (before the Flash IDE integrated this function, someone developed a component to do it automatically and we used to use that or do it by hand). Deleting the ASO files forces Flash to recompile and cache your latest script changes, usually resolving the problem.

Most often this is fixes it, but sometimes it doesnt work though because Flash has a slough of other bizarre compiler issues that you only find through lots of developing.

Flag Post

Right on thanks, that is exactly what I wanted to know!

Flag Post

Cool, no problem ;)