-
Embedding General Question
Hi,
i wanted to ask, when using FlashDevelop to embed images in a class, the code lines,
public class MyClass extends Sprite
{
[Embed(source='../lib/lancer_evo_bitmaps.jpg')]
private var _imgClass:Class;
private var _image:Bitmap = new _imgClass();
.....
What would the last 2 lines represent? and how does FlashDevelop know that it refers to the jpg image?
Thanks
-
Did you write this code yourself?
I don't have much experience with FlashDevelop, but it looks like that image is being exported for ActionScript in the same way you would export a symbol from your Library in Adobe Flash. The _imgClass object may serve as this exported symbol.
If that's not the case, it might be happening later on in the code, but I can't see that from here.
-
The line directly after the Embed tag is associated with the asset. That's just how it works. It defines a Class to represent the asset. The third line instantiates that class to get you a Bitmap instance from that class.
It does work pretty much like exporting a symbol within Flash.
-
That's interesting! I'll keep that in mind, for future reference. =)
-
Originally Posted by 5TonsOfFlax
The line directly after the Embed tag is associated with the asset. That's just how it works. It defines a Class to represent the asset. The third line instantiates that class to get you a Bitmap instance from that class.
It does work pretty much like exporting a symbol within Flash.
Oh i see, thanks.
-
Senior Member
Can this be used in Flash CS4 or is it a different compiler?
I'm aware that you can do it in Flex, certainly...
-
I just gave this a try and this is what I got:
So, we definitely need Flex. =)
-
You need the flex compiler, but you don't have to have FlexBuilder or anything like that. The flex sdk is free to download and use.
http://www.adobe.com/cfusion/entitle...cfm?e=flex3sdk
-
-
Senior Member
Hmm... I should look into that - it would allow for making a preloader that doesn't require any nonsense with the main timeline
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|