This line:

<mx:Loader id="container" source="Container.swf" />

does not load a swf file containing the embedded image
into my application?  That is news to me.

The reason I want to do it is irrelevant to my
question, but here it is:  We have an animation that
loads many images at once (external images).  Even
with the images in the browser's cache it is
drastically slowing down the application.

That embedded images are not loaded is exactly the
point.  We want to load a swf with several images
embedded in it, then use those images in the
animation.  The point is, we want to load the images
dynamically (externally), but not every time we change
the source of Image.  Just one time, ahead of time.

Since when an Image "loads" an embedded image, we are
not actually loading it at all, we are hoping we can
load the container swf one time, then use its images
as embedded images--thus avoiding the immediate load
time every time we change source.

What we want to do, in a nutshell, is load images
dynamically, but all at once, and then just attach
them from that moment on.

The question is, can we attach an image embedded in
the container swf into the loader swf, avoiding the
external image load?  HOW?  The relationship between
attachMovie and Image is very murky.

An example, perhaps based on the code below, would be
very nice, very helpful.  You seem to know a lot about
Flex and Flash, can you help, please?

Thanks,


Greg


--- JesterXL <[EMAIL PROTECTED]> wrote:

> If you embed an image, you're not "loading"
> anything; it's merely attaching 
> the img Class to your MovieClip's DisplayList (
> attachMovie in 1.5).  Thus 
> there is no point; just bind them all to img since
> they are all using the 
> same resource.
> 
> External images are a different story.
> 
> ----- Original Message ----- 
> From: "greg556" <[EMAIL PROTECTED]>
> To: <flexcoders@yahoogroups.com>
> Sent: Friday, July 21, 2006 7:08 PM
> Subject: [flexcoders] Embed images in one MovieClip,
> use in another?
> 
> 
> Hi everyone--
> 
> Is it possible to embed images (jpgs) in one
> MovieClip, then load that
> SWF into another MovieClip and use those images in
> the loader? We are
> trying to avoid reloading an image each time we need
> it, but still
> load them dynamically. We'd like to do this: (We're
> using Flex, but
> this is really an AS question I think, about
> accessing resources from
> one SWF in another SWF). This example is in Flex,
> but the real work, I
> expect, is in AS. If you can tell me how to do it in
> AS, I can get it
> working in flex.)
> 
> Container.swf:
> <mx:Application>
> <mx:Script>
> [Embed(source="images/myimage.jpg")]
> public var img: String;
> </mx:Script>
> </mx:Application>
> 
> Then, load that SWF and use its embedded image:
> 
> Loader.swf:
> <mx:Application>
> <mx:Loader id="container" source="Container.swf" />
> <mx:HBox>
> <mx:Image id="the_image"
> source="container.content.img" />
> </mx:HBox>
> </mx:Application>
> 
> It looks like this should work, and the "resource"
> string is properly
> being passed to the_image (something like
> __Resource.43234564.myimage_jpg) but it cannot
> actually load; we get a
> broken image instead.
> 
> I'm guessing I somehow need to register the object
> library of the
> Container.swf with my Loader.swf? How?
> 
> Or, is this whole enterprise impossible?
> 
> Thank you!
> 
> 
> 
> Greg
> 
> 
> 
> 
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ:
>
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
>
http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Check out the new improvements in Yahoo! Groups email.
http://us.click.yahoo.com/6pRQfA/fOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to