Metadata (stuff inside []) is not part of actionscript so variables and
consts can't be used.  Once embedded, why do you still need the path?

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of westmeadboy
Sent: Friday, May 09, 2008 7:01 PM
To: [email protected]
Subject: [flexcoders] Using a const to specify Embed source

 


I'd like to be able to specify the source of an Embed statement using a
const
rather than a string literal.

At the moment I have to do:

public static const MY_ICON_PATH:String = "../assets/my_icon.png";
[Embed(source="../assets/my_icon.png")]
private var MY_ICON_CLASS:Class;

which is clearly not nice because I have to define the same path twice.

However, I would like to do this (but this gives a compile-time error):

public static const MY_ICON_PATH:String = "../assets/my_icon.png";
[Embed(source=MY_ICON_PATH)]
private var MY_ICON_CLASS:Class;

Any ideas?
-- 
View this message in context:
http://www.nabble.com/Using-a-const-to-specify-Embed-source-tp17159215p1
7159215.html
<http://www.nabble.com/Using-a-const-to-specify-Embed-source-tp17159215p
17159215.html> 
Sent from the FlexCoders mailing list archive at Nabble.com.

 

Reply via email to