If you use the Repeater to instantiate the images , then you will be able to
access the set of images as an array.
i.e
<mx:Repeater id="rp"
dataProvider="{_dp}" recycleChildren="true">
<mx:Image source="{rp.currentItem.url}" id="imageArray"/>
</mx:Repeater>
Inside your script now you will be able to access the images as
if(data.d[1] == '1')
imageArray[1].visible = true;
So now you will be able to loop through the images as opposed to the earlier
implementation.
Hope this helps.
2009/10/5 Vivek Jain <[email protected]>
> Use Switch case Insted:
>
> Switch(Condition)
> {
> case 1:
> set value;
> break;
> case 2:
> set value;
> break;
> }
>
> Cheers,
> Vivek
>
>
> 2009/10/4 xueliang wu <[email protected]>
>
>> Hi,
>> I think it's not a good solution.In my opinion,
>> You can add a variable to mark the status of these checkbox.
>> var o:Object = new Object();
>> o.visibletStatus = true;
>> For example:
>> var o:Object = data as Object;
>> image.visible = o.visibletStatus;
>>
>> Because you have many image,you can process the images,
>> you can use bindling variable,I think it can make it.
>> 2009/10/4 cholid ridwan <[email protected]>
>>
>>> Hi all
>>> i want to ask something about alternatif if else function
>>>
>>>
>>
>>> i've 100 checkbox that the syntax
>>>
>>> if(data.d[1] == '1')
>>> image1.visible = true;
>>> else
>>> image1.visible = false;
>>> if(data.d[1] == '1')
>>> image2.visible = true;
>>> else
>>> image2.visible = false;
>>> and i must writer until 100 times
>>>
>>> how to make it more simple?
>>> Thanks
>>> cholid.r
>>>
>>>
>>>
>>
>>
>> --
>> 有你,幸福的开始!
>>
>>
>>
>>
>
> >
>
--
Regards,
Ganaraj P R
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---