Generic custom control that can display an image or swf?

Hi,
I want to create a custom control that can take an image or swf as an argument and display it in the same way.
If the programmer uses this control (which essentially is a button with custom display) I want him to be able to just state the source and the text that is to be shown. Like this:
   <myControls:myButtonControl descriptionText="swf object" symbolObject="{Application.application.shape01swf}">
or
   <myControls:myButtonControl descriptionText="img object" symbolObject="{Application.application.shape01img}">
where shape01swf and shape01swf are embeded objects as follows:
   [Embed("../assets/swf/Shape01.swf")]
    public var shape01swf:Class;
   [Embed("../assets/images/Shape01img.jpg")]
   public var shape01img:Class;
Which kind of object should I create in my custom control that can display this?
Right now I have created a Class that extends VBox so that I can display the image/swf above the descriptionText.
(I am using Flex 3.)

Aha, so the Image control can use an swf as a source as well?
I just assumed that it could not and I would have to use the SWFLoader to do it.
So, this is my solution:
        override protected function createChildren():void{
            iconField = new Image();
            addChild(DisplayObject(iconField));
            textField = new Text();
            addChild(DisplayObject(textField));
            super.createChildren();
        private function init(e:Event):void{
            iconField.source = symbolObject;
            textField.text = descriptionText;
Thanks!

Similar Messages

  • Any calendar app that can display two calendars per day side by side?

    Is there any app that can display two calendars (data sync with iCloud Calendars) side by side?  e.g. one calendar for planning and the other for actual / diary.

    Calendar can have two or more calendars calendars listed at the same time.
    Each can be a different color for identifidation.
    The first screenshot shows that the Medical and Joint calendars are shared calendars.
    Will that work for you?

  • Report that can display the installation date of an application or program

    Hi,
    Would like to ask if anyone knows a built-in report in SCCM 2012 that can display the installation date of an application or program, either it was through deployment with SCCM or through manual installation?
    Thanks in advance!

    Got this to give me the report that I wanted but eliminating some entry on the SQL Query that
    Peter van der Woude gave. Here's the Query I used to display the computer name, name of software, date of installation and day since installation of the software.
    SELECT TOP (100) PERCENT
    dbo.v_R_System.Name0,
    dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0,
    dbo.v_GS_ADD_REMOVE_PROGRAMS.InstallDate0,
    DATEDIFF(Day, CONVERT(date,dbo.v_GS_ADD_REMOVE_PROGRAMS.InstallDate0), GETDATE()) AS [days since installed]
    FROM
    dbo.v_R_System INNER JOIN
    dbo.v_GS_ADD_REMOVE_PROGRAMS ON
    dbo.v_R_System.ResourceID = dbo.v_GS_ADD_REMOVE_PROGRAMS.ResourceID
    WHERE
    (SELECT ISDATE(dbo.v_GS_ADD_REMOVE_PROGRAMS.InstallDate0)) = 1
    GROUP BY
    dbo.v_R_System.Name0,
    dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0,
    dbo.v_GS_ADD_REMOVE_PROGRAMS.InstallDate0,
    DATEDIFF(Day, CONVERT(date,dbo.v_GS_ADD_REMOVE_PROGRAMS.InstallDate0), GETDATE())
    Thanks
    Peter van der Woude!

  • HT5622 Are there any parental controls that can be placed on an apple ID that a parent would obtain for a child?

    Are there any parental controls that can be placed on an apple ID that a parent would obtain for a child?

    Not on the ID as such, but you can certainly use parental controls (Sustem Preferences) and/or create a limited access user account  (in Users & Groups). You would have to delete any applications or folders s/he is not allowed to have access to.

  • Is there function that can transform a image file into a matrix?

    Hi,
    Is there function in java that can transform a image file into a matrix? What kind of library should be used?
    thx

    It would be ****** nice if we could provide an example but we got more important things to do than stand around and wipe your bottom. Get off that fat thing and find out yourself.
    Took me under a minute to find this link, is it really that hard for you kind of people to search? you know what the word means or looks like?
    http://forum.java.sun.com/thread.jsp?forum=20&thread=363117

  • Is there a limit to custom views that can be created on a list?

    As the title says, is there a limit to the number of custom views that can be created on a SharePoint list?  I did a few online searches and someone mentioned 50, but one of my list already has more then 50 custom views so I'd like to know what the
    true limit is.
    Anyone know?

    The only hard limit is to the number of views that can be shown in the drop down on the UI which is 50 (first 50 actually). I would agree with the assessment made here that the actual limit might be hypothetical but it all comes down to the performance in
    rendering and retrieving these views.
    https://social.msdn.microsoft.com/Forums/sharepoint/en-US/8a0f9d4a-626a-4a54-916a-a1e347835c5e/what-is-the-limit-if-there-is-one-on-the-amount-of-views-that-can-be-on-a-single-sharepoint-list?forum=sharepointgeneralprevious
    I would suggest re looking at your approach to address the requirement by creating these many views and whether something else (dynamic pages, metadata navigation, term navigation, content search web parts etc.) can address the actual requirement
    and in process actually improve page performance.
    Thanks, Ransher Singh, MCP, MCTS | Click Vote As Helpful if you think that post is helpful in responding your question click Mark As Answer, if you think that this is your answer for your question.

  • How to have custom control in DataGridView display object's value?

    I have a sample project located
    here
    The project has a main form `Form1` where the user can enter customers in a datagridview. The `CustomerType` column is a custom control and when the user clicks the button, a search form `Form2` pops up.
    The search form is populated with a list of type `CustomerType`. The user can select a record by double-clicking on the row, and this object should be set in the custom control. The `DataGridView` should then display the `Description` property but in the background
    each cell should hold the value (ie. the `CustomerType` instance).
    The relevant code is located in the following classes:
    The column class:
    public class DataGridViewCustomerTypeColumn : DataGridViewColumn
    public DataGridViewCustomerTypeColumn()
    : base(new CustomerTypeCell())
    public override DataGridViewCell CellTemplate
    get { return base.CellTemplate; }
    set
    if (value != null && !value.GetType().IsAssignableFrom(typeof(CustomerTypeCell)))
    throw new InvalidCastException("Should be CustomerTypeCell.");
    base.CellTemplate = value;
    The cell class:
    public class CustomerTypeCell : DataGridViewTextBoxCell
    public CustomerTypeCell()
    : base()
    public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
    base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
    CustomerTypeSearch ctl = DataGridView.EditingControl as CustomerTypeSearch;
    if (this.Value == null)
    ctl.Value = (CustomerType)this.DefaultNewRowValue;
    else
    ctl.Value = (CustomerType)this.Value;
    public override Type EditType
    get { return typeof(CustomerTypeSearch); }
    public override Type ValueType
    get { return typeof(CustomerType); }
    public override object DefaultNewRowValue
    get { return null; }
    And the custom control:
    public partial class CustomerTypeSearch : UserControl, IDataGridViewEditingControl
    private DataGridView dataGridView;
    private int rowIndex;
    private bool valueChanged = false;
    private CustomerType value;
    public CustomerTypeSearch()
    InitializeComponent();
    public CustomerType Value
    get { return this.value; }
    set
    this.value = value;
    if (value != null)
    textBoxSearch.Text = value.Description;
    else
    textBoxSearch.Clear();
    private void buttonSearch_Click(object sender, EventArgs e)
    Form2 f = new Form2();
    DialogResult dr = f.ShowDialog(this);
    if (dr == DialogResult.OK)
    Value = f.SelectedValue;
    #region IDataGridViewEditingControl implementation
    public object EditingControlFormattedValue
    get
    if (this.value != null)
    return this.value.Description;
    else
    return null;
    set
    if (this.value != null)
    this.value.Description = (string)value;
    public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
    return EditingControlFormattedValue;
    public void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
    this.BorderStyle = BorderStyle.None;
    this.Font = dataGridViewCellStyle.Font;
    public int EditingControlRowIndex
    get { return rowIndex; }
    set { rowIndex = value; }
    public bool EditingControlWantsInputKey(Keys key, bool dataGridViewWantsInputKey)
    return false;
    public void PrepareEditingControlForEdit(bool selectAll)
    //No preparation needs to be done
    public bool RepositionEditingControlOnValueChange
    get { return false; }
    public DataGridView EditingControlDataGridView
    get { return dataGridView; }
    set { dataGridView = value; }
    public bool EditingControlValueChanged
    get { return valueChanged; }
    set { valueChanged = value; }
    public Cursor EditingPanelCursor
    get { return base.Cursor; }
    #endregion
    private void CustomerTypeSearch_Resize(object sender, EventArgs e)
    buttonSearch.Left = this.Width - buttonSearch.Width;
    textBoxSearch.Width = buttonSearch.Left;
    However, the `DataGridView` is not displaying the text and it also is not keeping the `CustomerType` value for each cell.
    What am I missing?
    Marketplace: [url=http://tinyurl.com/75gc58b]Itza[/url] - Review: [url=http://tinyurl.com/ctdz422]Itza Update[/url]

    Hello,
    1. To display the text, we need to override the ToString method for CustomerType
    public class CustomerType
    public int Id { get; set; }
    public string Description { get; set; }
    public CustomerType(int id, string description)
    this.Id = id;
    this.Description = description;
    public override string ToString()
    return this.Description.ToString();
    2. To get the cell's value changed, we could pass the cell instance to that editing control and get its value changed with the following way.
    public partial class CustomerTypeSearch : UserControl, IDataGridViewEditingControl
    private DataGridView dataGridView;
    private int rowIndex;
    private bool valueChanged = false;
    private CustomerTypeCell currentCell = null;
    public CustomerTypeCell OwnerCell
    get { return currentCell; }
    set
    currentCell = null;
    currentCell = value;
    public CustomerTypeSearch()
    InitializeComponent();
    private void buttonSearch_Click(object sender, EventArgs e)
    Form2 f = new Form2();
    DialogResult dr = f.ShowDialog(this);
    if (dr == DialogResult.OK)
    currentCell.Value = f.SelectedValue;
    this.textBoxSearch.Text = f.SelectedValue.Description;
    #region IDataGridViewEditingControl implementation
    public object EditingControlFormattedValue
    get
    if (this.currentCell.Value != null)
    return (this.currentCell.Value as CustomerType).Description;
    else
    return null;
    set
    if (this.currentCell != null)
    (this.currentCell.Value as CustomerType).Description = (string)value;
    public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
    return EditingControlFormattedValue;
    public void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
    this.BorderStyle = BorderStyle.None;
    this.Font = dataGridViewCellStyle.Font;
    public int EditingControlRowIndex
    get { return rowIndex; }
    set { rowIndex = value; }
    public bool EditingControlWantsInputKey(Keys key, bool dataGridViewWantsInputKey)
    return false;
    public void PrepareEditingControlForEdit(bool selectAll)
    //No preparation needs to be done
    public bool RepositionEditingControlOnValueChange
    get { return false; }
    public DataGridView EditingControlDataGridView
    get { return dataGridView; }
    set { dataGridView = value; }
    public bool EditingControlValueChanged
    get { return valueChanged; }
    set { valueChanged = value; }
    public Cursor EditingPanelCursor
    get { return base.Cursor; }
    #endregion
    private void CustomerTypeSearch_Resize(object sender, EventArgs e)
    buttonSearch.Left = this.Width - buttonSearch.Width;
    textBoxSearch.Width = buttonSearch.Left;
    Cell:
    public class CustomerTypeCell : DataGridViewTextBoxCell
    public CustomerTypeCell()
    : base()
    public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
    base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
    CustomerTypeSearch ctl = DataGridView.EditingControl as CustomerTypeSearch;
    ctl.OwnerCell = this;
    public override Type EditType
    get { return typeof(CustomerTypeSearch); }
    public override Type ValueType
    get { return typeof(CustomerType); }
    public override object DefaultNewRowValue
    get { return null; }
    Result:
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Create HTML file that can display unicode (japanese) characters

    Hi,
    Product:           Java Web Application
    Operating system:     Windows NT/2000 server, Linux, FreeBSD
    Web Server:          IIS, Apache etc
    Application server:     Tomcat 3.2.4, JRun, WebLogic etc
    Database server:     MySQL 3.23.49, MS-SQL, Oracle etc
    Java Architecture:     JSP (presentation) + Java Bean (Business logic)
    Language:          English, Japanese, chinese, italian, arabic etc
    Through our java application we need to create HTML files that have to display unicode text. Our present works well with English and most of the european character set. But when we tried to create HTML files that will display unidoce text, say japanese, only ???? is getting displayed. Following is the code we have used. The out on the browser displays the japanese characters correctly. But the created file displays only ??? in place of japanese chars. Can anybody tell how can we do it?
    <%
    String s = request.getParameter( "txt1" );
    out.println("Orignial Text " + s);
    //for html output
    String f_str_content="";
    f_str_content = f_str_content +"<HTML><HEAD>";
    f_str_content = f_str_content +"<META content=\"text/html; charset=utf-8\" http-equiv=Content-Type></HEAD>";
    f_str_content = f_str_content +"<BODY> ";
    f_str_content = f_str_content +s;
    f_str_content = f_str_content +"</BODY></HTML>";
    f_str_content = new String(f_str_content.getBytes("8859_9"),"Shift_JIS");
    out.println("file = " + f_str_content);
              byte f_arr_c_buffer1[] = new byte[f_str_content.length()];
    f_str_content.getBytes(0,f_str_content.length(),f_arr_c_buffer1,0);
              f_arr_c_buffer1 = f_str_content.getBytes();
    FileOutputStream l_obj_fout; //file object
    //file object for html file
    File l_obj_f5 = new File("jap127.html");
    if(l_obj_f5.exists()) //for dir check
    l_obj_f5.delete();
    l_obj_f5.createNewFile();
    l_obj_fout = new FileOutputStream(l_obj_f5); //file output stream for writing
    for(int i = 0;i<f_arr_c_buffer1.length;i++ ) //for writing
    l_obj_fout.write(f_arr_c_buffer1);
    l_obj_fout.close();
    %>
    thanx.

    Try changing the charset attribute within the META tag from 'utf-8' to 'SHIFT_JIS' or 'utf-16'. One of those two ought to do the trick for you.
    Hope that helps,
    Martin Hughes

  • Photo app that can display large EXIF caption field?

    A while ago I went in search of a photo app that could display captions along with my photos.  I didn't really need to do any serious editing of the photo.  I settled on Photo Manager Pro and I'm pretty happy with it except it can only display one line of caption (below the photo): about 100 characters.  Anything more than that is just cut off.  I tend to be pretty verbose in my captions and would like to be able to display 256 chars.  Is anyone aware of an iPad photo app that can do this?  The native Photos app doesn't permit captions, and iPhoto allows only a small caption.

    correction to previous: I meant IPTC caption field.

  • Where is the feature that can unblur an image?

    At the Adobe MAX 2011, this one guy showed a feature that can unblur a blurred image. Is this feature on Photoshop 6 beta?

    No, there was a technology demo of a future technology that can deblur some photos.
    That was not a feature, and it was not promised for any particular product or version.
    It was just an early demonstration of a technology that we are continuing to work on.

  • PC DVD players that can display chapter time elapsed

    I have authored some screener discs with a bunch of episodes on one timeline. I have a chapter marker at each episode. I took for granted apple dvdplayer's ability to display chapter time elapsed, which is a feature that can be found on most set top players as well. The recipients of these screener need to provide some timecodes and on their pc's they can only get the continuous timecode from 00:00:00, which really causes a headache.
    Anyone know of a PC software DVDplayer that allows you to view the elapsed time of the current chapter.
    thanks,
    ryan

    The time display on DVD players shows the time elapsed in a title set not individual chapters.
    The standard way to do this and more accurate is to create a timecode window dub with the time code filter in FCP before exporting.

  • Is there a card that can display DVDSP to an NTSC Monitor

    I'm working on a Mac and would like to be able to view my Mpeg2 files and Menu on an NTSC external monitor. Is there a card on the market that can do this ??? Thanks

    i'm using a G5 but will be upgrading to a Macpro soon. I used to have the wired card along with Sonic Fusion then i upgraded to Sonic Creator and SD2000. The MediaPress Wired card is not very good, especially its preview card. I was hoping that a company like Aja or declink would make a driver so i can use their cards with DVDSP.
    I'm surprise this has not been a problem for most of you DVDSP users. I mean when creating menus, just using your computer monitor for preview is so innaccurate and checking your Mpeg2 files via computer monitor is not great either.

  • Movement of a user control that is on an image

    I have a Windows 8 app and a user control. The user control moves along my finger in the right left and bottom movements. When I try to move up , the body of User control is there and unless I move out of it , its not moving up.
    as u can see in the image that my pointer is on the user control and I am trying to move up but its not happenning. The condition is like , I can click anywhere , the user control appears I can move it anywhere and even if my finger is on the user control
    , it should keep moving
    Apoorv Kumar Upadhyay

    Hi Apoorv,
    How did you place your Usercontrol on that image? How did you implement the moveable UserControl? Could you provide some code snippets?
    In my experience, we can place a Usercontrol and Image control into Canvas control, to make a moveable Usercontrol, we can handle
    ManipulationDelta event and use Transform, here is my sample:
    UserControl:
    <Grid>
    <Rectangle Width="100" Height="100" Fill="Red"
    ManipulationMode="TranslateX,TranslateY"
    ManipulationDelta="Rectangle_ManipulationDelta" />
    </Grid>
    private void Rectangle_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
    var _Rectangle = sender as Windows.UI.Xaml.Shapes.Rectangle;
    var _Transform = (_Rectangle.RenderTransform as CompositeTransform)
    ?? (_Rectangle.RenderTransform = new CompositeTransform()) as CompositeTransform;
    _Transform.TranslateX += e.Delta.Translation.X;
    _Transform.TranslateY += e.Delta.Translation.Y;
    MainPage.xaml:
    <Canvas Name="cv">
    <Image Width="{Binding ActualWidth,ElementName=cv}" Source="Assets/1.jpg" Stretch="Fill" />
    <local:MyUserControl1 />
    </Canvas>
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How would one Create a "Custom Cursor" that can move BEHIND certain layers?

    In terms of Flash expertise I am on the the doddering divkid level -- but have mananged to create a custom cursor; a hand that I want to move about over most layers but under one specific layer. Currently, no matter the layer order, when published the cursor image jumps straight to the top.
    Is there a property I can imbue in the would-be "top" layer or a way of editing or modifying the custom mouse cursor actionscript that would bring about the desired result?
    Many thanks in advance for your time and expertise...........................peace

    you can easily attach the cursor between the specific layers you want using an empty movieclip and add your cursor movieclip to the emptyMC using the class name. Look at the screenshot and follow the code. it works
    and here is the code:
    import flash.display.MovieClip;
    var whytehand:MovieClip=new cur();
    emptyMC.addChild(whytehand);
    emptyMC.mouseEnabled = false;
    emptyMC.addEventListener(Event.ENTER_FRAME, fl_CustomMouseCursor_5);
    function fl_CustomMouseCursor_5(event:Event)
        emptyMC.x = stage.mouseX;
        emptyMC.y = stage.mouseY;
    Mouse.hide();
    Thatz it!

  • I have a 2nd generation iPod that only displays an image of the cord, and an arrow to connect to iTunes. I've done this and it says it needs to be restored. Tried that but I get an error: 1611.  Any suggestions?

    I have a 2nd generation iPod that won't do anything but display the Apple logo for a brief second then an image of the cord suggesting it should be connected to iTunes. I tried to restore it via iTunes but I get an Error: 1611. It does nothing else.  I tried turning off using both buttons...nothing. Any suggestions?

    Error 1611: This error may indicate a hardware issue with your device. Follow the steps in this article. Alsoattempt to restore while connected with a known-good 30-pin Dock Connector cable, computer, and network to isolate this issue to the device. The MAC address being missing or the IMEI being the default value (00 499901 064000 0) can also confirm a hardware issue. Out-of-date or incorrectly configured proxy or security software, such as FoxyProxy, can cause error 1611. To troubleshoot third-party security software, follow these steps.
    Above from:
    http://support.apple.com/kb/TS3694#error1611
    Note it could be a hardware problem

Maybe you are looking for

  • WMS2011 Domain Logon / Network Issues

    We have recently installed 3 MS6200 Series HP MultiPoint Servers for a school and we are having a sporadic problem with one or more of the servers losing connectivity with the domain, preventing users from loggin on to the clients (t150 zero clients)

  • Do i need to bring in ID/documents into store if want to set up mobile contract?

    Hi, i have nebver been with EE before and looking to take out a 2 year mobile contract.  Does anyone know how you set up a Contract? do i have to go into store and take in any ID/ proof of identity or any other documents?thanks,

  • XML From Premier ReCaptured in FCP

    So my situation is that I have old Adobe Premier projects that I would like to have editing access to for future re-edits when I transition into Final Cut. The source videos are in MPEG-2. When I tried exporting the XML file and exporting the source

  • Re: Transactions & DB

    Thomas Mercer Hursh, Ph.D. wrote: > If so, is this risk confined to failure during the end transaction processing? I.e., if I stick in something after the third insert which takes 10 minutes (because I like being stupid!) and the failure occurs durin

  • Please help -  How to export HTML file into MS word format

    How to export HTML file into MS word file without any change in design format? As I have been trying to do that but problem is coming in formating. Table's witdth and height get disturbed in MS word when I import the html file. What I do after creati