Agreed!
2009/5/24 Steven Sacks
> The latter is cleaner and better, IMO.
>
> Write a function that your event handler calls. Then, you can call it from
> elsewhere and from your button click handler.
>
> function onThumbClick(event:MouseEvent):void
> {
>loadImage(event.target.name);
> }
> fu
The latter is cleaner and better, IMO.
Write a function that your event handler calls. Then, you can call it from
elsewhere and from your button click handler.
function onThumbClick(event:MouseEvent):void
{
loadImage(event.target.name);
}
function loadImage(num:int):void
{
// loadImage
You have a couple of options:
You could add an optional parameter to the function that handles the click,
like this:
function clickThumb(e:MouseEvent,index:int = 0):void{
}
Setting a default value for the index parameter allows the function to be
called without passing it. That's what will happ
On Sun, May 24, 2009 at 2:00 AM, Isaac Alves wrote:
> 1067: Implicit coercion of a value of type Number to an unrelated type
> flash.events:MouseEvent.
>
> How could I call the function clickThumb and make it use "image_num + 1"
> instead of "e.target.name" ?
Do you have the value of image_num a
Hello!
In my code there's a function that shows an image on the screen (or load the
image and show a progress bar) that is called by clicking on a thumbnail,
and uses a parameter [e.target.name] refering to the property "name" of the
thumbnail clicked, which is an integer. The thumbnails are placed
5 matches
Mail list logo