this is a small sample i made and was testing. I am building a string 
with macro's in it. Once the string is built i want to convert the 
string into an object. Like if i want to pass a '1' to my funciton it 
will turn function it will build the string "this.cmd1.visible=false"
The only problem is converting the string to an object that i can 
fire. In Visual fox pro all i had to do was build the string 
(dum="thisform.img1.visible=.f.") and then convert it to an object by 
saying "&dum". thanks for any help

___________________________________
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; 
layout="absolute">
<mx:Script>
        <![CDATA[
                public var CmdString:String;
                
                public function SetImageVis(l_ImageID:int):void{
                        //builds the string like 
this.img1.visible=false
                        this.CmdString="this.img"+l_ImageID.toString()
+"visible=false"
                }
        ]]>
</mx:Script>
        <mx:Panel x="10" y="10" width="669" height="583" 
layout="absolute" borderColor="#b4f5a0" title="Macro Substitution">
                <mx:Button click="SetImageVis(1)" x="37" y="10" 
label="Hide 1"/>
                <mx:Button click="SetImageVis(2)" x="37" y="50" 
label="Hide 2"/>
                <mx:Button click="SetImageVis(3)" x="37" y="87" 
label="Hide 3"/>
                <mx:Image id="img1" x="10" y="10" 
source="Assets/1.gif"/>
                <mx:Image id="img2" x="10" y="50" 
source="Assets/2.gif"/>
                <mx:Image id="img3" x="10" y="87" 
source="Assets/3.gif"/>
        </mx:Panel>
        
</mx:Application>


Reply via email to