Custom component classes

Hi all

I learned flex a few months now and absolutely love it!
But there is one thing that I can't get my head round. I use mostly for a Flash user, which is probably why I'm confused...
I want to be able to make custom components that use a custom class.
For example, I have the canvas custom components that are 'pages' that I'm loading dynamically if necessary. When they do, I want that they fade by using the fade effect. So far, I wrote the code to do this on each component, which is quite annoying because I have a lot of pages.
I would like a custom class with the code in it for the bland, whose each component uses "page", so each will fade when loading.
I have this could very easily using clips in flash, but flex looks different. Maybe I'm confused in what concerns paintings and MovieClips.

Please can someone help me? :)

You can do this one of two ways

If your base class "custom components" is a canvas you can tell



or you can just create a custom catalog as _funkyboy DESCRIBED, and then create instances of it as you normally would for other tags mx. Flex builder should be smart enough to put in all of the import statements if you don't understand how

Hope this has helped

-A

Tags: Flex

Similar Questions

  • Question about the use of the custom component class define what declarative component

    12.1.3 jdev

    I'm trying to define a declarative component with my custom component class.

    This is the code for my component jsf declarative. I'm trying to use the label on selectManyListbox attribute to pass queryClass for my component class name. It does not work. I also try to use f: attribute to my component class. It does not work too. Question 1: how to move my declarative component attribute to my class of component?

    < af:panelLabelAndMessage label = "#{attrs.displayLabel}" id = "dc_plam1" > "

    < af:switcher id = "dc_s1" defaultFacet = "a lot" facetName = "#{attrs.single eq 'true'?' unique ': 'a lot'}" >

    < f: facet name = "a lot" >

    < af:selectManyListbox id = "namingp1" simple = "true" label = "#{attrs.queryClass}" "

    ' autoSubmit Binding = "#{dropListComp.selectManyListBox}" = "true" valueChangeListener = "#{dropListComp.selectManyValueChange}" >

    < f: attribute name = "queryClass" value = "#{attrs.queryClass}" / >

    < / af:selectManyListbox >

    < / f: facet >

    < f: facet "single" = name >

    < af:selectOneListbox id = "sl_2" simple = "true" label = "#{attrs.queryClass} '"

    autoSubmit Binding = "#{dropListComp.selectOneListBox}" = "true" valueChangeListener = "#{dropListComp.selectOneValueChange}" > "

    < / af:selectOneListbox >

    < / f: facet >

    < / af:switcher >

    < / af:panelLabelAndMessage >

    That's how I try to retrieve the label or f: attribute queryClass in my component class. I get null for both directions.

    {} public void setSelectManyListBox (RichSelectManyListbox selectManyListBox)
    this.selectManyListBox = selectManyListBox;
    If (this.selectManyListBox.getChildCount () == 0) {}
    queryClass = (String) this.selectManyListBox.getLabel ();
    System.out.println (".. queryClass of the label..." + queryClass);
    If (queryClass is nothing)
    {
    queryClass = (String) this.selectManyListBox.getAttributes () .get ("queryClass");
    System.out.println (".. queryClass of attr..." + queryClass);
    }
    If (queryClass is nothing)
    queryClass = "glog.server.query.powerdata.InvolvedPartyQualQuery";
    this.selectManyListBox.getChildren () .addAll (buildDropListSelectItems (queryClass));
    }
    }

    Thank you.

    Hello

    If your declarative component has a defined class of request attribute then #{attrs.name_of_attribute} called from Java should be able to solve

    Frank

  • Pots in the path of a custom component class

    I use the dom4j - 1.6.1.jar in a custom component library, but my JBoss server has dom4j.jar in jboss\server\all\lib.  My custom component is throwing the following error message:

    DefFoundError message: org/dom4j/xpath/DefaultXPath during the call to service XmlToCsvService and convert operation and no way fault proved be configured.

    This makes me suspect that the Dom4J version in the server lib directory is takes precedence over that of my component.  Any suggestions for how to manage this?  Thank you.

    Jared Langdon

    Even the suggestion of Marcel does not always work, but it is certainly worth a quick try.  I remember nothing but try and find one of LiveCycle EAR files has a version of dom4j buried in it (I don't remember which version of LC it was).

    Of course change an Adobe provided EAR is not recommended and can break your support agreement. There is an alternative, however; If you change the JBoss lib folder does not work.  To avoid conflict, you can use Victor to rename the package within the DOM4J class and deploy the jar in your component to avoid the conflict.

    http://code.Google.com/p/jarjar/

    You would then use the classes renamed in your component:

    Import org.mypackage.dom4j.Document;

    Import org.mypackage.dom4j.DocumentException;

    Import org.mypackage.dom4j.DocumentHelper;

    Import org.mypackage.dom4j.Element;

    Import org.mypackage.dom4j.Node;

    Import org.mypackage.dom4j.io.DOMReader;

    Import org.mypackage.dom4j.io.DOMWriter;

  • Need to include classes in the custom component

    Dear Experts,

    I have created custom components, for custom components, I used some different classes and jars and libs and now I want to include these pots, the lib and classes in the generation of custom component file.

    Please advise me how can I add these files in the component so that when I create the zip file included in the zip file.

    Please send me a link where I can get this information.

    Any help will be really appreciated.

    Kind regards

    Elena

    See the tutorial Services Intradoc

  • How to declare an instance of custom actionscript classes, extending a component Flex

    SOLVED.  Failed to add the '. '. ' * ' after the name of the directory.

    You can instance in two ways

    (1) as mxml tag

    If you want to use as an mxml tag, you must specify the namespace in the Application tag

    http://www.Adobe.com/2006/mxml" xmlns:custom =" "com.myComponents. *" layout = "absolute" / > "

    xmlns:custom = "" com.myComponents. * "/ / components created in the myComponents directory will be included in the application"

    the custom is the namespace and MyText is the class that you have declared in the myComponents and the name of the instance is txt

    (2) as actionscript object

        
    import com.myComponents. *.
          
    public var txt:MyText;   Declaration of instance of the MyText (custom component)
    ]]>
            
    If this post answered your question of aid, please mark it as such.

  • Is it possible to "build" a custom component using a command line script?

    Hi all

    From time to time to replicate our environment in instances of development/sandbox sandbox, we need the current generation of custom components production.

    What we do in general is - Component Wizard allows you to "build" each component one & then download the ZIPs. \

    I wonder if there is some sort of command line to "build" a custom component?

    That would allow me to write a script to quickly create all my custom components in a go, whenever necessary.

    Kind regards
    Prateek

    To answer the original question, Yes, there is a command line tool to build, activate, deactivate and install the components (even with the preferences), her right here:

    / Data/Oracle/user_projects/Domains/my_domain/UCM/CS/bin/ComponentTool

    Usage: ComponentTool [v |-vv] [t trace_section]--enable |-disable name

    ComponentTool [v |-vv] [t trace_section]... - sync

    ComponentTool [v |-vv] [t trace_section]... [- Install] path.hda: path.zip [-path.hda Preferences]

    ComponentTool [v |-vv] [t trace_section]--check-depends name

    ComponentTool [v |-vv] [t trace_section]... - name of the package

    ComponentTool [v |-vv] [trace_section]...--list-enabled|--list-disabled|--list|--interact|--help t

    The only thing is to compile the Java classes for you. For this you will need to an ANT script or something.

  • Alternative to RIDC getResponseStream() in Custom Component

    I am trying to create a custom component that does some work with the primary file and checks in another file. When the replacement file is started, I want to check in the primary file.

    I have found a way to recover the primary file using RIDC, but I'd like to find a way to include this functionality in a custom filter class. Here's a snippet of what I want to reproduce inside the filter:

    ServiceResponse response = idcClient.sendRequest (userContext, binder);

    InputStream fis = response.getResponseStream ();

    OutputStream fos = new FileOutputStream (filename); @

    read of fis, write to fos

    the comparison/work

    My question is mainly to find where the content server provides the input stream for a file that is stored in the database.

    http://www.redstonecontentsolutions.com/technical-blog/Java-filter-retrieving-aFile

    http://www.ecmconsultant.NET/2011/09/UCM-11g-retreiving-rendition-path.html

    Jonathan

    http://jonathanhult.com

  • GET_SEARCH_RESULTS the inside of the custom component

    Greetings,

    I work with a custom component and have led to a question in the process. Basically, inside my component I have references of hyperlink to items in my content server (ex: [! - $wcmUrl ('resource', 'SAMPLE_CONTENT_ID')-].) Now, is in view of the content of an element ID, possible to find this element web site? I scoured all the possible metadata fields and not seen one, but maybe I'm a lack?

    Also, I have some experience with CRMI services available. However, when I try and run these services thanks to a component, my 'validateCheckInData' filter is not able to be executed. I guess that's due to a conflict between types DataBinder. I am able to easily enter the location of a given element web content on my local machine ID by using the code below:

    IdcClientManager Manager = new IdcClientManager();

    IdcClient idcClient = (idc_host) manager.createClient;

    UserContext IdcContext = new IdcContext (idc_user);

    DataBinder binding = idcClient.createBinder ();

    binder.putLocal ("IdcService", "GET_SEARCH_RESULTS");

    binder.putLocal ("QueryText", "dDocName < match >" "+ CONTENTID +"'");

    RequestResponse ServiceResponse = idcClient.sendRequest (userContext, binder);

    DataBinder serverBinder = requestResponse.getResponseAsBinder ();

    DataResultSet dataresultset = serverBinder.getResultSet ("SearchResults");

    DataObject dataobject = dataresultset.getRows () .get (0);

    String url = dataobject.get ('URL');

    If the web site field is not metadata, is it possible for me to run the service GET_SEARCH_RESULTS of my component? The lines above in bold indicate the issues I have with my code by copying and pasting from my local machine to my component code that is executed on the server.

    Thank you!

    > Would you mind critical code in my original post?

    Your code is absolutely horrible, just a joke, I would not dare to criticize the work of others.

    > A million Red flags arose when I had to start my DataBinder object Cast to point to the RIDC jar

    In general, I would not advise to use RIDC leave within a component. CRMI is a client-side technology, while the components (or filters) reside on the server. You use better intradoc API (see http://jonathanhult.com/blog/2012/12/where-are-the-intradoc-java-classes-located/)

  • How to pass skinclass for custom component?

    Hi guys, I'm moving my main application of my custom component skinClass. Here is my code, but it gave me an error saying "initializer for 'skinType': values of type spark.componets.supportClasses.Skin' cannot be represented in the text. "  I don't know if it is possible to do. Any thoughts? Thank you very much.

    hand. MXML

    < components: loginPanel id = "loginPanel" horizontalCenter = "33" "-15" = Red

    skinType = 'skins. CustomPanel.

    loginButtonClick = "loginpanel_loginButtonClickHandler (event)" / >

    component loginPanel

    script

    [Bindable]

    public var skinType:Skin;

    MXML

    < s:Panel cornerRadius = "5".

    ID = "loginPanelComp".

    "32" = x y = '8 '.

    width = "373" height = "200".

    title = "sign in".

    skinClass = "{skinType}.

    >

    ...............

    < / sign >

    You try to pass a string to match the value of a class. SkinnableComponent skinClass property is a style.

    You must use styles css, or if you want to set this runtime do something like

    private var _skinRef: Class;

    public function set skinClassRef(value:Class):void

    {

    _skinClassRef = value;

    If (loginPanelComp)

    {

    loginPanelComp.setStyle (skinClass, skinRef);

    }

    }

    C

  • Two-way data binding on custom component

    Hi, maybe there is already a post for this question, but the search engine seems to be broken...

    I found many many examples of two-way data binding on a text element, but I want to use it on a custom component.

    DS I want to do:

    < myPackage:MyComponent myLabel="@{myModel}"/ >

    MyComponent is a group that contains a label, among other things.

    That the label displays the string in the var myLabel.

    A click on the MyComponent calculates a new value to myLabel.

    So I want the label to display this new value AND the original myModel to get the new value also (thanks to the @).

    Is this possible? Do I have to add a Binding tag with a name of special event on var myLabel?

    It's true!

    > I didn't THAT XML was "a collection of objects to structure complex, with variables of class data types the.

    From a conceptual point of view, it's the same thing. You can consider the upper as Employee objects XML nodes and child nodes as WorkHistory objects. And you can think of big children nodes as properties of WorkHistory.

  • Use the custom component to retrieve form data

    Hi, I'm creating a custom component that can extract data from form for a task, when I run the component in the workflow, it will throw an exception:

    "com.adobe.idp.taskmanager.dsc.client.task.TaskImpl cannot be cast to com.adobe.idp.taskmanager.dsc.client.task.TaskInfo.

    on line:

    ' TaskInfo tinfo = taskManager.getTaskInfo (taskId);

    If I put the same code on a java console app to test it, it works fine.

    I tried Google but offer nothing for TaskImpl.

    Thank you

    hkho

    These links should help:

    http://help.Adobe.com/en_US/LiveCycle/9.0/componentXMLRef/webframe.html

    http://help.Adobe.com/en_US/LiveCycle/9.0/programLC/help/index.htm?content=001379.html

    http://www.Adobe.com/devnet/LiveCycle/articles/dsc_development.html

    -Note that for the import-package, it must be explicit.  specifying a.b.c won't matter in a.b.c.d classes.

    -for classes that you import, you can not have the jar in the classpath of component.xml and do not want it in included in your container of components.

    -If you use ServiceClientFactory.createInstance () without a context, then you will get the current context.  Which it is depends on how your service operation is called.  I have direct invocation by a user will have the context of the user.  So called by the engine of workflow in a long-lived process then it will run in a system context.  Since you call TaskManager to extract data from a task, rights of access apply so you should be aware of the context.  The context of the system has full access rights so it can get the desired results.  But runs under the context of the user calling, that user must be the owner of the task or the request fails.

  • Pass a parameter for the custom component - get null

    Main MXML (part of the code):

    < s:Application

    "" xmlns:ns1 = "*".

    creationComplete = "init (); >

    import MyComponent;

    private function init (): void {}

    var myArray:Array is ["FFF", "TT", "RRR"];.

    myComp.width = 200;

    myComp.height = 200;

    myComp.getArray = myArray;

    myContainer.rawChildren.addChild (myComp);

    }

    < fx:Declarations >

    < ns1:MyComponent id = "myComp" x = "0" y = "0" / >

    < / fx:Declarations >

    custom component:

    package 
    {
              public var getArray:Array;
    public class MyComponent extends Sprite { } trace (getArray); trace null
    }
    }

    What is myContainer?

    I have a working version with my container as UICOmponent inside the hand.

    SerializableAttribute public class MyComp extends Sprite

    {

    private var _getArray:Array;

    public void MyComp()

    {

    }

    public function get getArray (): Array

    {

    Return _getArray;

    }

    public function set getArray(value:Array):void

    {

    trace ("setter", value);

    _getArray = value;

    }

    }

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx".

    "" xmlns:NS1 = "*".

    minWidth = "955" = "600" minHeight

    creationComplete = "init (); » >

    private function init (): void {}

    var myArray:Array is ["FFF", "TT", "RRR"];.

    myComp.width = 200;

    myComp.height = 200;

    myComp.getArray = myArray;

    myContainer.addChild (myComp);

    }

    ]]>

    Not sure whether what you are after but it traces:

    Setter FFF TTT, RRR

    Why do you add to rawChildren?

    C

  • How can I access an image embeded in a custom component?

    Hello

    I'm using Flex 3 and I want to access an image embedded in a custom component.

    Let's say that I included an image in the root of the application with the following code:

    [Embed ("myImage.jpg")]
    public var myImg: Class;

    ... and I made a custom in ActionScript using VBox as the base component

    ... and add an image control to the custom component.

    Is it possible that I can use the image embeded as a source for the image in the custom control?

    Hi the CCJA.

    Yes you can do...

    Just use as shown below.

    Import mx.core.Application;

    Don't forget to import the namespace above...

    Application.application gives a reference you to upper-class main level. of demand... and the variable of integration must be public, as you had already kep...

    Thank you

    Jean Claude

  • Custom button class WordWrap

    Someone knows how to make text wrap to a custom button class? I tried everything (as you can see below)! I even tried the Flexlib CanvasButton class, but not really sure how to apply only to one class custom. BTW, these buttons are inside a TileList component if that makes a difference... I love Flex but sometimes its really simple things that you SHOULD be able to easily do that just drive me NUTS!

    Thanks in advance!

    -Mike

    package action.button
    {
    import flash.display. *;
    import flash.events. *;

    Import mx.controls.Button;
    Import mx.controls.listClasses.BaseListData;
    Import mx.controls.listClasses.ListData;
    Import action.button.NoTruncationUITextField;
    Import mx.core.UITextField;
    Import flexlib.controls.CanvasButton;

    SerializableAttribute public class ButtonCatSearch extends button
    {
    private var _baseListData:BaseListData;
    private var _listData:ListData;
    private var _label:String ="";

    public void ButtonCatSearch()
    {
    Super();
    the cursor always behave as if it were a button
    mouseChildren = false;
    buttonMode = true;
    useHandCursor = true;
    height = 150;
    width = 20;
    setStyle ("paddingLeft", 50);
    setStyle ("paddingRight", 50);
    setStyle ("paddingTop", 50);
    setStyle ("paddingBottom", 50);

    setStyle("horizontalGap",100);
    setStyle ("wordWrap", true);

    wordWrap = true;

    addEventListener (MouseEvent.MOUSE_DOWN, onButtonClick);

    }
    public void onButtonClick(e:Event):void
    {
    _label = e.target.label;

    }
    //----------------
    to return to the line
    for button
    override protected function createChildren() (): void
    {
    Create a UITextField to display the label.
    If (! textField)
    {
    textField = new UITextField();
    textField.styleName = this;
    addChild (DisplayObject (textField));
    }
    super.createChildren ();
    textField.multiline = true;
    textField.wordWrap = true;

    super.createChildren ();
    }
    //-----------------
    override public function get listData (): BaseListData
    {
    Return _baseListData;

    }

    /**
    * @private
    */
    override public function set listData(value:BaseListData):void
    {
    super.listData = value;
    _baseListData = value;
    _listData = _baseListData as ListData;
    }
    //-----------------
    override public function set data(value:Object):void
    {
    / * If {(_listData)
    If {(_listData.icon)
    this.setStyle ("icon", _listData.icon);
    }
    }
    */

    Super.Data = value;
    setStyle ("wordWrap", true);
    }
    //-------------------------
    override the updateDisplayList(unscaledWidth:Number,_unscaledHeight:Number):void function
    {
    super.updateDisplayList (unscaledWidth, unscaledHeight);


    this.textField.multiline = true;
    this.textField.wordWrap = true;

    Data.@price < = 0)? NEGATIVE_COLOR: POSITIVE_COLOR);
    }
    }
    }

    You need to replace [] Measure to get the correct behavior. By default, the button sets the width of the TextField child. What you want is for the width of the TextField to be limited by the width of the button and the button height to vary the height measured from the TextField object.

    I had a quick go at below, but it will probably need more work. I used the example of radio button Alex Harui multiline as a starting point:

    http://blogs.Adobe.com/aharui/2007/04/multiline_buttons.html

    ------------------------------------------------

    package
    {
    import flash.display.DisplayObject;
       
    Import mx.controls.Button;
    Import mx.core.IUITextField;

    SerializableAttribute public class WordWrapButton extends button
    {
    Protected Overrides function createChildren() (): void
    {
    If (! textField)
    {
    textField = IUITextField (createInFontContext (UITextFieldNoTruncation));
    textField.styleName = this;
    addChild (DisplayObject (textField));
    }
               
    super.createChildren ();
               
    textField.multiline = true;
    textField.wordWrap = true;
    }
           
    Override protected function [] Measure: void
    {
    If (isNaN (explicitWidth) is false)
    {
    textField.text = label;
                   
    textField.width =
    explicitWidth-
    Value ("paddingLeft")-
    Value ("paddingRight");
                       
    measuredHeight =
    textField.getExplicitOrMeasuredHeight () +.
    Value ("paddingTop") +.
    Value ("paddingBottom");
    }
    on the other
    {
    Super.Measure ();
    }
    }
           
    override protected function updateDisplayList)
    unscaledWidth: unscaledHeight, number: number): void
    {
    super.updateDisplayList (unscaledWidth, unscaledHeight);
               
    () textField.setActualSize
    textField.width,
    textField.getExplicitOrMeasuredHeight ());
               
    textField.move (textField.x, value ("paddingTop"));
    }
    }
    }

    ------------------------------

    package
    {
    import flash.text.TextFormat;
    import flash.text.TextFormatAlign;
       
    Import mx.core.UITextField;

    SerializableAttribute public class UITextFieldNoTruncation extends UITextField
    {
    Public Overrides function truncateToFit (truncationIndicator: String = null): Boolean
    {
    Returns false;
    }
    }
    }

    ------------------------------


    <>
    "xmlns:MX ="http://www.adobe.com/2006/mxml"
    Layout = "vertical".
    "xmlns:local =" * ">
       
        <>
    Width = "50".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "100".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "200".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "300".
    label = "A very long label I want the button to encapsulate" / >

    <>
    Width = "400".
    label = "A very long label I want the button to encapsulate" / >

  • Problem in the use of custom component.

    I want to create a component that is customized by using action script
    I use flex builder 2.
    I looked at the flex guide 2 devlopers and tried with the simplest example, having two parts:

    MyButton.as file for the custom component:
    the myControls package
    {
    Import mx.controls.Button;
    public class MyButton extends button
    {
    public void MyButton (): void
    {

    }
    }
    }

    the main application mxml file contains:
    <? XML version = "1.0" encoding = "utf-8"? >
    < mx:Application
    ' xmlns:MX =' http://www.adobe.com/2006/mxml '
    layout = "absolute" xmlns:myControls = "myControls.*" >
    < myControls:MyButton width = "100" height = "25" / >
    < / mx:Application >

    When compiling, flex builder displays a message:
    Errors exist in the project (s) required: MyProject
    Continue the launch?

    However, when I remove the following line from the main application file:
    < myControls:MyButton width = "100" height = "25" / >
    It runs successfully.

    Please someone help if there is any question about.

    The only thing I can think is that MyButton.as is not a directory of myControls, with myControls directory is a subdirectory of the directory is your mxml file. It's the only thing I can think of.

Maybe you are looking for

  • Satellite Pro A200 - Supervisor Password Setup Utility fails

    Hello I own a Satellite Pro A200-PSAE7E and a license to retail for Windows Vista Ultimate 32-bit Edition (with SP1) is installed. Before installing Vista, I have updated the BIOS to the latest version available on the Toshiba site (http://it.compute

  • minimum Serch in every second

    Hello! I use the DAQ Assistant, and I have an analog input channel. I want to find the minimum value of my signal every second. So, I want my vi, to write the minimum value of the last second... (what is understandable?) Thus, in the second and a new

  • How would you do a card sort interface

    Hey guys,. I could you some guidance and direction. I would write a Vi that will do the following: In data mode: Write a string and added it to the top of a table Data sort mode: Across all channels in the table of the first element to the last eleme

  • IdeaPad Y430 installation audio driver problems

    Hi, so I tried to reinstall the driver Conexant Audio. because the microphone works, but for some reason whenever I have try t...

  • Question of Sysprep

    Launched Sysprep to the experience of creating an image.  Now, I find restarting the machine opens to a black screen with the text "Setup." computer  I don't think that creating an image would interfere with their normal duties.  I would like to ask