Reputation: 19026
Here's the scenario:
Our creative team produces SWF animations in the Flash CS5 authoring tool that we (the engineers) load at runtime into a project built using the Flex SDK. Animations that don't use the "3D rotation tool" work just fine.
Animations that use the 3D rotation tool give the following behavior:
Both 3D and non-3D animations play fine when loaded by themselves in a browser tab or the standalone flash player. 3D is only broken when loaded into our code generated SWF.
So it seems that for MovieClips with 3D transformations applied in the CS5 authoring environment, those transformations aren't being applied / respected when the SWF is loaded by our code SWF.
This is my first foray into 3D, so I'm not sure what could be causing this, but here's what I've tested / checked / tried, all to no avail:
I'm hoping there's some simple trick, some setup I'm missing. Thanks for your help!
Upvotes: 2
Views: 769
Reputation: 19026
I can't post code, but it turns out it was an overly cautious subtlety in our loader code that had never caught us before:
We have a custom class that loads all images for us (including a few utilities and common functionality built in). On load complete, this code took the loader.content, added it as a child to itself, and -- here's the kicker -- cleaned up the no-longer-necessary loader using close() and unloadAndStop().
I suppose it seemed rational to cleanup the loader in this way, and it has always worked until now (with static images, static SWFs, and SWF animations), but it caused the above issue upon loading 3D swfs (and it turns out this also caused odd URL not found errors on loading video SWFs).
Disabling the overly cautious Loader cleanup fixed my problem.
Upvotes: 0
Reputation: 8068
I came across your problem because I had exactly the same issue... And after a lot of poking around, the solution (for me) boiled down to this:
If, at any point, you are strong-typing your CHILD swf to a class, or referring to any of its variables using dot syntax from the PARENT, it breaks. Even if it's just a trace message.
I had to replace this:
var stoneVideo:StoneVideo = loader.content as StoneVideo;
stoneVideo.stoneText = model.stoneText;
With this:
loader.content["stoneText"] = model.stoneText;
And it started working properly. Hope this helps!
Upvotes: 0
Reputation: 2649
This may be something that is going on in your Flex code, such as stopping the animations, or not starting them. Can you post the code that you use to load the SWFs?
This may be a race condition, too. You may have to wait until the SWFs are loaded (e.g., addedToStage events or the like) before using them.
Upvotes: 0