java - how to get the id value From one mxml file to another mxml file in flex? -


my apllication in flex 3.5...my code here,how take id value of textare? button.mxml

<mx:button width="20" height="20" label="textarea" id="textarea" click="setshape(drawobject.text);showtextarea()"/> 

my file here: main.mxml

 private function domousedown_canvas():void                     {                             if(this.shapestyle==drawobject.text)                             {                                     if(isdrawing)                                     {                                             isdrawing = false;                                             this.d = drawfactory.makedrawobject(this.shapestyle,segment, this.drawcolor, this.thickness, textarea.text);                                             dispatchevent(new event(boardmediator.send_shape));                                      textarea.visible = false;                                     }else                                     {                                             isdrawing = true;                                             x1 = canvas.mousex;                                             y1 = canvas.mousey;                                             segment.push(x1);                                             segment.push(y1);                                              textarea.text = "";                                     textarea.visible = true;                                             textarea.x = canvas.mousex;                                             textarea.y = canvas.mousey;                                             textarea.setfocus();                                              locateeditor();                                     }                             }else                             {                                     isdrawing = true;                                     x1 = canvas.mousex;                                     y1 = canvas.mousey;                                     segment.push(x1);                                     segment.push(y1);                                     canvas.rawchildren.addchild(feedback);                             }                     } 

you have use button.mxml somewhere ...!? setting id of inside mxml file, makes object public attribute of corresponding class.

if <mx:button> thing inside button.mxml rid of id inside button.mxml , set outside.

if have surrounding container, sth, hgroup can access main this:

<myns:button id="mybutton" /> 

and in fx:script tag:

mybutton.textarea; 

cheers


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -