Hi Prince..

You are just creating object of class thats fine,but the UI components has
to complete the component creation...u need to understand that well..

try the below code...if u have any doubt let me know...

import flash.events.Event;
public function fnUpload()
 {
     var a:one=new one();
   addChild( a);
                a.addEventListener("creationComplete",function(e:Event):void
               {
                  a.id_logo.source="here image path";
               });

 }


On Wed, Sep 16, 2009 at 2:35 PM, prince <mahesh.dudw...@gmail.com> wrote:

>
> Hi
> i have one.mxml.It will contains image like this
>         ----------------
>       <mx:Image id="id_logo" source="@Embed(source='images/
> images1.jpg')" height="91" width="100"  x="731" y="22"/>
> and Two.mxml
>     --------------
> //i want to access that image(one.mxml)
>  the code in two.mxml is
>   public function fnUpload()
>  {
>      var a:one=new one();
>    a.id_logo.source="here image path";     -----(1)
>  }
> <mx:button label="get" click="fnUpload()"/>
>
>
> when i run this application i am getting error like
> can not call property on null object reference at (1)
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to 
flex_india+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to