Can I use variables in mxml tags?

I want to control a lot of details in a layout.  I need to use variables to do this.  Of course I can use AS.  Is there a way to do it in the MXML tags?  See the code below.  I can do the "myLine.x = lineX" in AS.  But is there something like:  x="{lineX}" to use in a tag?  (This gives a warning, though it does work.)  It would make life faster if I could...   Is there a "right" way to do this?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
               initialize="init()" >
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            internal var lineX:Number = 25;
            private function init():void {
                myLine.x = lineX + 50;       
        ]]>
    </fx:Script>
    <s:Line id="myLine" xFrom="0" xTo="0" yFrom="50" yTo="300" >
        <s:stroke>
            <s:SolidColorStroke color="0x0000ff" weight="2" />
        </s:stroke>
    </s:Line>
    <s:Line id="myOtherLine" x="{lineX}" xFrom="0" xTo="0" yFrom="50" yTo="300" >
        <s:stroke>
            <s:SolidColorStroke color="0xff0000" weight="2" />
        </s:stroke>
    </s:Line>
</s:Application>

Hmm, thanks, that's very useful to know.
I guess that means I should use AS.  It's not something I need to update often.  Rather, I have a whole bunch of groups of components/graphics that I want to line up based on each other--and when I change my mind about the size or position of one thing (possibly inside a container a level or two), I'd like to be able to just change one variable name rather than have to change them all by hand.  But AS can do it just fine.

