Thank you for suggestion, Sherif, but it is not straight-forward
anpproach and looks like work around, no solution. Especially if I
will have 10-15 images like that.

--- In flexcoders@yahoogroups.com, Sherif Abdou <[EMAIL PROTECTED]> wrote:
>
> /**
> * The Static Image that we want to use
> */
> [Bindable]
> [Embed(source='test.jpg')]
> public static var image:Class;
> private function initApp():void{
> /**
> * Create the image class since it is a DisplayObject
> * and add it to wherever u want
> */
> var TempImage:DisplayObject= new image();
> rawChildren.addChild(TempImage);
> }
> 
> 
> 
> ----- Original Message ----
> From: lytvynyuk <[EMAIL PROTECTED]>
> To: flexcoders@yahoogroups.com
> Sent: Tuesday, January 29, 2008 11:24:23 AM
> Subject: [flexcoders] Embedded image and static variable problem.....
> 
> I have problem to bind image to static var
> 
> my piece of code is:
> [EMAIL PROTECTED]('/images/ image.png' )]
> [Bindable]
> public static var image:Class;
> 
> getting exception:
> TypeError: Error #1009: Cannot access a property or method of a null
object reference.
>     at support::PublicCons tants$/get voipguardImage( )[W:\jboss-
4.0.5\server\ default\deploy\ ISP.war\isp_ flex\support\
PublicConstants. as:117]
>     at support::PublicCons tants$cinit( )
>     at global$init( )[W:\jboss- 4.0.5\server\ default\deploy\
ISP.war\isp_ flex\support\ PublicConstants. as:5]
>     at isp_flex/initApplic ation()[W: \jboss-4. 0.5\server\
default\deploy\ ISP.war\isp_ flex\isp_ flex.mxml: 66]
>     at isp_flex/___ isp_flex_ Application1_ initialize( )[W:\jboss-
4.0.5\server\ default\deploy\ ISP.war\isp_ flex\isp_ flex.mxml: 6]
>     at flash.events: :EventDispatcher /dispatchEventFu nction()
>     at flash.events: :EventDispatcher /dispatchEvent( )
> 
> Any ideas why?
> 
> Also how to make something like array of embedded images:
> 
> var images:Array = [ @Embed('/images/ image1.png' ) ,
@Embed('/images/ image2.png' ), @Embed('/images/ image3.png' )]
> 
> 
> 
> 
> 
>      
____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now. 
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>


Reply via email to