Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-26 Thread Shade Gmail
On 7/25/06, G [EMAIL PROTECTED] wrote:
 The further problem, as you say here, is I have to
 move the clip around by hand, which eliminates the
 entire reason to use Flex, to try to organize our
 apps in a slightly object-oriented way.

Well, not necessarily. I used a container object to keep it at a depth
and root coordinate system I desired. Then I made it move itself
around by setting its position relative to the container's parent
coordinate space. It was kind of neat -- like a big OOP hack. It's
still a hack -- but it's OO as well. :)

Pity the code isn't mine to show / open. :(

 The other option is to quit and get a job at
 In-and-Out Burgers.  I think I'm going to do that.

Cool. I'll have a 4-by-4 with fries well-done, please. Wow, it's been
a long time since I ordered from the secret menu. :)

Cheers!

   Pedro.


 Yahoo! Groups Sponsor ~-- 
See what's inside the new Yahoo! Groups email.
http://us.click.yahoo.com/3EuRwD/bOaOAA/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/
 





Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-25 Thread hank williams



This is a good suggestion because when you load a swf you *do* have access to all the fields, so there is no reason you cant take a clip within the clip and use it elsewhere. The only thing is you would have to make sure the swf is flash 9 because anything older would be AVM1 and you dont have access to the fields of a AVM1 movieclip from within AVM2.
RegardsHankOn 7/24/06, Shade Gmail [EMAIL PROTECTED] wrote:



Hi,

 In the past I've worked through this kind of thing by loading external .SWFs dynamically and duplicateMovieClip()ing (or moving them) what I needed to the appropriate positions. That was Flash 7. It was ugly, but it worked as long as you didn't need any fancy depth work.


Recently I've done similar stuff in Flash 8 using BitmapData, which works great (and pretty easily too) if you're working with simple bitmap images. Actually, it should work well with generic movieclips as well (see the ... draw() method, I believe. Something like that).


I'm not aware of a Flex way to do what you want. I do hope there is one, it is certainly lacking.

Cheers and good luck,

 Pedro.

On 7/24/06, G 
[EMAIL PROTECTED] wrote:






Hi Jester--Your example here is exactly what we don't want to do.We don't want to embed all the images we need intothe swf--it makes the file size too big.However, we don't want to load the images dynamically
each time we need them--that's too slow.Our application is a game that uses pictures. Playersplay the game for a while with one set of images, thenthey change to a new set of images.What we want is to have something like sets of
images that we can load one time then use repeatedly. So when the player first starts the game, they willget the images from Set1.swf (for example). Then whenit's time to change images, we will load a new set,
Set2.swf, etc.We only want to load the new images one time, becausewe have to change the source property of Image tagsrepeatedly, and this is costly.If you know another way to do this from what I am
asking about, please tell me! But what we arewondering is if it's possible to load a swf containingembedded images, then use those images in the loading(host) swf?Thank you!
Greg--- JesterXL 

[EMAIL PROTECTED] wrote: Don't use SWF's. Flex 1.5  2 have ways to embed them.  [Embed(my1.jpg)] var my1_img:Class;  [Embed(
my1.jpg)] var my2_img:Class;  [Embed(my1.jpg)] var my3_img:Class;  mx:Image id=img source={my1_img} /  Then, have some function swap:
  function swapImage(val) { img.source = val; }  swapImage(my1_img); swapImage(my2_img); swapImage(my3_img);  You could use setInterval, setTimeout, or Timer to
 loop through those...  ...or use a Flash generated SWF; whatever your fancy.  - Original Message -  From: G 

[EMAIL PROTECTED] To: 
flexcoders@yahoogroups.com
 Sent: Saturday, July 22, 2006 11:59 AM Subject: Re: [flexcoders] Anyone know the answer? Embed images in one  MovieClip, use in another?   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 

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-25 Thread G
Thanks.  I believe duplicateMovie doesn't work.  From
the documentation of duplicateMovie:

If you have loaded a movie clip using
MovieClip.loadMovie() or the MovieClipLoader class,
the contents of the SWF file are not duplicated. This
means that you cannot save bandwidth by loading a JPEG
or SWF file and then duplicating the movie clip.

It baffles me why this is not allowed.  Does anyone
know?  My guess is the developers ran into some issues
and decided the easiest way around it was to pretend
it was intended.

The further problem, as you say here, is I have to
move the clip around by hand, which eliminates the
entire reason to use Flex, to try to organize our
apps in a slightly object-oriented way.

I believe Jester said this a day or two as well, that
assets cannot be shared.  I'm starting to feel this is
impossible with a capital I, but it still feels like
there may be some very low-level way to do it--Remote
Shared Libraries?

