Did you actually include-file com/bmc/assets/myimage.png? That is the
only way that file will be inside the SWC. But in any case, that's
irrelevant.
Do you really want it to be runtime-loaded and not embedded? You could
use @Embed(source='com/bmv/assets/myimage.png') to transcode and embed
it at compile time.
But at any rate, you can't put a runtime asset inside a SWC. You need
it extracted out in a directory that is in a location where the player
can download it. SWCs are for compile-time only - the player doesn't
know anything about the format.
-rg
________________________________
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of jgraham_us
Sent: Thursday, November 30, 2006 1:40 PM
To: [email protected]
Subject: [flexcoders] Re: how to access assets in RSL file
To give more details on the problem.
Basically I have a Flex Library Project called for example
TestLib.swc this has a flex component in it called MyComp.mxml.
In this component I have a SWFLoader that points to an asset in
the
same SWC file. I refer to it via
url="com/bmc/assets/myimage.png"
When I create a Flex project that includes TestLib.swc and uses
MyComp.mxml, myimage.png is never found.
I have a component which needs to dynamically load images at
runtime
and this component is in a SWC file. I want to use this
component
in my flex applications, but alas the images just don't show up.
Any ideas?
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , "Roger Gonzalez" <[EMAIL PROTECTED]>
wrote:
>
> SWC files are used at compile time. SWFLoader is runtime.
Won't
work.
>
> (Note that if you caused MyTest.swf to be embedded instead of
included
> when you built TestLib.swc, you can then refer to it as a
class
from
> your main project, and just instantiate an object of type
SpriteAsset,
> MovieClipAsset, or MovieClipLoaderAsset, depending on how you
embedded
> it.)
>
> -rg
>
>
> ________________________________
>
> From: [email protected]
<mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected]
<mailto:flexcoders%40yahoogroups.com> ] On Behalf Of jgraham_us
> Sent: Thursday, November 30, 2006 12:15 PM
> To: [email protected]
<mailto:flexcoders%40yahoogroups.com>
> Subject: [flexcoders] how to access assets in RSL file
>
>
>
> Not sure what I am doing wrong here, I would think this would
> work.
>
> I have a Flex Library project called that builds to
TestLib.swc,
> this
> swc has several components and some common assets which are
SWF
> files.
>
> So for example in this swc I have com/x/y/z/MyTest.swf.
>
> I then have a Flex project which uses this SWC file. I
attempt
> to use
> SWFLoader with URL="com/x/y/MyTest.swf"
>
> This doesn't work, I have tried a ton of other ways to access
> the SWF
> thats in the SWC file.
>
> Whats the correct way to access assets in the SWC file?
>
> Thanks
>