I'm trying to add assets into a flex library .swc file with no success.
The assets folder in the library project contains a gif file. The project also contains a Spark Group componnent that displays the image.
When i try to use this componnent in a different project the image is not visible. If i copy the assets folder from the library project to the main project the image is visible.
I added the assets folder in the Flex Library Build Path
Why aren't the assets contained by the swc?
Thank you!
Attached screenshots:
Create class in library project
package resources
{
public final class IconResource
{
//list embedded items - you can embed any files, mp3 etc
[Embed (source="../assets/facebook.gif" )]
public static const icon_facebook:Class;
public function IconResource()
{}
}
}
Using in production projects:
import resources.IconResource;
var img:Image = new Image();
img.source = IconResource.icon_facebook;
or
<fx:Script>
<![CDATA[
import resources.IconResource;
]]>
</fx:Script>
<s:Image source="{IconResource.icon_facebook}"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With