try this:
<mx:Image source="../pictures/banner.jpg" click="SomeFunction(event)"/>

function someFunction (event:Event):void{
  var refToMyComponent = event.target ;
}

On 6/21/06, Charles <[EMAIL PROTECTED]> wrote:

Hi everyone,

This post title isn't all that descriptive but I couldn't think of a better one.  The question is pretty straightforward though.  I think it's best explained with an example.  Let's say I have an image...

     <mx:Image source="../pictures/banner.jpg"/>

Now, let's say that if I click the banner, I want to do something with, say the source, like pass it to a function.  I could do something like...

     <mx:Image source="../pictures/banner.jpg" click="SomeFunction('../pictures/banner.jpg')"/>

BUT, I want to know if there is a way to do the same thing without hardcoding in the source again (for my application, the source is a variable, that's why...so I can't hardcode it).  I'm looking for something similar to...

     <mx:Image source="../pictures/banner.jpg" click="SomeFunction(this.source)"/>      // ERROR - doesn't work

It seems like something that I should be able to do, but I just can't figure out how.

Thanks in advance



Charles


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to