Can't access media assets in an SWC
Posted
by
Sold Out Activist
on Stack Overflow
See other posts from Stack Overflow
or by Sold Out Activist
Published on 2011-02-19T23:54:52Z
Indexed on
2011/02/20
7:25 UTC
Read the original article
Hit count: 181
I'm having trouble accessing content in an SWC. The main project compiles without error, but the assets (sound, music) aren't displayed or played.
My workflow:
i. Using Flash CS5
1. Create MAsset.fla
2. Import sounds, art
3. Assign class names, check export in frame 1
4a. Write out the classes in the actions panel in frame 1
4b. OR. Add a document class and write out the classes there
5. Export SWC. Filesize is similar to what it is when I directly import assets in the main project library.
6. Create Project.fla and document class Project.as
7. Import SWC into main project through the Actionscript panel.
8. Add code, which calls the class names from the SWC (e.g. DCL_UI_MOUSE)
9. Compile.
No compiler errors, but nothing doing. And the resulting SWF filesize doesn't reflect anything more than the compiled code from the main project.
Regarding step 4, if I just write the class name in the root timeline or document class, the compiler error will go away and the asset appear to be compiled in the SWC. But I have also tried:
var asset0000:DCL_UI_MOUSE;
And:
var asset0000:DCL_UI_MOUSE = new DCL_UI_MOUSE();
Regardless the assets don't make it into the final SWF.
What am I doing wrong?
© Stack Overflow or respective owner