The other option is to quit and get a job at
In-and-Out Burgers.  I think I'm going to do that.

Greg


--- Shade Gmail [EMAIL PROTECTED] wrote:

 Hi,
 
In the past I've worked through this kind of
 thing by loading external
 .SWFs dynamically and duplicateMovieClip()ing (or
 moving them) what I needed
 to the appropriate positions. That was Flash 7. It
 was ugly, but it worked
 as long as you didn't need any fancy depth work.
 
 Recently I've done similar stuff in Flash 8 using
 BitmapData, which works
 great (and pretty easily too) if you're working with
 simple bitmap images.
 Actually, it should work well with generic
 movieclips as well (see the ...
 draw() method, I believe. Something like that).
 
 I'm not aware of a Flex way to do what you want. I
 do hope there is one,
 it is certainly lacking.
 
 Cheers and good luck,
 
Pedro.
 
 
 On 7/24/06, G [EMAIL PROTECTED] wrote:
 
 Hi Jester--
 
  Your example here is exactly what we don't want to
 do.
  We don't want to embed all the images we need into
  the swf--it makes the file size too big.
 
  However, we don't want to load the images
 dynamically
  each time we need them--that's too slow.
 
  Our application is a game that uses pictures.
 Players
  play the game for a while with one set of images,
 then
  they change to a new set of images.
 
  What we want is to have something like sets of
  images that we can load one time then use
 repeatedly.
  So when the player first starts the game, they
 will
  get the images from Set1.swf (for example). Then
 when
  it's time to change images, we will load a new
 set,
  Set2.swf, etc.
 
  We only want to load the new images one time,
 because
  we have to change the source property of Image
 tags
  repeatedly, and this is costly.
 
  If you know another way to do this from what I am
  asking about, please tell me! But what we are
  wondering is if it's possible to load a swf
 containing
  embedded images, then use those images in the
 loading
  (host) swf?
 
  Thank you!
 
 
  Greg
 
  --- JesterXL [EMAIL PROTECTED]
 jesterxl%40jessewarden.com
  wrote:
 
   Don't use SWF's. Flex 1.5  2 have ways to embed
   them.
  
   [Embed(my1.jpg)]
   var my1_img:Class;
  
   [Embed(my1.jpg)]
   var my2_img:Class;
  
   [Embed(my1.jpg)]
   var my3_img:Class;
  
   mx:Image id=img source={my1_img} /
  
   Then, have some function swap:
  
   function swapImage(val)
   {
   img.source = val;
   }
  
   swapImage(my1_img);
   swapImage(my2_img);
   swapImage(my3_img);
  
   You could use setInterval, setTimeout, or Timer
 to
   loop through those...
  
   ...or use a Flash generated SWF; whatever your
   fancy.
  
   - Original Message -
   From: G [EMAIL PROTECTED]
 greg556%40yahoo.com
   To: flexcoders@yahoogroups.com
 flexcoders%40yahoogroups.com
   Sent: Saturday, July 22, 2006 11:59 AM
   Subject: Re: [flexcoders] Anyone know the
 answer?
   Embed images in one
   MovieClip, use in another?
  
  
   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
   

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-25 Thread JesterXL
The assets can be shared in Flash Player 9, just not 8 and below. 
Unfortunately, you're in the same boat as me and using Flex 1.5, and having 
to deal with Flash + Flex; I know, it's rough.

Yahoo yuked on itself last night, so not sure if you ever got your remote 
shared libraries to work?

