How do I make this custom Style property work correctly?

I'm trying to create a CSS style property that expects an
mx:Effect object to be used in a custom AS class. I want to detect
changes being made to the style property and assign the specified
effect to an effect trigger belonging to a child of my custom
component.
Unfortunately, the specified mx:Effect object seems to be
interpreted as a string instead of an mx:Effect object. Can anyone
tell me what I need to correct for this to work as expected?
You can see the compiled example
here
and review the source code below. It fails due to a
"TypeError: Error #1034: Type Coercion failed: cannot convert
"myTestEffect" to mx.effects.Effect.Style" in the custom
components styleChanged function at the bottom of this post.
EffectTest.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns:myComps="myComponents.*"
layout="absolute"
viewSourceURL="srcview/index.html"
>
<mx:Fade id="myTestEffect" alphaFrom="0.0" alphaTo="1.0"
duration="1000"/>
<mx:Style>
MyCustomPanel {
testEffect: myTestEffect;
</mx:Style>
<myComps:MyCustomPanel/>
</mx:Application>
myComponents/MyCustomPanel.as:
package myComponents
import mx.containers.Panel;
import mx.effects.Effect;
import mx.controls.Alert;
[Style(name="testEffect", type="mx.effects.Effect",
inherit="no")]
public class MyCustomPanel extends Panel
public function MyCustomPanel()
super();
override public function styleChanged(styleProp:String):void
var allStyles:Boolean = !styleProp || styleProp ==
"styleName";
super.styleChanged(styleProp);
if (allStyles || styleProp == "testEffect")
var theTestEffect:Effect = getStyle("testEffect");
if (theTestEffect)
Alert.show("Effect assignment successful");

Thanks for the quick response! I will definitely take your
advice to work around the problem but your answer leads to more
questions.
I can specify effects via an instance when assigning them to
effect triggers and it works without a problem, as seen below. How
does it handle this at compile time?
<mx:Fade id="rollOverFadeUp" alphaFrom="0.35"
alphaTo="1.0" duration="250"/>
<mx:Fade id="rollOutFadeDown" alphaFrom="1.0"
alphaTo="0.35" duration="250"/>
<mx:Style> // this is an external .css file in my app
TextInput {
rollOverEffect: rollOverFadeUp;
rollOutEffect: rollOutFadeDown;
</mx:Style>

Similar Messages

  • How to set "Make this group privileged" property for group?

    There is a group property which is
    shown as a checkbox in OID Console and
    described as "Make this group privileged. Enabling this option will allow you to perform the assignment of privileges to this group. Non privileged group cannot be associated with any privilege.".
    How to set this property programmatically using Portal PL/SQL API ?
    Thanks

    nina91x,
    It sounds like you have two elements for each crane and forklift service, namely, a labor component that perhaps prepares, delivers, services, etc. each piece of machinery and a material element which is the machine itself. You could create labor and materials
    resources to correspond to each of those elements, but Project doesn't allow you to set a max on a material resource, so creating a material resource for the cranes and forklifts probably isn't going to work.
    What you really need, at least as I interpret it, is a combination schedule (to track your labor) and a spreadsheet (to track your machines). I suggest you only list the labor elements as performance tasks in your schedule. For example, under the Support
    summary line, you might have separate tasks for, Service cranes, Prepare cranes for delivery, Deliver cranes, Retrieve cranes, and likewise for the forklifts. Then, instead of creating or assigning the machines as a resource, customize a couple of extra fields
    (e.g. Text1 and Text2) to track the number of machines that are used and available. For example, if the Text1 field is renamed "Cranes/Forklifts Used", you could enter into that field the number the customer currently has at his jobsite. I would
    enter that value in the Text1 field for the Deliver cranes task. The labor for that task is the truck drivers time to make deleveries and it would be tracked as any normal labor task. Rename the Text2 field as "Cranes/Forklifts Available" and customize
    that field with the formula: IIF([Text1]>"0","250"-[Text1],""). As data is entered into the Text1 field, the Text2 field will automatically calculate the remaining inventory. See the screenshot below.
    Using the above structure you will be tracking both labor and machines and the machine usage will have no impact on progress.
    Hope this helps.
    John

  • How can I make a custom style look the same in both printed and online?

    My specs:
    RH 9.0.2.271
    Windows 7, 64-bit
    Word 2010
    The Background Info:
    So I created some custom css styles to try and mimic the look of a message box in our documentation. Here's the css code:
    .MsgBox {
        color: #000000;
        border-left-style: Solid;
        border-right-style: Solid;
        border-top-style: Solid;
        border-bottom-style: Solid;
        font-size: 10pt;
        background-color: #eeeeee;
        border-left-width: 4px;
        border-right-width: 4px;
        border-top-width: 4px;
        border-bottom-width: 4px;
        border-left-color: #cdcdcd;
        border-right-color: #cdcdcd;
        border-top-color: #cdcdcd;
        border-bottom-color: #cdcdcd;
        width: 350px;
        padding: 5px 5px 5px 5px;
        box-shadow: 10px 10px 5px #888888;
        margin-bottom: 7pt;
    .MsgBoxTitle {
        color: #000000;
        border-left-style: Solid;
        border-right-style: Solid;
        border-top-style: Solid;
        border-bottom-style: Solid;
        font-size: 10pt;
        background-color: #cdcdcd;
        border-left-width: 4px;
        border-right-width: 4px;
        border-top-width: 4px;
        border-bottom-width: 0px;
        border-top-color: #cdcdcd;
        border-bottom-color: #cdcdcd;
        border-left-color: #cdcdcd;
        border-right-color: #cdcdcd;
        width: 350px;
        padding: 5px 5px 5px 5px;
        box-shadow: 10px 10px 5px #888888;
    My HTML Code:
    <div class="MsgBoxTitle">
        PC-DMIS MESSAGE:
    </div>
    <div class="MsgBox">
        <p>Please do the following steps in the indicated order.</p>
        <p>1. Remove the current SH-1/2/3 stylus.</p>
        <p>2. Attach the SHSP (Stylus Holder Setting Piece).</p>
        <p>3. Jog the probe to a safe location with a clear line of approach
         to the port(s) being calibrated. </p>
        <p>4. Then click OK.</p>
        <p>After you click OK the machine will begin DCC measurement.</p>
    </div>
    The Expected Output:
    Here's how it renders in a browser (the title is MsgBoxTitle, the body is the MsgBox style). I'm happy with how it looks there, even if the box shadow doesn't always display:
    The Ugly Printed Output:
    And here's what it looks like in the printed output.
    Ugly. Are there any tricks to get the printable (doc) output to match the online? Ideally, on the printed output, I'd like to have all the white space in my pseudo message box removed so it looks just like the online.

    Hi Peter. Thanks for the reply.
    I assumed that if I used the project style sheet during the export, Word would convert the style so that it looked the same as in the HTML. Is that a bad assumption? I'm currently not mapping to any template equivalent for these message box styles. I did try it as one of my attempts, but I couldn't figure it out. It never seemed to take the style in the .dot.
    Anyway, if I use just 1 style, such as just the MsgBox, I obviously don't get the white paragraph between the title and message. That white paragraph comes from the first <p> tag in the MsgBox style. But I need to have the <p> tags in there because they're better for our localization process than line breaks.
    I did do some tweaks that made it look better. Basically I structured it so that the MsgBoxTitle div is now inside the MsgBox div. Something like this:
    <div class="MsgBox">
        <div class="MsgBoxTitle">PC-DMIS MESSAGE: </div>
        <p>Please do the following steps in the indicated order.</p>
        <p>1. Remove the current SH-1/2/3 stylus.</p>
        <p>2. Attach the SHSP (Stylus Holder Setting Piece).</p>
        <p>3. Jog the probe to a safe location with a clear line of approach
         to the port(s) being calibrated.</p>
        <p>4. Then click OK.</p>
        <p>After you click OK the machine will begin DCC measurement.</p>
    </div>
    And then I adjusted my styles borders, padding, and thickness. That helped it look more connected, but still doesn't look quite right:
    Would love to get rid of that white space after the title.
    If you have time, I would be interested in a more detailed example of how you did it.

  • How do I make the webutil file transfer works correctly?

    Hello,
    I'm using Oracle 10g Database and form builder in developer suite 10g release 2. Running on Windows XP SP2.
    I've created a database user, executed the create_webutil_db.sql , and created a table as below:
    CREATE TABLE DOCS
    (DOC_ID VARCHAR2(15) NOT NULL,
    DOC_IMAGE BLOB,
    TEXT_DESCRIPTION CLOB,
    FILENAME VARCHAR2(80),
    FILE_SIZE NUMBER NOT NULL,
    CONSTRAINT PK_DOCS PRIMARY KEY (DOC_ID)
    I've created two buttons in the from, one for upload and one for download
    the upload code:
    DECLARE
         fname VARCHAR2(1000);
         fext VARCHAR2(1000);
         result BOOLEAN;
    BEGIN
         fname := Client_Get_File_Name(null,null,null,null,OPEN_FILE,TRUE);
         fext := fname;
         WHILE instr(fext,'.') <> 0 LOOP
              fext := substr(fext,instr(fext,'.')+1);
         END LOOP;
         IF LOWER(fext) <> 'doc' THEN
              message('Only Microsoft Word Document (*.doc) can be uploaded');
         ELSE
              result := Webutil_File_Transfer.Client_To_DB
              (trim(fname),'DOCS','DOC_IMAGE','DOC_ID = ' || '''' || :DOC_ID || '''');
              IF result THEN
                   message ('Upload success');
                   :FILENAME := fname;
                   :FILE_SIZE := WebUtil_file.file_size(:FILENAME);
                   WHILE instr(:FILENAME,'\') <> 0 LOOP
                        :FILENAME := substr(:FILENAME,instr(:FILENAME,'\')+1);
                   END LOOP;
              ELSE
                   message ('Upload failed');
              END IF;
         END IF;
    END;
    and the download code:
    DECLARE
         result BOOLEAN ;
    BEGIN
         IF :FILE_SIZE > 0 THEN
              result := Webutil_File_Transfer.DB_To_Client
         (trim(Client_Get_File_Name(null,:FILENAME,null,null,SAVE_FILE,TRUE)),'DOCS','DOC_IMAGE','DOC_ID = ' || '''' || :DOC_ID || '''');
              IF result THEN
                   message ('Download success');
              ELSE
                   message ('Download failed');
              END IF;
         ELSE
              message('No file to download');
         END IF;     
    END;
    I can upload the file to the database, and download the file.
    However, the file being downloaded is corrupted. I don't know why this will happen. I've tried to rebuild the form, re-attach the webutil library, rebuild the database users and tables, but all these doesn't work.
    Please help, thank you.
    Message was edited by:
    se072c23

    1 Can u try running the sample form available from OTN (WU_TEST) and check whether it works
    2 If it doesnt then enable the java console and check the error message
    Rajesh ALex

  • Adobe pro - print settings: How do i make a custom page size list, which i can copy to my other comp

    Adobe pro - print settings: How do i make a custom page size list, which i can copy to my other computers who have adobe pro installed?

    your right.. i ment acrobat pro :-)
    my problem is that i use the PDF printer to export CAD drawings as PDF´s.
    As it is now, there are some pre-defined page sizes in the print settings, and i know i can add custom pages manually one at a time.
    What i want is to copy the list of my danish standard page sizes, and use them on my other versions of acrobat.
    Its like 70 different sizes, and i have them made manually on my current computer, but i hope its possible to copy the list to other computers.
    Maby its some script where i can define the sizes, and then copy to another computer. Im just not that much of a computer genius :-)
    Hope i got through this without to many spelling mistakes...
    Thanks for helping.

  • I got a new computer. How do I make this the primary pc for all of my apple devices?

    I purchased a new pc. How do I make this the primary pc for iTunes and all of my apple devices? I need to know how to take all Itunes files off old pc and put on new pc. Also, disable old pc.

    Backup your library using this User Tip.
    The same tool can be used to backup other important user data.
    Deauthorise the old computer
    Restore the library into the music folder of your new profile. (Use the same tool as for the backup)
    Install iTunes and sign in to your account.
    tt2

  • I have a problem, my ipod wont let me update anything. because my little brother bought something when my credit card had no money on it, how do i make this go away

    i have a problem, my ipod wont let me update anything. because my little brother bought something when my credit card had no money on it, how do i make this go away

    You need to add a valid payment method to your account. Purchasing and redeeming an iTunes gift card will work

  • I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

  • HT1689 I need to get my iPod to no longer be associated with the original i store account. My husband set it up through his account but now I have my own account. I don't want to go through his every time I want to make a change. how do I make this change

    I need to get my iPod to no longer be associated with the original i store account. My husband set it up through his account but now I have my own account. I don't want to go through his every time I want to make a change. how do I make this change?

    I am trying to stop using my I-pod under my husband's I-Tune account.  It was set up under his account and the only way I can use it under my account is to erase all of the songs my husband loaded on for me.  I had heard there is a duration that I-Pods are locked into to one account only, and I am trying to discover how I can use my account without having to erase everything on the I-Pod.  I know it sounds confusing but that's the way I-tunes have set it up.  thanks for asking.

  • How do I make this code generate a new pro when the "NEXT" button is pushed

    How do I make this code generate a new set of problem when the "NEXT" Button is pushed
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    /* Figure out how to create a new set of problms
    * Type a list of specifications, include a list of test cases
    * DONE :]
    package javaapplication1;
    import java.awt.GridLayout;
    import java.awt.Window;
    import javax.swing.*;
    import java.awt.event.*;
    * @author Baba Akinlolu -
    class Grid extends JFrame{
        int done = 0;
        final int score = 0;
        final int total = 0;           
            //Create Panels
            JPanel p2 = new JPanel();
            JPanel p3 = new JPanel();
            final JPanel p1 = new JPanel();
            //Create Radio buttons & group them
            ButtonGroup group = new ButtonGroup();
            final JRadioButton ADD = new JRadioButton("Addition");
            final JRadioButton SUB = new JRadioButton("Subtraction");
            final JRadioButton MUL = new JRadioButton("Multiplication");
            final JRadioButton DIV = new JRadioButton("Division");
            //Create buttons
            JButton NEXT = new JButton("NEXT");
            JButton END = new JButton("End");
            //Create Labels
            JLabel l1 = new JLabel("First num");
            JLabel l2 = new JLabel("Second num");
            JLabel l3 = new JLabel("Answer:");
            JLabel l4 = new JLabel("Score:");
            final JLabel l5 = new JLabel("");
            JLabel l6 = new JLabel("/");
            final JLabel l7 = new JLabel("");
            //Create Textfields
            final JTextField number = new JTextField(Generator1());
            final JTextField number2 = new JTextField(Generator1());
            final JTextField answer = new JTextField(5);
        Grid(){
            setLayout(new GridLayout(4, 4, 2 , 2));
            p2.add(ADD);
            p2.add(SUB);
            group.add(ADD);
            group.add(SUB);
            group.add(MUL);
            group.add(DIV);
            p2.add(ADD);
            p2.add(SUB);
            p2.add(DIV);
            p2.add(MUL);
            //Add to panels
            p1.add(l1);
            p1.add(number);
            p1.add(l2);
            p1.add(number2);
            p1.add(l3);
            p1.add(answer);
            p1.add(l4);
            p1.add(l5);
            p1.add(l6);
            p1.add(l7);
            p3.add(NEXT);
            p3.add(END);
            //Add panels
            add(p2);
            add(p1);
            add(p3);
            //Create Listners
            Listeners();
    void Listeners(){
          NEXT.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
             int answer1 = 0;
             //Grab the numbers entered
             int numm1 = Integer.parseInt(number.getText());
             int numm2 = Integer.parseInt(number2.getText());
             int nummsanswer = Integer.parseInt(answer.getText());
             //Set the score and total into new variabls
             int nummscore = score;
             int nummtotal = total;
             //Check if the add radio button is selected if so add
             if (ADD.isSelected() == true){
                 answer1 = numm1 + numm2;
             //otherwise check if the subtract button is selected if so subtract
             else if (SUB.isSelected() == true){
                 answer1 = numm1 - numm2;
             //check if the multiplication button is selected if so multiply
             else if (MUL.isSelected() == true){
                 answer1 = numm1 * numm2;
             //check if the division button is selected if so divide
             else if (DIV.isSelected() == true){
                 answer1 = numm1 / numm2;
             //If the answer user entered is the same with th true answer
             if (nummsanswer == answer1){
                 //add to the total and score
                 nummtotal += 1;
                 nummscore += 1;
                 //Convert the input back to String
                 String newscore = String.valueOf(nummscore);
                 String newtotal = String.valueOf(nummtotal);
                 //Set the text
                 l5.setText(newscore);
                 l7.setText(newtotal);
             //Otherwise just increase the total counter
             else {
                 nummtotal += 1;
                 String newtotal = String.valueOf(nummtotal);
                 l7.setText(newtotal);
      //Create End listener
    END.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            // get the root window and call dispose on it
            Window win = SwingUtilities.getWindowAncestor(p1);
            win.dispose();
    //new Grid();
    String Generator1(){
         int randomnum;
         randomnum = (1 + (int)(Math.random() * 100));
         String randomnumm = String.valueOf(randomnum);
         return randomnumm;
    public class Main {
         * @param args the command line arguments
        public static void main(String[] args) {
            // TODO code application logic here
            JFrame frame = new Grid();
            frame.setTitle("Flashcard Testing");
            frame.setSize(500, 200);
            frame.setLocationRelativeTo(null);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
    }Edited by: SirSaula on Dec 7, 2009 10:17 AM

    Not only are you continuing to post in the wrong forum but now you are multiposting: [http://forums.sun.com/thread.jspa?threadID=5418935]
    If people haven't answered you other posting its probably because we don't understand the question. Quit cluttering the forum by asking the same question over and over and then next time you have a new question post it in the proper forum. Your first posting was moved becuase you didn't post it properly.

  • I want to use my DVD from my WIndows 7 Computer to install Office 2011 for Mac.  How do I make this work?

    I want to install Mac Office from my DVD drive located on my Windows 7 computer.  How do I make this work?

    Well, it sounds as though you are trying to install Windows software on a Mac computer.
    If that's really what you want to do, you have another project to do first. You could use Apple's Boot Camp software or 3rd party software such as Parallels or VMWare. If so, you have some reading and research to do.
    Or maybe you are trying to use Remote Disc? Here is a link to using Remote Disc for Windows:
    http://support.apple.com/kb/HT1777
    I hope that this gets you started. Good luck.
    dick glendon

  • HT4356 I have an older HP connected to the usb port of my Time Machine, and have it shared.  I want to print from my iPhone on the network, but it can not be found in airport?  How do I make this work?

    I have an older HP connected to the usb port of my Time Machine, and have it shared.  I want to print from my iPhone on the network, but it can not be found in airport?  How do I make this work?

    AirPrint printers connected to the USB port of the Apple AirPort Base Station or Time Capsules are not supported with AirPrint.
    Read through this for information about Airprint printers and how to use them:
    http://support.apple.com/kb/ht4356

  • I keep Mail open on my MacBook Pro and prior to Mavericks items would open on my 27" secondary display. How can I make this happen in Mavericks?

    I keep Mail open on my MacBook Pro and prior to Mavericks items would open on my 27" secondary display. How can I make this happen in Mavericks?

    In System Preferences > Mission Control, uncheck mark Displays have seperate windows. This should bring you back to the secondary display you had before the upgrade. You may have to open Mail, the first time and place it on your secondary display. You also won't have the advantages of the dock and menus on the secondary display.
    I keep my own secondary display with these settings because I need the ability to expand a window across both displays.

  • My Iphone5 won't switch to landscape view when I turn my phone to the side...what am I missing and how do I make this happen

    My Iphone 5 won't turn to landscape view when I turn it to the side...what am I missing and how do I make this happen...it used to happen automatically...I thought.

    I had the same problem but it wasn't because the orientation was locked .
    Mine was some kind of glitch that was resolved by holding down the home key and the button on top until the white Apple appeared on the screen .

  • When filling out a form, some fields copy to others when I tab to the next. How can I make this stop?

    When filling out a form, some fields copy to others when I tab to the next. How can I make this stop?

    You can't using Adobe Reader. It looks like whomever created the form used the same identifiers (names) for various fields. Each field with the same name will populate with the information used in another field of the same name. This is intentional.
    Normally when I see this, it tells me that someone created an initial field then copy/pasted it to make additional fields but forgot to change the names.

Maybe you are looking for