You probably don't want to do it that way.

Embed is a compile-time construct to get things into the SWF.  You can't
dynamically change what is embedded, because dynamic==runtime==too late.

I suggest you look into the AS syntax for embedding assets; perhaps make
a class called "Deck" and embed your 50 cards, each on a different
string variable.

class Deck
{
  [Embed('sk.jpg')] static var spades_king:String;
  [Embed('sq.jpg')] static var spades_queen:String;
  ...

  public static var cards:Array = [spades_king, spades_queen, ...];
}

Each value in Deck.cards will have a different symbol in it.  You can
then refer to that symbol in your Image tags by just changing the
source;

source="{Deck.cards[current]}"

or something like that.

-Roger

Roger Gonzalez
mailto:[EMAIL PROTECTED]
 

> -----Original Message-----
> From: [email protected] 
> [mailto:[EMAIL PROTECTED] On Behalf Of flexmakao
> Sent: Friday, December 02, 2005 12:51 PM
> To: [email protected]
> Subject: [flexcoders] ImageButton path question
> 
> Hello, 
> I was planning on creating a game inside my flex application. Using
> repeater I created 50 image buttons, each corresponding to a card. I
> planed on using random numbers in arrays to shuffle thru my cards each
> time I start a game. Is it possible to do something like this to embed
> images to different cards each time deck is shuffled?
> 
> downImage ="@Embed{'cards/'+rp1.currentItem+'.jpg'}"/>
> 
> where rp1 is my repeater and current item corresponds to data 
> provider.
> 
> Thank you. 
> 
> 
> 
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> --------------------~--> 
> Most low income households are not online. Help bridge the 
> digital divide today!
> http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/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
> 
> 
> 
>  
> 
> 
> 
> 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/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