- Original Message - 
From: G [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Tuesday, July 25, 2006 11:25 AM
Subject: Re: [flexcoders] Anyone know the answer? Embed images in one 
MovieClip, use in another?


Thanks.  I believe duplicateMovie doesn't work.  From
the documentation of duplicateMovie:

If you have loaded a movie clip using
MovieClip.loadMovie() or the MovieClipLoader class,
the contents of the SWF file are not duplicated. This
means that you cannot save bandwidth by loading a JPEG
or SWF file and then duplicating the movie clip.

It baffles me why this is not allowed.  Does anyone
know?  My guess is the developers ran into some issues
and decided the easiest way around it was to pretend
it was intended.

The further problem, as you say here, is I have to
move the clip around by hand, which eliminates the
entire reason to use Flex, to try to organize our
apps in a slightly object-oriented way.

I believe Jester said this a day or two as well, that
assets cannot be shared.  I'm starting to feel this is
impossible with a capital I, but it still feels like
there may be some very low-level way to do it--Remote
Shared Libraries?

The other option is to quit and get a job at
In-and-Out Burgers.  I think I'm going to do that.

Greg


--- Shade Gmail [EMAIL PROTECTED] wrote:

 Hi,

In the past I've worked through this kind of
 thing by loading external
 .SWFs dynamically and duplicateMovieClip()ing (or
 moving them) what I needed
 to the appropriate positions. That was Flash 7. It
 was ugly, but it worked
 as long as you didn't need any fancy depth work.

 Recently I've done similar stuff in Flash 8 using
 BitmapData, which works
 great (and pretty easily too) if you're working with
 simple bitmap images.
 Actually, it should work well with generic
 movieclips as well (see the ...
 draw() method, I believe. Something like that).

 I'm not aware of a Flex way to do what you want. I
 do hope there is one,
 it is certainly lacking.

 Cheers and good luck,

Pedro.


 On 7/24/06, G [EMAIL PROTECTED] wrote:
 
 Hi Jester--
 
  Your example here is exactly what we don't want to
 do.
  We don't want to embed all the images we need into
  the swf--it makes the file size too big.
 
  However, we don't want to load the images
 dynamically
  each time we need them--that's too slow.
 
  Our application is a game that uses pictures.
 Players
  play the game for a while with one set of images,
 then
  they change to a new set of images.
 
  What we want is to have something like sets of
  images that we can load one time then use
 repeatedly.
  So when the player first starts the game, they
 will
  get the images from Set1.swf (for example). Then
 when
  it's time to change images, we will load a new
 set,
  Set2.swf, etc.
 
  We only want to load the new images one time,
 because
  we have to change the source property of Image
 tags
  repeatedly, and this is costly.
 
  If you know another way to do this from what I am
  asking about, please tell me! But what we are
  wondering is if it's possible to load a swf
 containing
  embedded images, then use those images in the
 loading
  (host) swf?
 
  Thank you!
 
 
  Greg
 
  --- JesterXL [EMAIL PROTECTED]
 jesterxl%40jessewarden.com
  wrote:
 
   Don't use SWF's. Flex 1.5  2 have ways to embed
   them.
  
   [Embed(my1.jpg)]
   var my1_img:Class;
  
   [Embed(my1.jpg)]
   var my2_img:Class;
  
   [Embed(my1.jpg)]
   var my3_img:Class;
  
   mx:Image id=img source={my1_img} /
  
   Then, have some function swap:
  
   function swapImage(val)
   {
   img.source = val;
   }
  
   swapImage(my1_img);
   swapImage(my2_img);
   swapImage(my3_img);
  
   You could use setInterval, setTimeout, or Timer
 to
   loop through those...
  
   ...or use a Flash generated SWF; whatever your
   fancy.
  
   - Original Message -
   From: G [EMAIL PROTECTED]
 greg556%40yahoo.com
   To: flexcoders@yahoogroups.com
 flexcoders%40yahoogroups.com
   Sent: Saturday, July 22, 2006 11:59 AM
   Subject: Re: [flexcoders] Anyone know the
 answer?
   Embed images in one
   MovieClip, use in another?
  
  
   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 

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-25 Thread hank williams



I dont think they are using 1.5 (at least I dont see it in the thread). If they are using 2.0 I dont understand why it wouldnt work, because you should have full access to imported clips and their children. I dont have time to try this today, but I dont get the problem they are having with the latest idea.
HankOn 7/25/06, JesterXL [EMAIL PROTECTED] wrote:
The assets can be shared in Flash Player 9, just not 8 and below.Unfortunately, you're in the same boat as me and using Flex 1.5, and havingto deal with Flash + Flex; I know, it's rough.Yahoo yuked on itself last night, so not sure if you ever got your remote
shared libraries to work?- Original Message -From: G [EMAIL PROTECTED]To: flexcoders@yahoogroups.com
Sent: Tuesday, July 25, 2006 11:25 AMSubject: Re: [flexcoders] Anyone know the answer? Embed images in oneMovieClip, use in another?Thanks.I believe duplicateMovie doesn't work.From
the documentation of duplicateMovie:If you have loaded a movie clip usingMovieClip.loadMovie() or the MovieClipLoader class,the contents of the SWF file are not duplicated. Thismeans that you cannot save bandwidth by loading a JPEG
or SWF file and then duplicating the movie clip.It baffles me why this is not allowed.Does anyoneknow?My guess is the developers ran into some issuesand decided the easiest way around it was to pretend
it was intended.The further problem, as you say here, is I have tomove the clip around by hand, which eliminates theentire reason to use Flex, to try to organize ourapps in a slightly object-oriented way.
I believe Jester said this a day or two as well, thatassets cannot be shared.I'm starting to feel this isimpossible with a capital I, but it still feels likethere may be some very low-level way to do it--Remote
Shared Libraries?The other option is to quit and get a job atIn-and-Out Burgers.I think I'm going to do that.Greg--- Shade Gmail [EMAIL PROTECTED]
 wrote: Hi,In the past I've worked through this kind of thing by loading external .SWFs dynamically and duplicateMovieClip()ing (or moving them) what I needed
 to the appropriate positions. That was Flash 7. It was ugly, but it worked as long as you didn't need any fancy depth work. Recently I've done similar stuff in Flash 8 using BitmapData, which works
 great (and pretty easily too) if you're working with simple bitmap images. Actually, it should work well with generic movieclips as well (see the ... draw() method, I believe. Something like that).
 I'm not aware of a Flex way to do what you want. I do hope there is one, it is certainly lacking. Cheers and good luck,Pedro.
 On 7/24/06, G [EMAIL PROTECTED] wrote:  Hi Jester--   Your example here is exactly what we don't want to do.
  We don't want to embed all the images we need into  the swf--it makes the file size too big.   However, we don't want to load the images dynamically  each time we need them--that's too slow.
   Our application is a game that uses pictures. Players  play the game for a while with one set of images, then  they change to a new set of images. 
  What we want is to have something like sets of  images that we can load one time then use repeatedly.  So when the player first starts the game, they will
  get the images from Set1.swf (for example). Then when  it's time to change images, we will load a new set,  Set2.swf, etc.   We only want to load the new images one time,
 because  we have to change the source property of Image tags  repeatedly, and this is costly.   If you know another way to do this from what I am  asking about, please tell me! But what we are
  wondering is if it's possible to load a swf containing  embedded images, then use those images in the loading  (host) swf?   Thank you! 
   Greg   --- JesterXL [EMAIL PROTECTED] jesterxl%40jessewarden.com  wrote: 
   Don't use SWF's. Flex 1.5  2 have ways to embed   them. [Embed(my1.jpg)]   var my1_img:Class; [Embed(
my1.jpg)]   var my2_img:Class; [Embed(my1.jpg)]   var my3_img:Class; mx:Image id=img source={my1_img} /
 Then, have some function swap: function swapImage(val)   {   img.source = val;   }  
   swapImage(my1_img);   swapImage(my2_img);   swapImage(my3_img); You could use setInterval, setTimeout, or Timer to   loop through those...
 ...or use a Flash generated SWF; whatever your   fancy. - Original Message -   From: G 
[EMAIL PROTECTED] greg556%40yahoo.com   To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com   Sent: Saturday, July 22, 2006 11:59 AM
   Subject: Re: [flexcoders] Anyone know the answer?   Embed images in one   MovieClip, use in another?   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 

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-25 Thread G
 Yahoo yuked on itself last night, so not sure if you
 ever got your remote 
 shared libraries to work?

No, I was waiting to hear more from you about how to
do it.  Based on your previous emails and those links
I now understand how attachMovie works (in conjunction
with Object.registerClass) and I can manipulate those
well (it's a pain because there's no error message if
you get the linkage name wrong!).  But I'm not sure
what to do to explore remote shared libraries.

It's nice to hear Flash 9 fixes this problem, but
that's not something we will be allowed to take
advantage of for a long time, until we can be
confident most of our users have switched.

Thanks,


Greg



 
 - Original Message - 
 From: G [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Tuesday, July 25, 2006 11:25 AM
 Subject: Re: [flexcoders] Anyone know the answer?
 Embed images in one 
 MovieClip, use in another?
 
 
 Thanks.  I believe duplicateMovie doesn't work. 
 From
 the documentation of duplicateMovie:
 
 If you have loaded a movie clip using
 MovieClip.loadMovie() or the MovieClipLoader class,
 the contents of the SWF file are not duplicated.
 This
 means that you cannot save bandwidth by loading a
 JPEG
 or SWF file and then duplicating the movie clip.
 
 It baffles me why this is not allowed.  Does anyone
 know?  My guess is the developers ran into some
 issues
 and decided the easiest way around it was to pretend
 it was intended.
 
 The further problem, as you say here, is I have to
 move the clip around by hand, which eliminates the
 entire reason to use Flex, to try to organize our
 apps in a slightly object-oriented way.
 
 I believe Jester said this a day or two as well,
 that
 assets cannot be shared.  I'm starting to feel this
 is
 impossible with a capital I, but it still feels like
 there may be some very low-level way to do
 it--Remote
 Shared Libraries?
 
 The other option is to quit and get a job at
 In-and-Out Burgers.  I think I'm going to do that.
 
 Greg
 
 
 --- Shade Gmail [EMAIL PROTECTED] wrote:
 
  Hi,
 
 In the past I've worked through this kind of
  thing by loading external
  .SWFs dynamically and duplicateMovieClip()ing (or
  moving them) what I needed
  to the appropriate positions. That was Flash 7. It
  was ugly, but it worked
  as long as you didn't need any fancy depth work.
 
  Recently I've done similar stuff in Flash 8 using
  BitmapData, which works
  great (and pretty easily too) if you're working
 with
  simple bitmap images.
  Actually, it should work well with generic
  movieclips as well (see the ...
  draw() method, I believe. Something like that).
 
  I'm not aware of a Flex way to do what you want.
 I
  do hope there is one,
  it is certainly lacking.
 
  Cheers and good luck,
 
 Pedro.
 
 
  On 7/24/06, G [EMAIL PROTECTED] wrote:
  
  Hi Jester--
  
   Your example here is exactly what we don't want
 to
  do.
   We don't want to embed all the images we need
 into
   the swf--it makes the file size too big.
  
   However, we don't want to load the images
  dynamically
   each time we need them--that's too slow.
  
   Our application is a game that uses pictures.
  Players
   play the game for a while with one set of
 images,
  then
   they change to a new set of images.
  
   What we want is to have something like sets of
   images that we can load one time then use
  repeatedly.
   So when the player first starts the game, they
  will
   get the images from Set1.swf (for example). Then
  when
   it's time to change images, we will load a new
  set,
   Set2.swf, etc.
  
   We only want to load the new images one time,
  because
   we have to change the source property of Image
  tags
   repeatedly, and this is costly.
  
   If you know another way to do this from what I
 am
   asking about, please tell me! But what we are
   wondering is if it's possible to load a swf
  containing
   embedded images, then use those images in the
  loading
   (host) swf?
  
   Thank you!
  
  
   Greg
  
   --- JesterXL [EMAIL PROTECTED]
  jesterxl%40jessewarden.com
   wrote:
  
Don't use SWF's. Flex 1.5  2 have ways to
 embed
them.
   
[Embed(my1.jpg)]
var my1_img:Class;
   
[Embed(my1.jpg)]
var my2_img:Class;
   
[Embed(my1.jpg)]
var my3_img:Class;
   
mx:Image id=img source={my1_img} /
   
Then, have some function swap:
   
function swapImage(val)
{
img.source = val;
}
   
swapImage(my1_img);
swapImage(my2_img);
swapImage(my3_img);
   
You could use setInterval, setTimeout, or
 Timer
  to
loop through those...
   
...or use a Flash generated SWF; whatever your
fancy.
   
- Original Message -
From: G [EMAIL PROTECTED]
  greg556%40yahoo.com
To: flexcoders@yahoogroups.com
  flexcoders%40yahoogroups.com
Sent: Saturday, July 22, 2006 11:59 AM
Subject: Re: [flexcoders] Anyone know the
  answer?
Embed images in one
MovieClip, use in another?
   
   
This 

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-25 Thread JesterXL
Hah!  I don't care what anyone says, the Flex 1.5 docs are good.

http://livedocs.macromedia.com/flex/15/flex_docs_en/1157.htm

- Original Message - 
From: G [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Tuesday, July 25, 2006 2:00 PM
Subject: Re: [flexcoders] Anyone know the answer? Embed images in one 
MovieClip, use in another?


 Yahoo yuked on itself last night, so not sure if you
 ever got your remote
 shared libraries to work?

No, I was waiting to hear more from you about how to
do it.  Based on your previous emails and those links
I now understand how attachMovie works (in conjunction
with Object.registerClass) and I can manipulate those
well (it's a pain because there's no error message if
you get the linkage name wrong!).  But I'm not sure
what to do to explore remote shared libraries.

It's nice to hear Flash 9 fixes this problem, but
that's not something we will be allowed to take
advantage of for a long time, until we can be
confident most of our users have switched.

Thanks,


Greg




 - Original Message - 
 From: G [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Tuesday, July 25, 2006 11:25 AM
 Subject: Re: [flexcoders] Anyone know the answer?
 Embed images in one
 MovieClip, use in another?


 Thanks.  I believe duplicateMovie doesn't work.
 From
 the documentation of duplicateMovie:

 If you have loaded a movie clip using
 MovieClip.loadMovie() or the MovieClipLoader class,
 the contents of the SWF file are not duplicated.
 This
 means that you cannot save bandwidth by loading a
 JPEG
 or SWF file and then duplicating the movie clip.

 It baffles me why this is not allowed.  Does anyone
 know?  My guess is the developers ran into some
 issues
 and decided the easiest way around it was to pretend
 it was intended.

 The further problem, as you say here, is I have to
 move the clip around by hand, which eliminates the
 entire reason to use Flex, to try to organize our
 apps in a slightly object-oriented way.

 I believe Jester said this a day or two as well,
 that
 assets cannot be shared.  I'm starting to feel this
 is
 impossible with a capital I, but it still feels like
 there may be some very low-level way to do
 it--Remote
 Shared Libraries?

 The other option is to quit and get a job at
 In-and-Out Burgers.  I think I'm going to do that.

 Greg


 --- Shade Gmail [EMAIL PROTECTED] wrote:

  Hi,
 
 In the past I've worked through this kind of
  thing by loading external
  .SWFs dynamically and duplicateMovieClip()ing (or
  moving them) what I needed
  to the appropriate positions. That was Flash 7. It
  was ugly, but it worked
  as long as you didn't need any fancy depth work.
 
  Recently I've done similar stuff in Flash 8 using
  BitmapData, which works
  great (and pretty easily too) if you're working
 with
  simple bitmap images.
  Actually, it should work well with generic
  movieclips as well (see the ...
  draw() method, I believe. Something like that).
 
  I'm not aware of a Flex way to do what you want.
 I
  do hope there is one,
  it is certainly lacking.
 
  Cheers and good luck,
 
 Pedro.
 
 
  On 7/24/06, G [EMAIL PROTECTED] wrote:
  
  Hi Jester--
  
   Your example here is exactly what we don't want
 to
  do.
   We don't want to embed all the images we need
 into
   the swf--it makes the file size too big.
  
   However, we don't want to load the images
  dynamically
   each time we need them--that's too slow.
  
   Our application is a game that uses pictures.
  Players
   play the game for a while with one set of
 images,
  then
   they change to a new set of images.
  
   What we want is to have something like sets of
   images that we can load one time then use
  repeatedly.
   So when the player first starts the game, they
  will
   get the images from Set1.swf (for example). Then
  when
   it's time to change images, we will load a new
  set,
   Set2.swf, etc.
  
   We only want to load the new images one time,
  because
   we have to change the source property of Image
  tags
   repeatedly, and this is costly.
  
   If you know another way to do this from what I
 am
   asking about, please tell me! But what we are
   wondering is if it's possible to load a swf
  containing
   embedded images, then use those images in the
  loading
   (host) swf?
  
   Thank you!
  
  
   Greg
  
   --- JesterXL [EMAIL PROTECTED]
  jesterxl%40jessewarden.com
   wrote:
  
Don't use SWF's. Flex 1.5  2 have ways to
 embed
them.
   
[Embed(my1.jpg)]
var my1_img:Class;
   
[Embed(my1.jpg)]
var my2_img:Class;
   
[Embed(my1.jpg)]
var my3_img:Class;
   
mx:Image id=img source={my1_img} /
   
Then, have some function swap:
   
function swapImage(val)
{
img.source = val;
}
   
swapImage(my1_img);
swapImage(my2_img);
swapImage(my3_img);
   
You could use setInterval, setTimeout, or
 Timer
  to
loop through those...
   
...or use a Flash generated SWF; whatever 

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-25 Thread Pan Troglodytes



It's probably a moot point due to some of the other stuff you mentioned later, but flash.display.Bitmap has some interesting example code to dynamically load an image from a url and then duplicate it.
On 7/24/06, G [EMAIL PROTECTED] wrote:
Hi Jester--Your example here is exactly what we don't want to do. We don't want to embed all the images we need intothe swf--it makes the file size too big.However, we don't want to load the images dynamically
each time we need them--that's too slow.Our application is a game that uses pictures.Playersplay the game for a while with one set of images, thenthey change to a new set of images.What we want is to have something like sets of
images that we can load one time then use repeatedly.So when the player first starts the game, they willget the images from Set1.swf (for example).Then whenit's time to change images, we will load a new set,
Set2.swf, etc.We only want to load the new images one time, becausewe have to change the source property of Image tagsrepeatedly, and this is costly.If you know another way to do this from what I am
asking about, please tell me!But what we arewondering is if it's possible to load a swf containingembedded images, then use those images in the loading(host) swf?Thank you!Greg
--- JesterXL [EMAIL PROTECTED] wrote: Don't use SWF's.Flex 1.5  2 have ways to embed them. [Embed(my1.jpg
)] var my1_img:Class; [Embed(my1.jpg)] var my2_img:Class; [Embed(my1.jpg)] var my3_img:Class; mx:Image id=img source={my1_img} /
 Then, have some function swap: function swapImage(val) { img.source = val; } swapImage(my1_img); swapImage(my2_img); swapImage(my3_img);
 You could use setInterval, setTimeout, or Timer to loop through those... ...or use a Flash generated SWF; whatever your fancy. - Original Message -
 From: G [EMAIL PROTECTED] To: flexcoders@yahoogroups.com Sent: Saturday, July 22, 2006 11:59 AM
 Subject: Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another? 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
  

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-24 Thread G
Hi Jester--

Your example here is exactly what we don't want to do.
 We don't want to embed all the images we need into
the swf--it makes the file size too big.

However, we don't want to load the images dynamically
each time we need them--that's too slow.

Our application is a game that uses pictures.  Players
play the game for a while with one set of images, then
they change to a new set of images.

What we want is to have something like sets of
images that we can load one time then use repeatedly. 
So when the player first starts the game, they will
get the images from Set1.swf (for example).  Then when
it's time to change images, we will load a new set,
Set2.swf, etc.

We only want to load the new images one time, because
we have to change the source property of Image tags
repeatedly, and this is costly.

If you know another way to do this from what I am
asking about, please tell me!  But what we are
wondering is if it's possible to load a swf containing
embedded images, then use those images in the loading
(host) swf?

Thank you!


Greg



--- JesterXL [EMAIL PROTECTED] wrote:

 Don't use SWF's.  Flex 1.5  2 have ways to embed
 them.
 
 [Embed(my1.jpg)]
 var my1_img:Class;
 
 [Embed(my1.jpg)]
 var my2_img:Class;
 
 [Embed(my1.jpg)]
 var my3_img:Class;
 
 mx:Image id=img source={my1_img} /
 
 Then, have some function swap:
 
 function swapImage(val)
 {
 img.source = val;
 }
 
 swapImage(my1_img);
 swapImage(my2_img);
 swapImage(my3_img);
 
 You could use setInterval, setTimeout, or Timer to
 loop through those...
 
 ...or use a Flash generated SWF; whatever your
 fancy.
 
 - Original Message - 
 From: G [EMAIL PROTECTED]
 To: flexcoders@yahoogroups.com
 Sent: Saturday, July 22, 2006 11:59 AM
 Subject: Re: [flexcoders] Anyone know the answer?
 Embed images in one 
 MovieClip, use in another?
 
 
 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 

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-24 Thread hank williams



Yes you can.Here's how I do it.  [Embed(source='../assets/assets.swf', symbol='someSymbol')]  public var anImage:Class; someSymbolis the name of the symbol in the swf which is called 
assets.swf.the anImage variable is the graphic, and can be used wherever you need an image.RegardsHankOn 7/24/06, G 
[EMAIL PROTECTED] wrote:Hi Jester--Your example here is exactly what we don't want to do.
 We don't want to embed all the images we need intothe swf--it makes the file size too big.However, we don't want to load the images dynamicallyeach time we need them--that's too slow.Our application is a game that uses pictures.Players
play the game for a while with one set of images, thenthey change to a new set of images.What we want is to have something like sets ofimages that we can load one time then use repeatedly.
So when the player first starts the game, they willget the images from Set1.swf (for example).Then whenit's time to change images, we will load a new set,Set2.swf, etc.We only want to load the new images one time, because
we have to change the source property of Image tagsrepeatedly, and this is costly.If you know another way to do this from what I amasking about, please tell me!But what we arewondering is if it's possible to load a swf containing
embedded images, then use those images in the loading(host) swf?Thank you!Greg--- JesterXL [EMAIL PROTECTED] wrote:
 Don't use SWF's.Flex 1.5  2 have ways to embed them. [Embed(my1.jpg)] var my1_img:Class; [Embed(my1.jpg)] var my2_img:Class;
 [Embed(my1.jpg)] var my3_img:Class; mx:Image id=img source={my1_img} / Then, have some function swap: function swapImage(val)
 { img.source = val; } swapImage(my1_img); swapImage(my2_img); swapImage(my3_img); You could use setInterval, setTimeout, or Timer to loop through those...
 ...or use a Flash generated SWF; whatever your fancy. - Original Message - From: G [EMAIL PROTECTED] To: 
flexcoders@yahoogroups.com Sent: Saturday, July 22, 2006 11:59 AM Subject: Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?
 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 

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-24 Thread hank williams



Oops.Just re-read your post. I see you want to dynamically load the swf.I have to think about that.RegardsHankOn 7/24/06, hank williams
 [EMAIL PROTECTED] wrote:Yes you can.
Here's how I do it.  [Embed(source='../assets/assets.swf', symbol='someSymbol')]  public var anImage:Class; someSymbolis the name of the symbol in the swf which is called 
assets.swf.the anImage variable is the graphic, and can be used wherever you need an image.RegardsHank
On 7/24/06, G 
[EMAIL PROTECTED] wrote:Hi Jester--Your example here is exactly what we don't want to do.
 We don't want to embed all the images we need intothe swf--it makes the file size too big.However, we don't want to load the images dynamicallyeach time we need them--that's too slow.Our application is a game that uses pictures.Players
play the game for a while with one set of images, thenthey change to a new set of images.What we want is to have something like sets ofimages that we can load one time then use repeatedly.

So when the player first starts the game, they willget the images from Set1.swf (for example).Then whenit's time to change images, we will load a new set,Set2.swf, etc.We only want to load the new images one time, because
we have to change the source property of Image tagsrepeatedly, and this is costly.If you know another way to do this from what I amasking about, please tell me!But what we arewondering is if it's possible to load a swf containing
embedded images, then use those images in the loading(host) swf?Thank you!Greg--- JesterXL 
[EMAIL PROTECTED] wrote:
 Don't use SWF's.Flex 1.5  2 have ways to embed them. [Embed(my1.jpg)] var my1_img:Class; [Embed(my1.jpg)] var my2_img:Class;

 [Embed(my1.jpg)] var my3_img:Class; mx:Image id=img source={my1_img} / Then, have some function swap: function swapImage(val)
 { img.source = val; } swapImage(my1_img); swapImage(my2_img); swapImage(my3_img); You could use setInterval, setTimeout, or Timer to loop through those...
 ...or use a Flash generated SWF; whatever your fancy. - Original Message - From: G 
[EMAIL PROTECTED] To: 
flexcoders@yahoogroups.com Sent: Saturday, July 22, 2006 11:59 AM
 Subject: Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?
 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 /  

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-24 Thread Shade Gmail



Hi,

 In the past I've worked through this kind of thing by loading external .SWFs dynamically and duplicateMovieClip()ing (or moving them) what I needed to the appropriate positions. That was Flash 7. It was ugly, but it worked as long as you didn't need any fancy depth work.


Recently I've done similar stuff in Flash 8 using BitmapData, which works great (and pretty easily too) if you're working with simple bitmap images. Actually, it should work well with generic movieclips as well (see the ... draw() method, I believe. Something like that).


I'm not aware of a Flex way to do what you want. I do hope there is one, it is certainly lacking.

Cheers and good luck,

 Pedro.

On 7/24/06, G [EMAIL PROTECTED] wrote:






Hi Jester--Your example here is exactly what we don't want to do.We don't want to embed all the images we need intothe swf--it makes the file size too big.However, we don't want to load the images dynamically
each time we need them--that's too slow.Our application is a game that uses pictures. Playersplay the game for a while with one set of images, thenthey change to a new set of images.What we want is to have something like sets of
images that we can load one time then use repeatedly. So when the player first starts the game, they willget the images from Set1.swf (for example). Then whenit's time to change images, we will load a new set,
Set2.swf, etc.We only want to load the new images one time, becausewe have to change the source property of Image tagsrepeatedly, and this is costly.If you know another way to do this from what I am
asking about, please tell me! But what we arewondering is if it's possible to load a swf containingembedded images, then use those images in the loading(host) swf?Thank you!
Greg--- JesterXL 
[EMAIL PROTECTED] wrote: Don't use SWF's. Flex 1.5  2 have ways to embed them.  [Embed(my1.jpg)] var my1_img:Class;  [Embed(
my1.jpg)] var my2_img:Class;  [Embed(my1.jpg)] var my3_img:Class;  mx:Image id=img source={my1_img} /  Then, have some function swap:
  function swapImage(val) { img.source = val; }  swapImage(my1_img); swapImage(my2_img); swapImage(my3_img);  You could use setInterval, setTimeout, or Timer to
 loop through those...  ...or use a Flash generated SWF; whatever your fancy.  - Original Message -  From: G 
[EMAIL PROTECTED] To: flexcoders@yahoogroups.com
 Sent: Saturday, July 22, 2006 11:59 AM Subject: Re: [flexcoders] Anyone know the answer? Embed images in one  MovieClip, use in another?   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  

Re: [flexcoders] Anyone know the answer? Embed images in one MovieClip, use in another?

2006-07-23 Thread G
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/