Fireing click event programmatically


hi
i have tree object built xml :

 

treexml:xml = <node label="label1" id="1"/>
<node label="label1" id="2"/>
<node label="label1" id="3"/>
<node label="label1" id="4"/>

 

<tree dataprovider={treexml} labelfield="@label"/>

 

the question :
how can fire (programmatically) click event on displayobject (item in tree) knowing it's "id" value.
thanks.

see if helps.  same concept except using button click event.

 

 

 

 

 

 

 

<?xml version="1.0" encoding="utf-8"?>

<mx:application

 

 

xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationcomplete="init()" xmlns:local="*"

>

 

 

<mx:script>

<![cdata[

 

 

 

private function changetext():void

{

txt.text =

 

"you mouseover text , changed text without pressing button"

}

]]>

 

 

</mx:script>

 

 

 

 

<mx:text id="txt" text="mouseover text dont press button." width="376" mouseover="btn.dispatchevent(new mouseevent('click'))"

/>

 

 

<mx:button id="btn" label="button" click="changetext()"

/>



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino DUE ADC to DAC Piezo 30 Khz-100Khz

Indesign and MathType fonts