How to use a flex custom component in an AS3 Class?

Our software team has been developing flash applications using AS3 (via the FlashDevelop IDE and the free Flex SDK).  Recently, some members of the team started exploring FlexBuilder and Flex (wow... why did we wait so long?).  The problem is that some folks continue to develop using pure Action Script 3 (FlashDevelop) while others are creating custom components in FlexBuilder.
How do the AS3 developers use the Flex Custom components built in FlexBuilder in their AS3 Applications?

SwapnilVJ,
Your suggestions enabled me to make progress, but I'm still having a problem.  Based on you suggestion, I learned how to make a swc using Flex Builder.  I successfully added the swc to the lib resource in my AS3 project (FlashDevelop).  I was able to instantiate one of my new components (code hinting even picked it up from the lib).
When I run my app, my component is not visible.  I can trace properties of it and the values are correct.  Any thought why I might not be seeing my custom component?
package trainer.games.board.MatchThree {
import flash.display.Sprite;
public class Test extends Sprite{
  private var cp:MatchingGameControlPanel; // <<< this is my swc custom component created in Flex
  public function Test() {
   cp = new MatchingGameControlPanel();
   cp.visible = true;
   addChild(cp);
   trace("width: ",cp.width); // <<< works and displays valid data for the component.

Similar Messages

  • How do I duplicate a custom component w/minor change?

    I want to use the same custom component created in Flex in Xcelsius with a slight modification from the original, but the Add on Manager is saying it is a duplicate. What do I need to change in the code to resolve this?

    i was always having the same issue before
    1. change the class name into the Flex Code
    2. DONT copy paste the Add on Manager FIle, XLP,,, you have to create a new one :)... this is the idea
    3. give a new name into the Add on Manager.
    thanks
    Amr

  • Using Flash Catalyst Custom Component in Flash Builder

    I created a custom component in  Flash Catalyst that is intended to be used in the way that one would use  a BorderContainer in Flex/Flash Builder. Can anyone advise me how I  might go about doing this?
    many thanks,
    Mark

    And also there's a lot of new content to help every one started at http://www.adobe.com/devnet
    If you're a CF/Flex developer you're gonna enjoy the new content here too
    http://www.adobe.com/devnet/flex/flex_cf.html?devcon=f3

  • How Do I Link to Custom Component States From Scrolling Content Buttons?

    Hi there, I'm in need of some help as i've got a deadline to meet within the next few weeks and im stuck!
    Basically what I've done is i've made a scrolling content lists, containing about 10 products in each one, my plan was to turn each product into a button so that users could click on that product, and take them to a new page containing more detailed information on that product; when they've finished looking at that product they can click a button to return them to the list they were on previously. However I can't just make a brand new state for each product as there is a limit to 20 states, and I will need around 50 of them.
    So, from what i've read I will need to create custom components. the only trouble with doing this is that I can't link to the custom component on a different main timeline state (I dont get the option to link to the states of the custom component).
    If i put the image of the detailed product into the scroll panel I am able to link to it, however, it's inside the scrolling content and it just scrolls around and stuff which isn't what I want; as it makes it look messy.
    - Basically I just need to link from the buttons in the scrolling list, to a more detailed page for that product. Then be able to return to the list using a button.
    If anybody has any input on how to achieve this, please help me out. Starting to panic now as this needs to be finished before september :s
    Btw i'm happy to share my .fxp file it that helps.
    Thanks alot, Hoping for some helpful replies on this topic
    - Tom

    Hi Tom,
    Adding this back here to share my wireframe with the community.
    Have put a quick .fxp together based on the 'product' section of your project.
    Take a look at how the product lists are linking into the product detail pages within their custom components. 
    Using this model you should be able to expand out to infinite product detail states.  If a particular product area has more than the maximum allowed states, just start a new custom component (part 2 for that product section).
    Let me know if you have any questions. Hope this sets you on a path to getting your project complete.  It's looking nice.
    Tanya

  • How can I make a custom component focusable?

    Hi all,
    I'm using a custom made component that consists of a JLabel
    and a JTextField. I want to make this component focusable,
    and when it's in focus I want the JTextField to have the
    focus so that the user can start typing immediately.
    I've looked at the java tutorial
    (http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html#focusable).
    When my component gets the focus I request the focus to the
    JTextField. The problem is: whenever i check if my custom
    component has the focus, it hasn't because JTextField has it
    (the focus, i mean :-) ) Which isn't strange i think, but
    how can i solve this problem?

    I want to make this component focusable, and when it's in focus I want the JTextField to have the focus
    The problem is: whenever i check if my custom component has the focus, it hasn't because JTextField has it (the focus, i mean :-) So whats the problem the textField has focus as desired.
    You don't need to make the containing panel focusable in order for the text field to receive focus. The FocusManager is smart enough to place focus on the first focusable component contained in the panel. If you make the panel focusable then you will need to use the tab key twice, once to move focus to the panel and a second time to move focus to the text field.

  • Using nullLayout for custom component

    I am writing an AccordianPanel as a custom component that can be dropped into a JPanel and behave as expected. I am using a null layout in the outer container (JPanel) as the accordian dividers need to move as told and not be managed by a layout manager. When I resize a window or another container that the custom component sits in, it doesn't resize anything - I understand this is the behavior I would expect as that is how I coded it.
    Now, I want to have the custom component resize its internal stuff when the container it resides in (i.e. JFrame or most likely another JPanel) gets moved, but I don't know how to do this. The outer most component in my custom components hierarchy is a JPanel whose layout is set to null and I stuff everything else inside there.
    I believe I need to add a componentListener to my JPanel whose layout is set to null, but I am not sure. Could someone send me in the right direction.
    thanks

    the best approach might be to implement your own LayoutManager (which is simple enough) and use it rather than absolute positioning....
    If you read postings in the forum you will find most people recommend using LayoutManagers and not a null layout so you don't have problems like this.Hello sarcommand , camickr, and anyone interested,
    I've tried to bring this discussion up again just a few days ago, and was disappointed I got no feedback - must be a dull read :o(
    Here is the [link to the thread|http://forums.sun.com/thread.jspa?messageID=10723670&#10723670], would you mind having an eye on it?
    I'm sorry to hijack this thread (seems slightly less rude than bumping my own former thread up), but I've read several discussions on this subject too, and still I can't decide whether I should follow the CustomLayoutmanager track.
    Although most of the writing there is specific to my current problem, it highlights 3 points I think are general enough:
    - A custom layout (whatever the way it is implemented, I discuss 4 approaches in the thread) is generally used to display custom components, or at least, components that represent custom application-specific entities or input points. -> Is is worth the trouble to abstract the positioning logic when this "custom layout" has only one, at best two, use cases (a couple of specific screens in your specific app that represents your specific entities)?
    - A custom (app-specific) layout manager is likely to require more knowledge about the things being layed out than the default min/max/pref sizes. In particular it may require to know data of the underlying model objects represented by the children components. How is that best designed? I tentatively think it's by way of custom Constraint classes which have to be abstract enough yet should be easily mapped from the app-specific data.
    - The CustomLayoutManager integrates natively with regular graphical events (hiding, resizing,...), but how to integrate app-specific events (such as, when the underlying data change in such a way that should be reflected by a change in the layout, how/when to force the re-layout)?
    Thank you for your help.

  • How do I tie a custom-component to a class?

    In flash there's this great way of seperating code from
    content: In the properties menu of a movieclip in your library, you
    can assign a class name to the movie. So something I very regularly
    do is:
    class MyMovieClip extends MovieClip{
    //etc..
    so I'd have all the code that manages my movies nicely tucked
    away in some .as files, no code in the fla. That's the way I like
    it.
    So I was wondering if you can do a similar thing in Flex. I
    most definitely don't want the code for my application in the .mxml
    file, I actually want to inherit the Application class. Similarly,
    I'd like to inherit the Canvas class, yet have the nice gui for
    dragging all the visuall elements in place. Is there a way?
    Regard, and thanks in advance,
    Karel

    If you look in the library panel, there should be an entry for your custom component - probably something like CustomComponent1.mxml. Drag this out onto the artboard to create a new instance of the component.
    In the case of a custom component, you can't change much on the second instance. If you have something like a text input skin though, you can change the text it is displaying for each instance.
    We are working on making this sort of thing easier in the future, so stay tuned

  • How do I reuse a custom component in Flash Catalyst?

    All-
    I'm sure this is easy, I simply can't figure it out.  I've created a custom component in Flash Catalyst with two states, open and closed.  I'd like to reuse this component in my app with different text assest.  How is this done?  Duplicating the component isn't available in this version...do I need to recreate the whole thing with different text?
    Cheers,
    `me

    If you look in the library panel, there should be an entry for your custom component - probably something like CustomComponent1.mxml. Drag this out onto the artboard to create a new instance of the component.
    In the case of a custom component, you can't change much on the second instance. If you have something like a text input skin though, you can change the text it is displaying for each instance.
    We are working on making this sort of thing easier in the future, so stay tuned

  • How do I automate a custom component not implementing UIComponent?

    I have tried using Adobe's instructions for automating custom components by creating a delegate class to use as a mixin, but
    1)  the super() statement in the delegate of the constructor is not recognized by the compiler,
    2) I am not able to use a DisplayObject as an argument to init(),
    3) I am not able to return the custom component as a IAutomationObject from the parent component's getAutomationChildAt method.
    Is it simply not possible to automate a custom component not implementing UIComponent?

    If you look in the library panel, there should be an entry for your custom component - probably something like CustomComponent1.mxml. Drag this out onto the artboard to create a new instance of the component.
    In the case of a custom component, you can't change much on the second instance. If you have something like a text input skin though, you can change the text it is displaying for each instance.
    We are working on making this sort of thing easier in the future, so stay tuned

  • How to handle children of custom component

    Hi,
    does anybody know an example of how to develop a custom UIComponent which is able to render any kind of child? For example:
    <x:mycomponent columns="3" valu="#{list-of-items} var="item">
    <h:graphicImage url="#{item.url}/>
    <h:selectBooleanCheckbox />
    </x:mycomponent>
    The result should be a table with 3 columns where each table-cell contains the result of the rendering process of its children, in this case a picture with a checkbox.
    I have tried it and managed to get the correct html-result. But I do not get the input of the checkbox if the above code snippet is a part of a html-form.
    So what I realy like to have is the sourcecode of some kind of UIComponent which does something like this.
    Kind Regards,
    Tobias

    Thanks for the swift reply Craig
    My custom component has 3 elements hence the currentTarget
    could be either the folder icon, the status icon or the text field.
    Is there some way of finding the parent of which ever of
    these sub items of the cusom component is clicked?
    Here is the code for my custom component
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="240" height="60" cornerRadius="15" borderStyle="none"
    backgroundColor="#ffffff" themeColor="#ff0000">
    <mx:Script>
    <![CDATA[
    [Bindable]
    public var studentName:String ="Student Name";
    ]]>
    </mx:Script>
    <mx:Text x="64" y="24" text="{studentName}" />
    <mx:SWFLoader x="10" y="10" width="32" height="24"
    source="@Embed('assets/folderIcon.swf')" />
    <mx:SWFLoader x="19" y="42" width="11" height="11"
    source="@Embed('assets/cfStatusIcon.swf')" />
    </mx:Canvas>

  • HELP: do u know how to use forms pluggable java component...

    Hi all,
    I'm looking for a sample for using java component within Forms: how to installl them? how to use them? ...
    Cyryl from france

    Did you already check the demos on OTN at:
    http://otn.oracle.com/sample_code/products/forms/content.html
    Check the viewlets to see how to develop and deploy them and you can even get code to use them.

  • How to manage focus in custom component

    Hallo. As you know some flex components have native focus, like buttons, textinput etc.. I have created a custom component which is a borderContainer.. As you know, by default, if user press TAB my BorderContainer will never receive the focus.. I tryied to set some property like setFocus() and tabFobusEnabled to true but i still have some focus problems with my borderContainer .. It is like my App knows that my Custom component is not a native component.. Is there a way for my component to receive focus without problems??.. Which is the best way for doing that??
    Thx a lot
    Max

    Components must implement IFocusManagerComponent in order to receive focus.

  • Building custom Component -- choice of base class...

    Hello,
    I am building a customer component. The component will be a AJAX enable Grid.
    I am not sure what base class would be the best.
    I am planning on using the "UIComponentTag" as the base class of my tag file. Here is the declaration:
    public class EbaAjaxGridTag extends UIComponentTag {
    Let me know how-you all feel about this choice.
    Cheers,
    Godfrey

    Yep, that's the right class. All JSF component tags inherit UIComponentTag (eventually in their hierarchy). I suppose there is UIComponentBodyTag, but you should make a custom renderer instead of writing the tag body from the tag class. In other words, you don't want UIComponentBodyTag.
    It would also be ok if you wanted to extend another component tag (i.e. InputTextTag). This would give you access to the pre-existing attributes of that tag class. HOWEVER, you should be warned that these tag classes can change in future versions of JSF. So make sure you are willing to maintain it in the future before doing that.
    CowKing

  • How to use a method in sequence diagram from a class diagram

    Hello, can someone tell me how to use the method from class diagram in sequence diagram? so far i only can add a classifier to the object lifeline but i still cannot add the method from the class...
    thx

    Now that Web Services is around, I'd look at possibly implement a Web Service call in your applet, which can then be given back any object(s) on return. Set up your server side to handle Web Service calls. In this way, you can break the applet out into an application should you want to (with very little work) and it will still function the same

  • How to interact with a COM component from a Java class

    Hi, could someone give a hint on what API I should explore in order to interact with a COM component from a Java class?
    Thanks in advance
    Luis

    jacob sounds nice...http://danadler.com/jacob/

Maybe you are looking for

  • Looking for some help regarding motion menus in encore from AE.

    Need help making a motion menu from after effects. can figure out the import process into encore. I cant get the buttons i made in AE to work. Anyone?

  • BPM with 2 receive steps

    Hi folks, I want to create a BPM which can be used for 2 different IDOCS - they are both being mapped towards the same XML flavour and then send out ... I created a "ForEach" step with 2 branches , put necessary branches to "1" and defined a receive

  • Unwanted spaces in cross references.

    Im getting an extra space just after the opening quote in some cross references in FM10 Structured document. This causes the cross reference to wrap around incorrectly and also looks bad. The space does not appear in the definition, in fact majority

  • Has anyone got BTCONNECT (POP) mail working on their Touch?

    I have had my Touch for just over a week and all is well, except MAIL. I just can't get it to work with my BTCONNECT (POP) account.. I managed to get OUTGOING mails working.. But incoming is not working.. I get an error saying that it can't connect t

  • 10g AQ Adapter converting to 11g JMS Adapter

    Hi, I'm looking for any documentation that shows how to migrate a project/application from using 10g AQ Adapter to 11g JMS Adapter. Thanks, Bruce