Similar Messages

  • How can i use RemoteObject without mxml?

      hi:
       in my flex project , i use blazeds + puremvc , so i want to put my business code in actionscript as proxy to communicate with java code, the proxy code like :
    public function requestServer(page:PageInfo):void{
       userServiceRM = new RemoteObject();
       userServiceRM.destination="userService";
       userServiceRM.getsimpleList();
       var pageResult :Object= userServiceRM.getsimpleList.lastResult;
       sendNotification(UserStartupCommond.USERLIST_GOT,pageResult );
    but i have a problem that pageResult is a  null value .(the Configuring and the server side have no problem .)
    how can i use RemoteObject without mxml?
     thanks.

    Hi. Remote object calls are asynchronous so you can't access the result immediately after making the call. You need to wait until the server returns the result. There are a couple ways to set this up. Probably the easiest thing to do is to add an event listener that will be called when the result comes back from the server. Here is what that would look like.
    public function requestServer(page:PageInfo):void {
    userServiceRM = new RemoteObject();
    userServiceRM.destination="userService";
    userServiceRM.addEventListener("result", resultHandler);
    userServiceRM.addEventListener("fault", faultHandler);
    userServiceRM.getsimpleList();
    public function resultHandler(event:ResultEvent) {
    var pageResult :Object= userServiceRM.getsimpleList.lastResult;
    sendNotification(UserStartupCommond.USERLIST_GOT,pageResult);
    public function faultHandler(event:FaultEvent) {
    //handle remote object fault
    Look at the RPC Components section of the BlazeDS Developers guide for more information about using the RPC components. Hope that helps.
    -Alex

  • SPSiteDataQuery - filter by file Title - Can I use variable for the filter value?

    I use SPsiteDataQuery to search across multiple lists and filter by file title. I have the file title information in a variable.
    Can I use variable in the filter value?
    string fileName = "Policies.doc"
    SPSiteDataQuery spQry = new SPSiteDataQuery();
    spQry.ViewFields = "<FieldRef Name='Title'/><Value Type='Text'>fileName</Value>"

    If I have understood correctly, you want to search based upon a File title in all the sites. You can include a query to filename in the spQry
    spQry.Query = "<Where>" +
    "<Eq>" +
    "<FieldRef Name=\"FileLeafRef\"/>" +
    "<Value Type=\"Text\">" + fileName + "</Value>" +
    "</Eq>" +
    "</Where>";
    get2pallav
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • Maxl - can you use variables in iferror statements

    hi guys,
    A quick one:
    Can you use variables when doing error handling? I assume the answer is yes, but just wanted to make sure.
    example:
    set app1 = Test;
    set app1_db1 = Test;
    alter database $app1.$app1_db1 force archive to file "C:\\EssbaseBackup\\$app1\\$app1_db1\\$app1_db1.arc";
    iferror 'Bk_$app1.$app1_db1_Error';
    define label 'Bk_$app1.$app1_db1_Error';
    exit 10;
    I am putting error handling into my script and want to double check before I go about making the alterations.
    Many thanks,
    Russell
    Edited by: RussellH-C on 26-Apr-2013 04:45

    You don't need to split the files. Create a Maxl with parameters and then call it in a bat file.
    In the bat you can then check for Error.
    essmsh -D "%HYP_MONTH_SCRIPTS_DIR%\Maxl_Files\HYP_ESS_Archive.msh" %DECRYPTKEY% Appname1 Dbname1
    call :archiveerrcheck
    essmsh -D "%HYP_MONTH_SCRIPTS_DIR%\Maxl_Files\HYP_ESS_Archive.msh" %DECRYPTKEY% Appname2 Dbname2
    call :archiveerrcheck
    archiveerrcheck:
         SET FILE=%MAXLLOG_DIR%\Archive.log
         findstr /R "\<ERROR" %FILE% > ESSErrCheck
          for /F %%A in ("ESSErrCheck") do If %%~zA NEQ 0 (
            call :datestamp
            echo  Error in Archive Process......................... > %ESSLOG%
            copy %FILE% %HYP_MONTH_ERR_DIR%\Essbase\MaxL\Maxl_Error.log
            DEL /Q ESSErrCheck
            call :exit_process
           ) else (
                   echo  %DTSTMP%  Log Out Process was successfull......................... >> %ESSLOG%
                   call :remove_file ESSErrCheck
    GOTO EOF
    :EOFRegards
    Celvin
    http://www.orahyplabs.com

  • [svn] 2216: Changed InterfaceCompiler to public so that it can be used directly for mxml parsing by other tools .

    Revision: 2216
    Author: [email protected]
    Date: 2008-06-24 13:34:15 -0700 (Tue, 24 Jun 2008)
    Log Message:
    Changed InterfaceCompiler to public so that it can be used directly for mxml parsing by other tools. Also change parseMxml to public.
    Reviewed by: Paul
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/InterfaceCompiler.java

    Before I read this helpful post, I changed my Google search key words from "change location Firefox profiles" to "change path Firefox Profiles" and found this link: http://kb.mozillazine.org/Thunderbird_:_FAQs_:_Changing_Profile_Folder_Location. This brought me to the article "Moving Your Firefox Profile" which answered my question. Your suggested link would have ultimately led me to the same solution.
    The problem was that I had copied my Firefox profile to the new location and then modified "profiles.ini" to point to the new location and saved it there as a replacement to the original "profiles.ini" that I had renamed "profiles.iniOld." Even though I had changed "IsRelative" from "=1" to "=0" I got error messages. I had used this procedure successfully before, but it would not work this time. When I used Profile Manager to move the Firefox Profiles everything worked fine the first time I tried it, and it took only a few minutes.
    Thank you, cor-el.

  • Can I use c:out JSTL tag with int values?

    I am attempting to c:out an int variable in my JSP using a JSTL core tag. First is it possible to do c:out an int? Second, if it is...can anyone see anything wrong with my code?
    This is the error log I am getting:
    <Oct 7, 2008 10:20:29 AM MDT> <Error> <HTTP> <BEA-101017> <[ServletContext(id=20
    462449,name=rconnect,context-path=/rconnect)] Root cause of ServletException.
    javax.servlet.jsp.JspException: ServletException in '/WEB-INF/pages/signup/summa
    ry.jsp': An error occurred while evaluating custom action attribute "value" with
    value "${orderForm.numOtaModulesSelected}": Unable to find a value for "numOtaM
    odulesSelected" in object of class "com.echostar.rconnect.struts.formbeans.Order
    FormBean" using operator "." (null)
    This is the code:
    <c:out value="${orderForm.numOtaModulesSelected}" />where numOtaModulesSelected is defined as a private member variable of the OrderFormBean
    I have included the taglib.
    Thanks to anyone who can help

    Your OrderFormBean class needs to implement a getNumOtaModulesSelected method for that to work. The expression language won't let you get at fields, you need to access it via JavaBeans properties.

  • How can I use variable name as a prameter value in HOST Command ???

    Hi All,
    How can it possible to use variable value in parameter in HOST command ??
    Following in my code:
    host('rwclient server=reptest report=c:\cust_print.rdf p_1= s_sam_cust_id userid=wh1/wh1@dwh desformat=pdf desty=file desname=c:/temp/'||v_sam_cust_id||'.pdf');
    Regards

    Hello,
    The Syntax of the builtin HOST is :
    SyntaxPROCEDURE HOST
    (system_command_string VARCHAR2);
    PROCEDURE HOST
    (system_command_string VARCHAR2,
    screen_action NUMBER);
    So , you can build the system_command_string as any VARCHAR2
    Example are provided in online help :
    http://www.oracle.com/webapps/online-help/forms/10g/topics/f1_help/builth_m/host.html?tp=true
    Regards

  • How to insert delay without using loops, and how can I use variable to store data in labview

    Hi all,
    I am new to Labview and I realized that quite often I am in condition to require a delay beween two functions or elements.. how can we insert a delay in such cases?
    I know how to use delays in a loop. but don't know how to inser some time delay between two elements.
    I have one more question, I know its a bad practice to post 2 questions in 1 thread.
    How can I use a temporary variable to store data, So far I am storing it in an indicator by making it invisible in front panel and making local variable of that indicator, is it the right way to do it ?
    Thanks in advance.

    Generally, LV doesn't have variables in the same sense that most languages do. You can use indicators to perform the same function as variables, but as Adnan pointed out, you run the risk of having race condition and it creates data copies, which is a problem if you have a lot of data. In most cases, you should use wires to perform the function of variables, which is to store data and make it available to the different functions in your code. Instead of thinking about variables, you need to think about data (something like "I have the data coming out of this function. Where does it need to go?").
    Try to take over the world!

  • How can i use JSTL inside custom tag attribute

    Hi,
    I have one button tag which displays the button with round corner. I will show the button like this:
    <ep:button key="buttons.submit" name="submitBtn" styleClass="But"
              onClick='submitPage(''<c:out value='${buttonName}' />)' />
    I am getting the problem with the above code. how can i use JSTL inside the custom tags.
    Thanks in Advance,
    LALITH

    No. The details are given below:
    I have included the follwing line in web.xml file:
    <taglib>
        <taglib-uri>/tags/button</taglib-uri>
        <taglib-location>/WEB-INF/button.tld</taglib-location>
      </taglib>button.tld file
    <taglib>
         <tlibversion>1.0</tlibversion>
         <jspversion>2.0</jspversion>
         <shortname>button</shortname>
         <tag>
              <name>button</name>
              <tagclass>com.ksi.ep.web.taglib.ButtonTag</tagclass>
              <bodycontent>empty</bodycontent>
              <attribute>
                   <name>name</name>
                   <required>true</required>
                   <rtexprvalue>false</rtexprvalue>
              </attribute>
              <attribute>
                   <name>key</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
              <attribute>
                   <name>onClick</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
              </attribute>
    </taglib>ButtonTag.java :
    public class ButtonTag extends TagSupport {
       private static final long serialVersionUID = 6837146537426981407L;
         * Initialise the logger for the class
        protected final transient Log log = LogFactory.getLog(ButtonTag.class);
         *  holds the Value of the button tag
        protected String onClick = null;
         *  holds message resources key
        protected String key = null;
         * The message resources for this package.
        protected static MessageResources messages =
                             MessageResources.getMessageResources
                                       ("ApplicationResources");
          *  (non-Javadoc)
          * @see javax.servlet.jsp.tagext.TagSupport#doStartTag()
         public int doStartTag() throws JspException {    
            StringBuffer label = new StringBuffer();         
            HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
            try {             
                   log.debug("in doStartTag()");
                   Locale locale = pageContext.getRequest().getLocale();
                 if (locale == null) {
                     locale = Locale.getDefault();
                 log.info("");
                 label.append("<a border=\"0\" style=\"text-decoration:none;color:#FFFFFF\" href=\"JavaScript:");
                 label.append(onClick);
                 label.append("\" >");
                   label.append("<table  onClick=\"");
                   label.append(onClick);               
                   label.append("\" ");
                   if(onmouseout!=null && !"".equalsIgnoreCase(onmouseout))
                    label.append(" onmouseout=\"");
                    label.append(onmouseout);               
                    label.append("\" ");
                   if(onmouseover!=null && !"".equalsIgnoreCase(onmouseover)){
                    label.append(" onmouseover=\"");
                    label.append(onmouseover);               
                    label.append("\" ");
                   if(title!=null && !"".equalsIgnoreCase(title)){
                    label.append(" title=\"");
                    label.append(title);               
                    label.append("\" ");
                   label.append("style=\"cursor:hand\" tabindex=\"1\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"");
                   label.append(request.getContextPath());
                   label.append(System.getProperty("file.separator"));
                   label.append("images");
                   label.append(System.getProperty("file.separator"));
                   label.append("background1.jpg\" > ");
                 label.append("<tr><td width=\"10\"><img  border=\"0\" src=\"");
                 label.append(request.getContextPath());
                   label.append(System.getProperty("file.separator"));
                   label.append("images");
                   label.append(System.getProperty("file.separator"));
                 label.append("leftcorner.jpg\" ></td> ");
                 label.append("<td valign=\"middle\"  style=\"padding-bottom:2px\"><font color=\"#FFFFFF\" style=\"");
                 label.append(styleClass);
                 label.append("\">");
                 label.append(messages.getMessage(key));
                 label.append("</font></td>");
                 label.append("<td width=\"10\" align=\"right\"><img src=\"");
                 label.append(request.getContextPath());
                   label.append(System.getProperty("file.separator"));
                   label.append("images");
                   label.append(System.getProperty("file.separator"));            
                 label.append("rightcorner.jpg\" border=\"0\"  ></td>");
                 label.append("</tr></table></a>");
                 pageContext.getOut().print(label.toString());
              } catch (Exception e) {               
                   log.error("Exception occured while rendering the button", e);
                   throw new JspException(e);
            return (SKIP_BODY);
         * Release all allocated resources.
        public void release() {       
            this.name=null;
            this.key=null;
            this.onClick=null;
    }In my JSP I have mentioned the taglib directive as
    <%@ taglib uri="/tags/button" prefix="ep"%>and
    <ep:button key="buttons.submit" name="submitBtn" styleClass="But"
         onClick='overwritePreApprovals('<c:out value='${transactionalDetails['inPrepList']}' />')' />Servlet.service() for servlet action threw exception
    org.apache.jasper.JasperException: /pages/pms/coordinator/Dashboard.jsp(325,48) Unterminated <ep:button tag
    Thanks,
    LALITH

  • How Can I Use Variables to Score Interactions?

    I've created a course. Each slide as a question/scenario and three buttons. Two wrong answers and one right. When you choose any of the buttons you get a feedback box that explains why you were right or wrong. These are not quiz slides, but I would like to use variables to score the slides if I could.
    My idea was to create a variable and call it congrats. The variable as a sum of zero. Is it possible for me to add a numerical value to that variable each time a person chooses one of the buttons?
    For example:
    I wanted to add 10 to the variable if you choose the right answer. I wanted to give the incorrect answers a  value of -5. In other words. You could either end up with 10 points on a slide if you choose the correct answer or 0 points if you choose the 2 incorrect answers and the correct answer, or 5 points if you choose a incorrect and correct answer.
    At the end, I would like you come to a slide. this slide will be based on the value of that variable at the end. Either you have a 100 or lower depending on how you did.
    I hope this isn't too confusing.
    Any and all help is appreciated.
    Thanks!

    You forgot one important detail: has the score to be transmitted to a LMS or is it only meant to be shown in the Captivate file?
    And which version are you using? The easiest way to achieve this is to use the partial scoring (and penalty) that is already available for MCQ slides with multiple correct answers.
    I have a lot of stuff on my blog about that type of scoring. Besides question slides, only interactive objects can have a score, everything you can find in the Advanced Interaction panel (F9). Here are some articles I wrote:
    Report Custom Questions - part 1 - Captivate blog
    Report Custom Questions - part 2 - Captivate blog

  • Can I use variables in Rules

    Hello OPA Expets: 1. I have calculation as below: the order line item depreciation total= ((the specified price per unit for the order line item + the order line item price after Transportation) - the order line item cash discount total) –((( the specified price per unit for the order line item + the order line item price after Transportation) - the order line item cash discount total) * (100-the depreciation rate)/100) how to use variable and simplify above rule to below: the order line item depreciation total= (x –(x * (100-the depreciation rate)/100) 2. I have created question screens for web determinations, but user input fields is around 30 fields. How to create input fields row by row instead of horizontal. 3. I have customized sumary screen, added label and substitued with %FieldName%. How to issue a page break?. now it is all in one line and users unable to find out how calculation logic applied as it is cluttered. Thanks a lot.

    Hello OPA Experts:
    1. I have calculation as below:
    the order line item depreciation total= ((the specified price per unit for the order line item + the order line item price after Transportation) - the order line item cash discount total) –((( the specified price per unit for the order line item + the order line item price after Transportation) - the order line item cash discount total) * (100-the depreciation rate)/100)
    how to use variable and simplify above rule to below:
    the order line item depreciation total= (x –(x * (100-the depreciation rate)/100)
    2. I have created question screens for web determinations, but user input fields is around 30 fields. How to create input fields row by row instead of horizontal.
    3. I have customized sumary screen, added label and substitued with %FieldName%. How to issue a page break?. now it is all in one line and users unable to find out how calculation logic applied as it is cluttered.
    Thanks a lot.

  • How can I use variable for a package filename and target file inODIFileMove

    I want to use a variable for paths so that when I migrate from Dev to QA to Prod I don't have to do a lot of editing.
    Specifically, I want a variable to be the first part of the path for the filename (\\sundev1\fnd1-hypd1) and join this with the rest (\update\log\*.log or specific filename) using several different objects like the ODIFileMove, ODI OS Command, OS Command, etc.
    Thank you!

    Hi,
    you could set up a database table holding processing parameters (i.e. Column1 - ParamName, Column2 - ParamValue).
    One row could then be ParamName = FilePath, ParamValue = \\<server>\folder\
    So, the refreshing query (attached to a logical schema) would be something like SELECT ParamValue FROM <your table> WHERE ParamName ='FilePath'
    Then, create a variable which can refresh from the database and in the package, drop the variable onto the flow and set it's type to 'Refresh Variable' in the properties.
    Hope this helps.
    geeo

  • How special characters can be used in xml element TAG.

    Hi,
    In my project data is fetched from the database and stored in the xml file. Data contains European characters as well. When I tried with UTF-8 it was giving error but when I changed the encoding to ISO-8859-1, XML generated.
    Well now I am stuck with a problem and as I don�t know much about XML, I am trying to get some knowledge from you.
    I have xml tag like: <Name&>Rohit</Name><employee#>78023</employee>.
    I am getting the error message �top level element must be defined.� This is because special characters are in TAG. But it doesn�t give error if I use special characters/European char in value( like Rohit*).
    I don�t know much about CDATA. Any help from your end will be greatly appreciated.Can this problem resolved if i use java function outformat.CDataElements(String[]) and pass the elements name.
    Thanks!!
    Regards,
    Rohit Dutt

    Client: I want this element name.
    You: The XML recommendation doesn't allow you to have that element name. If you make documents with that element name then no XML software will be able to read them. It just isn't going to work. Insisting on that would just be stupid and pointless. (Okay, you don't say that last sentence that way to your client but that's how it is. Explain it more nicely than that.)

  • Sequence Parameters: Can I use variable number of parameters?

    Can I create a sequence that has a variable number of parameters?
    If not, Can I pass an array of objects as a paramater?
    In the sequence code:
    for (i=0; i< Parameters.Params.GetNumElements(); i++) {
    object o = Parameters.Params[i];
    // Do something with o
    In the above case, can I call the sequence by putting a "new object[] {(double(2.0)}" as the parameter value?
    For example:
    call VarParams
    Params = PropertyObject.SetPropertyObject (Engine.NewPropertyObject (valueType, asArray, typeName, options))

    Not only can you pass an array of different sizes but you can also make a parameter an empty container and fill it with any container.  The problem is you have to access it correctly within the subsequence.  I can see a practical use for the Array but not really for the container.
    Your last question regarding creating params dynamically: I would have a local variable that is in the Value for the parameter and then just change the local to what you want in the PreExpression.
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Can I use Variable Offsets or Formula definition  for my problem?

    Hello,
    how can i get my BEx report to show me cash weeks 28 to 35 when i enter 27 as the variable selection? What i need are the next 8 weeks ahead of the week that i entered.
    Thanks,
    SD

    Hi Sebastian,
    Create a new selection in a structur in columns.
    In that selection, use characteristic 0CALWEEK and restrict it by single value, ready for input variable.
    When you restrict the characteristic 0calweek in the selection(right click and restrict), choose the option value range.
    Now in the left part of the window you would see 2 fields, for low and high vaue.Click on F4 help. Put in the same single value variable created before in both the low value and high value field.Now transfer your selection to the right side of the window.
    Then right click on the selection on the right side of the window and  choose set offset value.
    Put 1 in the first window and press ok and 8 in the second window and choose ok until u return to query designer.
    You can place the key figure structure below this structure.
    Hope this helps.
    Regards,
    Sunmit.

Maybe you are looking for

  • OB52 - open and close posting period

    Hi I want to know that what is the meaning of + while populating the posting period variant with data for posting periods and also what will be the effect if we donot put the same. Instead that we only put the entry for A D K M S.

  • Replicating Product groups after client copy WRONG

    Hi Folks, I've taken a client copy from client 100 to 050 in both SRM SD1CLNT100 and ECC ED1CLNT100. I've done BDLS to replace log. sys. in both systems for both SRM and ECC log sys. eg. ED1CLNT100 to 050 and SD1CLNT100 to 050. After replication of c

  • How to set a customized search results template for all users

    Hi. I know the customized search results views are stored in a file called pne_portal.hda that resides on every user's subfolder in data/users/profiles/... Is there a way to set a customized search results template for all users? If it's impossible,

  • Two JTables changing each others data

    I have the following swing setup: JPanel mainPanel with GridLayout(0, 1) JPanel tablePanelA with BorderLayout JPanel tablePanelB with BorderLayout JTable tableA JTable tableB The tables are 2 rows by 7 columns, and are two distinct instances of a cla

  • Which kind of software should I use?

     This morning, my Windows operating system suddenly crashed and can not boot normally. So, I tried to restart computer through restoring Windows with Ghost. However, after restoring Windows operating system, I found all non-system partitions are lost