Inconsistencies between an MXML tag instance's properties and an Actionscript instance's properties

Hi everyone!  I've been using the SDK for several months, but I've only been using Flash Builder for a few weeks.  I finished the Flex In a Week videos and exercises a few days ago, and since then I've been playing around with the accompanying exercises.
My question specifically refers to the PanelSkin.mxml file from 'Exercise 5.6: Creating custom skin properties'.  In this example, the function initTitleSkin() sets the 'headerSkinColor.color' property to a value passed from the main application:
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark"
    creationComplete="initTitleSkin()">
    <s:states>
        <s:State name="normal" />
        <s:State name="disabled" />
    </s:states>   
    <fx:Metadata>
               [HostComponent("components.EmployeePortalPanel")]
   </fx:Metadata>
    <fx:Script>
        <![CDATA[
            private function initTitleSkin():void
                headerSkinColor.color = hostComponent.panelTitleColor;
        ]]>
    </fx:Script>
<s:Rect radiusX="4" radiusY="4" height="100%" width="100%" >
     <s:fill>
          <mx:SolidColor id="panelSkin" color="#E8E8E8"/>
      </s:fill>
</s:Rect>
<s:Path winding="nonZero" data="M 0.016 0.012 L 0.016 23.354 L 287.419 23.354 L 287.408 12.012 C 287.408 5.385 282.035 0.012 275.408 0.012 L 0.016 0.012 Z">
     <s:fill>
          <s:SolidColor id="headerSkinColor"/>
     </s:fill>
</s:Path>
<s:Label id="titleDisplay" lineBreak="explicit" left="10" right="4" top="2" height="30" verticalAlign="middle" fontWeight="bold"/>
<s:Group id="contentGroup" top="23">
</s:Group>
</s:SparkSkin>
This code works just fine.  I tried extending this example by setting the 'titleDisplay.color' property in the same way.  The 'titleDisplay' is an instance of the Label class.
     private function initTitleSkin():void
                headerSkinColor.color = hostComponent.panelTitleColor;
                titleDisplay.color = hostComponent.panelLabelColor;
The above code results in the error 'Access of possibly undefined property color through a reference with static type spark.components:Label'.
I set up the custom 'panelLabelColor' property and confirmed the 'hostComponent.panelLabelColor' property is being passed to the custom skin class correctly.  My question is, Why can I set the 'color' property in the MXML Label block, but not from the ActionScript instance.  The Language Reference shows the spark Label has a 'color' property.  Code Assist shows the 'color' property in the MXML block, but not in the ActionScript instance.  Am I missing something simple that's staring me right in the face?  I'm usually pretty good at that.  I'd appreciate any thoughts on this inconsistency.

it's not likely.

