I have a strange bug in a swf I've made. It compiles fine and runs in the Flash standlone app. But it does not play in an开发者_如何学运维y browser player.
Here's how I made it, and then how it breaks:
HOW IT WAS MADE: I make all of the art assets in Flash and compile them to a swc. Then I use Flash Develop to program the app and compile it to a swf. It compiles without error, and runs fine (using the standalone player)
HOW IT BREAKS If I play the same swf in the standalone player, it breaks. Some of the resurces contained in the swc seem not to initialize and the flash player throws errors because I am trying to access properties an methods of null objects.
My questions is: What is happeneing, and how can I fix it. I doubt it is strictly a code error, since it runs fine in the standalone player.
In the standalone I can see properties and classes tracing out. But in the browser players, it traces out null, then throws the errors.
Have you seen this bug? Do you have any ideas?
Without knowing app structure, the only one two ideas coming into my mind.
Timing issue. When you are running you app directly from standalone player (i guess you doing this from your IDE) all assets are loading almost immediately and all works fine, but when you are trying to run app from browser it takes some time to load assets, and you app is calling objects which are not yes loaded, that's why you have nulls. Do you preload your assets before using object from them?
When you compile your .swf you didn't embed .swc into it. You can do this in the compiling/building properties of your IDE.
精彩评论