Similar Messages

  • Event handlers:  click in mxml tags or in AS?

    Is there an advantage to putting click event handlers in AS rather than in the mxml tags?  For example
    in AS
    button_1.addEventListenter(MouseEvent.CLICK, someFunctionName);
    or in mxml tags
    <s:Button click="someHandlerName(event) />
    Thanks

    I will say that there is another advantage to MXML.
    For instance, say that I have a static function I want to run any time you click a component and don't care about the event. I can do this in MXML:
    <s:Whatever>
    click="{doMyStaticMethod()}"
    </s:Whatever>
    In AS, I cannot do this. A click event in AS requires that I add an ActionListener and that the ActionListener be void and take an event. MXML gives a way around that if you like.

  • Template error when pasting code between editable region tags

    Hi everyone,
    The following code snippet is part of the code in my template file:
      <div id="content">
      <div id="content_main">
        <div id="content_inner"><!-- InstanceBeginEditable name="inner" --><!-- InstanceEndEditable --></div>
        <div id="sidebar">
        <h3 class="round2">Categories</h3>
    Note that the above code contains an editable region as follows:
    <!-- InstanceBeginEditable name="inner" --><!-- InstanceEndEditable -->
    Back in my file that's attached to this template, I tried to paste code between these two tags:
    <!-- InstanceBeginEditable name="inner" --> A whole heap of code was pasted here <!-- InstanceEndEditable -->
    But I'm getting the following error:
    "You have made changes to code that is not marked as editable. If you retain those changes, they will be lost the next time you apply a template update to this file. Do you want to retain the changes until then?"
    I don't know why it's saying this since I'm adding code in between the two instance editable tags.
    Does anyone know what's going on here?
    Appreciate any help.

    Hello hth
    Just so you'll know, although 'hth' looks like a signature, it's really an abbreviation for "hope this helps"!
    I have put the code in that you suggested, (via new style sheet I named paradent) enclosed the text within the <p>...</p> but still not working:
    P
    .twoColLiqLtHdr #container #mainContent .paradent {
    font-family: Arial, Helvetica, sans-serif;
    font-size: medium;
    font-weight: normal;
    text-indent: 35px;
    word-spacing: normal;
    <span class="paradent">No color flagged the coming of spring to the Lowveld. The rains were late again, and from the Limpopo to the Sabi River and beyond into Mozambique, the mopani trees were leafless and grey; the wide rivers dry and white under the relentless sun.<br />
    This is not valid code - it's not how you use CSS.
    All CSS needs to either be placed in an external stylesheet which is linked in the head of the document, embedded between <style> tags in the head of the document, or placed inline in the target tag.  Examples of each would be -
    LINKED -
    <link rel="stylesheet" href="path_to_CSS_file.css" type="text/css">
    </head>
    EMBEDDED -
    <style type="text/css">
    body { margin:0; }
    </style>
    INLINE -
    <body style="margin:0;">
    Yours is not only in the wrong place (within the body content), but it's also between <p> tags rather than <style> tags.  That's not going to work at all.  Can you handle getting that rule into the right place in your code?

  • HT1198 If I share an iPhoto library between multiple users, will the Faces, Events, and Places be automatically usable by all users, or will each user have to tag all the photos (e.g. if a user tags a face, will a different user have to do it in their own

    If I share an iPhoto library between multiple users, will the Faces, Events, and Places be automatically usable by all users, or will each user have to tag all the photos (e.g. if a user tags a face, will a different user have to do it in their own iPhoto application??

    Have you read this Apple document regarding sharing a library with multiple users: iPhoto: Sharing libraries among multiple users?
    OT

  • How to create a new tag in page properties in the sidekick of geometrrix page

    how to create a new tag in page properties in the sidekick of geometrrix pagesame as basic, advanced, blue print??

    Hi prachi,
        Is it tag OR Tab ? Seems like you are looking for Tab. Look at [1] & overlay to custamize per your need. Or define at your page component.
        [1]   /libs/foundation/components/page/dialog/items/tabs/items
    Thanks,
    Sham

  • Developing Custom Adapter - Keep getting error: Unrecognized tag found in properties

    Hey All,<br /><br />I'm trying to configure some custom properties to pass through to my custom BlazeDS adapter, inside my remoting-config.xml.<br /><br />If you look here:<br />http://xml.pastebin.com/f17464dac<br /><br />This has been working perfectly for the destination id'd 'Conduit'. no problems there at all.<br /><br />For the destination id'd 'ConduitReverse', no matter what extra <tag> I put after <access>, I get the following exception:<br /><br />**** MessageBrokerServlet failed to initialize due to runtime exception:   Exception: flex.messaging.config.ConfigurationException: Unrecognized tag found in <properties>.  Please consult the documentation to determine if the tag is invalid or belongs inside of a different tag: <br />  '/foo' in destination with id: 'ConduitReverse' from file: remoting-config.xml<br />     at flex.messaging.config.MessagingConfiguration.reportUnusedProperties(MessagingConfiguratio n.java:750)<br />     at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:158)<br />     at coldfusion.flex.ColdFusionMessageBrokerServlet.init(ColdFusionMessageBrokerServlet.java:2 4)<br />     at coldfusion.bootstrap.ClassloaderHelper.initServletClass(ClassloaderHelper.java:94)<br />     at coldfusion.bootstrap.BootstrapServlet.init(BootstrapServlet.java:59)<br /><br />I've tried 'foo', 'fooBar', 'thisIsMyCustomProperty', and so far, I always get that error.<br /><br />I had thought I could put arbitrary values inside <properties>, without having to worry about validation, is that not the case?<br /><br />I'm running a daily build of BlazeDS 4.x, from about a month ago. I may try upgrading.<br /><br />Any help on this would be greatly appreciated.

    The source of the problem is here: flex.messaging.config.MessagingConfiguration.reportUnusedProperties(MessagingConfiguratio n.java:750)
    Your code is fine, it is BlazeDS bugs, that they don't want to fix, have a look at this bug: http://bugs.adobe.com/jira/browse/BLZ-143
    I still can't understand a rationale behind this, but this is the way it is.
    To get pass this error you HAVE to call
    properties.getPropertyAsString("fooBar", null);
    in
    public void initialize(String id, ConfigMap properties)
    method.
    Have a look at my adapter for example:
    http://code.google.com/p/flexserverlib/wiki/EJBAdapter
    http://code.google.com/p/flexserverlib/source/browse/trunk/java/src/flexserverlib/messagi ng/services/remoting/adapters/EJBAdapter.java

  • 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.

  • Replication between publish1 to publish2 instances to make users available on both instances.

    Hi,
    we need to make 2 publish environments with load balancer, if a user register on the website, his details would be stored in CRX only on one publish instance, if the second request goes to other publish instance then there would be a issue as his details would not be available there. this is the reason i want to make the users to be available on both publish instances so that there would not be any issue.
    Could you please help me how to make the users available on both publish instances. we have 2 publish instances, user profile details would be stored in the CRX of one publish instance, i want to make this user profile details to be available in other publish instance also.
    /home/users folder need to be replicated upon node creation or modification between both publish instances.
    Request you to please help me to know if we can replicate users between publish instances directly? or do we need to reverse replicate to author first and replicate to publish.
    another issue if  i replicate to author and then publish1 and publish2 : we have only one author for 3 data centers(3 diff servers) ; if i use reverse replication to autor and replication to publish1 and publish2 then the user informaiton would be replicated to all 3 data centers which is not permitted by the client.  can we directly replicate the users between publish1 to publish2 instances? if yes, please help me.
    Thanks,
    Ravinder Jilla...

    Hi Ravinder,
              The steps to move from publish1 to publish2 instance without replicating to author is
    1 Setup replication agent in each publish instance.
    2 Create Workflow Model to activate the user.
    3 Configure Workflow Launcher to listen for new registration & call the model created in step2. Please note:-  In launcher you need to set condition to avoid infinite loop & especially with modification.
       If you could file a daycare we can understand your requirement better & discuss prons/cons & can come up with proposing right implementation. 
    Thanks,
    Sham

  • Tag instances - same instance being used across multiple tags

    Hi
              I am using BEA WebLogic Server 6.1 SP2
              Problem:
              Tag instances - same instance being used across multiple tags
              The problem is that when I use the same jsp tag several times in a page,
              The tag is being instantiated only one time, as a result the class
              attributes
              retain their values when activating the tags.
              Example:
              A code that demonstrates the problem (not sure that it is compiled)
              public FooTag extends TagSupport {
              private boolean isValid = true;
              private String name;
              public setName(String x){
              name = x;
              public int doStartTag() throws JspException
              if (name.equals("x"){
              isValid = false;
              return SKIP_BODY;
              public int doEndTag() {
              if (isValid){
              return EVAL_PAGE;
              <table>
              <tr>
              <td><mpower:FOOTAG name="x"/>
              <!-- isValid attribute is set to false -->
              A FOOTAG implmented in FooTag </td>
              </tr>
              <tr>
              <td><mpower:FOOTAG name="y"/>
              <!-- isValid attribute still false (we expected it to be true) ! -->
              A FOOTAG implmented in FooTag </td>
              </tr>
              </table>
              P.S.
              I am using the same tags library with Tomcat and iPlanet Application severs,
              I did not get this problem there !!
              

              What should I do to reinitialize the tag? We have the same problem on custom tag.
              We have TabSet tag, which contains a set of Tab tag. In Weblogic 5.1, everything
              works ok, however when we run it in weblogic 6.1, Tab object seems like share the
              same instance, say if I have 2 Tabs in the TabSet, it ends up shows 2 same tabs with
              the apperance of the last tab added to the tabset on the web browser. We do implement
              release() method to call super.release() of TagSupport class.
              Any help is very appreciated.
              Thanks,
              Kimberly
              "Simon Spruzen" <[email protected]> wrote:
              >
              >This is allowed. You must implement public void release() on your tag, and
              >WLS will
              >call it before this method if WLS elects to reuse the tag instance. Your
              >release
              >method just reinitialises the tag as required.
              >
              >simon.
              >
              >"Eyal H" <[email protected]> wrote:
              >>Hi
              >>
              >>I am using BEA WebLogic Server 6.1 SP2
              >>
              >>Problem:
              >>
              >>Tag instances - same instance being used across multiple tags
              >>
              >>The problem is that when I use the same jsp tag several times in a page,
              >>
              >>The tag is being instantiated only one time, as a result the class
              >>
              >>attributes
              >>
              >>retain their values when activating the tags.
              >>
              >>Example:
              >>
              >>A code that demonstrates the problem (not sure that it is compiled)
              >>
              >>public FooTag extends TagSupport {
              >>
              >>private boolean isValid = true;
              >>
              >>private String name;
              >>
              >>public setName(String x){
              >>
              >>name = x;
              >>
              >>}
              >>
              >>public int doStartTag() throws JspException
              >>
              >>if (name.equals("x"){
              >>
              >>isValid = false;
              >>
              >>}
              >>
              >>return SKIP_BODY;
              >>
              >>}
              >>
              >>public int doEndTag() {
              >>
              >>if (isValid){
              >>
              >>......
              >>
              >>}
              >>
              >>return EVAL_PAGE;
              >>
              >>}
              >>
              >>}
              >>
              >>
              >>
              >>
              >>
              >><table>
              >>
              >><tr>
              >>
              >><td><mpower:FOOTAG name="x"/>
              >>
              >><!-- isValid attribute is set to false -->
              >>
              >>A FOOTAG implmented in FooTag </td>
              >>
              >></tr>
              >>
              >><tr>
              >>
              >><td><mpower:FOOTAG name="y"/>
              >>
              >><!-- isValid attribute still false (we expected it to be true) ! -->
              >>
              >>A FOOTAG implmented in FooTag </td>
              >>
              >></tr>
              >>
              >></table>
              >>
              >>
              >>
              >>P.S.
              >>
              >>I am using the same tags library with Tomcat and iPlanet Application severs,
              >>
              >>I did not get this problem there !!
              >>
              >>
              >>
              >
              

  • Manipulating mxml tags (view) in Cairngorm.

    i have a cairngorm based app that consists of a tabnavigator
    with 8 tabs. i need to set the visibility of tabs through app
    initialization as well as through user gestures.
    what's the best way to accomplish this? i have a function
    that toggles tabs as i see fit; however, i need the
    tabnavigators(view) id from the mxml tag. i can't get this to work.
    besides, it's not the best practice to reference a view like that
    through a command class, is it?
    thanks in advance...
    fd

    No worries.
    Also, be sure to read the Cairngorm series of articles by
    Steven Webster in the ADOBE DEVELOPER CONNECTION site, if you
    haven't already done so:
    http://www.adobe.com/devnet/flex/articles/cairngorm_pt1.html
    http://www.adobe.com/devnet/flex/articles/cairngorm_pt2.html
    http://www.adobe.com/devnet/flex/articles/cairngorm_pt3.html
    http://www.adobe.com/devnet/flex/articles/cairngorm_pt4.html
    http://www.adobe.com/devnet/flex/articles/cairngorm_pt5.html
    http://www.adobe.com/devnet/flex/articles/cairngorm_pt6.html
    Happy holidays !

  • Reg: How to automate updation of tables between two oracle DB Instances

    Hi All,
    I have a requirement to auto update the tables between two oracle database instances. What are the possible solutions to handle this kind of situations.
    Please help me out in identifying the correct solution.
    Thanks in advance :)

    The possible solutions are outlined in the distributed database documentation
    They are
    a) trigger (6.0 and higher)
    b) advanced replication. Creates triggers on every table. Requires every table to have a primary key (8.0 and higher)
    c) Streams (Uses logminer, has no impact on table. Requires every table to have a primary key, or supplemental logging will be used. (9.0 and higher)
    d) Change Data Capture: superset of Streams (9i and higher).
    If you don't require realtime updates you don't need c or d. b is difficult to manage. Using a) the source db can potentially have to wait for the target db to complete it's transaction.
    Sybrand Bakker
    Senior Oracle DBA

  • How exchange messages between two user-bean instances?

    Hi,
    I would like to let several user to log-in my web site (I'm using tomcat) and then let them exchange some messages until they are logged-in. Is there a way using JSF?
    I was thinking about implementing a list of messages inside each user-bean. The user should know that other users are logged-in, that could be listed in a table, and click on its name. I would like that the click action create an item in the list valiable of the selected user. Is that possible using JSF? I didn't find any of such kind of communication between two user-bean instances.
    Do you have any hints? Is that the right way or is there other possibilities?
    Thanks

    You could get hold of a map of sessions in the application scope. Make use of HttpSessionListener to add/remove sessions to/from the map.
    JSF is just another component based MVC framework on top of JSP/Servlet. Everything which you can do in JSP/Servlet is just still possible. You only need to understand how JSF works under the hood.

  • Difference between jsp forward tag and sendRedirect

    I would like to know the difference between jsp forward tag and sendRedirect.
    Please explain with a suitable example if possible ...
    glenn

    See: http://java.oreilly.com/news/jsptips_1100.html (number 4)

  • Custom AS3 Component / Event Definition for MXML Tag

    Custom AS3 Component / Event Definition for MXML Tag
    Exposing custom event in custom MXML tag.
    I have made an AS3 custom component named,
    'CustomListComponent'.
    Is a list type component extending UIComponent.
    When an item is clicked (selected) I generate a custom event
    named, 'selChange'
    I want the user to be able to use this tag, define a handler
    on the MXML tag.
    I tried using metadata like [Event("selChange")] in the
    component AS3 file with no luck.
    Any help / examples to expose a custom event from an AS3
    custom component to the MXML tag for the end user/developer would
    help significantly.
    Anyone? Thank you.

    Well, That did not take long.
    My mistake, Typo type.
    [Event(nane="selChange", type="flash.events.Event")]
    That is: naNe not naMe :(
    Thank you all for your time and responses.
    I WILL check my code more closely next time I post a
    question.
    P.S.: @VarioPegged : My code is big and not needed now. If
    you would like it anyway just message me. TY

  • Inconsistencies between B1 SLSP/SLSPP and B1i SLD

    Dear Experts,
    Can anyone please help me with the error encircled in the attached file? I am not able to run dashboards and I guess this error is the cause.
    Any help will be highly appreciated!
    Thanks & Regards,
    Aakash Deliwala

    Hello,
    Check weather the Company Database names are available in SLD Integration Framework.
    If Does not exist then follow this:
    1. Go to SQL Server>SBO_Common (DATABASE)>Table>SLSP. Check all your company database         are available or not?
    2. If database exists then DELETE your Company Database.
    3. Go to SAP and Refresh your database.
    4. Check your JAVA version. It should be greater than Version 5.
    5. Now Install Event Sender. (Your System Drive:/Program Files/SAP/SAP Integration Framework/Event     Sender/Setup. Step 3/5 Test Connection. And Finish.
    6. Now restart your SAP Integration Framework Services.
    7. Now go to Integration Framework & there you can see your Company Database in SLD.
    This will remove inconsistencies between B1 SLSP/SLSPP and B1i SLD
    Kind regards,
    Jai

Maybe you are looking for

  • Exchange 2003 to Exchange 2010 Public Folders

    Hi Gurus, I'm in the process of moving public folders from Exch03 to Exch2010 and I have some clarifications before I proceed with this task. As I have understood the replication process between public folders working in a multi-master environment, I

  • "Check In" Feature in Apps

    Hi there...I am wondering if anyone else is having issues using the "Check In" feature while on the 3G with apps such as Facebook or Four Square? It works fine for me if I am connected to a wi-fi network but once I am out and about using the 3G it ap

  • Electronic invoices

    Hi All, In our implementation the client wants the following electronic invoicing capabilities 1) Scanning : Is there SAP standard capabilities to scan invoices in order to transfer them into electronic format 2) OCR (Optical character Recognition) :

  • MS Project Calendars and activity codes

    How do I create a calendar for a seven day work week when it doesn't allow me to add times to Saturday and sunday when I copy the standard calendar? Also, how do I create new activity codes? For instance an activity code for "responsibility" and assi

  • Photoshop CS3 and Nikon D300s

    I just bought a new Nikon D300s. If I download the D300 Raw upgrade will I be able to process raw images from my D300s, or will I have to upgrade to CS4?