Non-Rectangular Buttons with images

is it possible to create a non-square "button" in flash cs4
programmatically using as3?
Using a xml document, i'm trying to be able to retrieve a
.png file with transparency, and have said transparent area's be
not clickable.
Long story short, I'm creating a map with a bunch of
clickable areas. These areas are non-rectangular and I need them to
not obscure other area's which would be in their rectangle. I need
this to be done programmatically since the area's are going to be
dynamic as is the data attached to them.
fyi: I have a fairly good grasp of OOP, so don't be afraid to
post up complex instructions.

Now we're cooking with gas! Thank you so much for your
assistance!
The only issue left;
is it possible for the Events to penetrate through, so that
if two elements slightly overlap, the transparent part of obj1 will
allow a onclick (and subsequently the onmouseover) event on el2,
preferably dynamically so that I don't have to add event handlers
between the two.
Is there a simple way or do i need to calculate the overlap
using the x/y coords and width/height of each element, then
manually dispatch?
here's where I'm at thus far (with this discussion)
Firstly, the class for the movie clip,
then our frame.

Similar Messages

  • [iPhone SDK] non-rectangular button with png

    Is there any way to create an image button with a png. but make it so that the transparent areas are not hittable?

    Now we're cooking with gas! Thank you so much for your
    assistance!
    The only issue left;
    is it possible for the Events to penetrate through, so that
    if two elements slightly overlap, the transparent part of obj1 will
    allow a onclick (and subsequently the onmouseover) event on el2,
    preferably dynamically so that I don't have to add event handlers
    between the two.
    Is there a simple way or do i need to calculate the overlap
    using the x/y coords and width/height of each element, then
    manually dispatch?
    here's where I'm at thus far (with this discussion)
    Firstly, the class for the movie clip,
    then our frame.

  • Printing Buttons with Images

    In my application, I am attempting to print a document that has both buttons with text and buttons with images, along with plain text.
    When I print, the buttons with the images are larger than they ought to be (i.e. they don't fit within the area they were suppose to be drawn within (btw, for this application, I am using absolute positioning)).
    However, this does NOT occur with the buttons that have only text and no image.
    Can anybody tell me why this might be? It seems that to printing a JButton comes from the functionallity of JComponent.print, which simply sets a few printing flags and calls JComponent.paint.
    So whatever changes those flags make, I would think they ought to effect all buttons the same?
    Has anybody else run into this problem, and possibly found a solution for it?

    myJButton.setSize(new java.awt.Dimension(<width>,<height>));
    that line should do it. keep in mind that that will not resize your image. since you are using absolute positioning I will assume your button is of constant size. you should manually resize your images to be of the proper size for your buttons.

  • Radio Buttons with images

    Hello everyone,
    JDeveloper 11.1.1.7.0
    Is it possible to have radio buttons with images instead of plain text?
    If not, are you interested in having this kind of feature? I am ;-)
    Thx.
    Filip Huysmans

    Hi Flip,
    The user when switching between modes will fire an event to the server. This even needs to be caught in a bean and set a variable's value to either true or false.
    Now you can treat "TRUE" to be in view and "FALSE" to be in edit mode.
    Depending on this images can be changed.
    Ex: your bean will be like
    class catchMode{
    private boolean mode;
    public void changeMode(ActionEvent ae)
    boolean modVal=this.getMode();
    if(modVal) //if mode is true; i.e. view mode
         this.setMode(false);
    else if(!modVal) //in EDIT mode
    this.setMode(true);
    //Generate accessors for mode
    in JSPX:
    <af:image source="#{catchMod.mode eq true ? 'view.png' : 'edit.png'}"
    Also the partialSubmit for the command component will be set to true
    Thanks,
    Pandu

  • Non-rectangular or transparent images

    Hi.
    Not using Swing, can I use non-rectangular images for animation purposes ?
    Alternatively, can I use rectangular images with a "transparent" color as a background ?
    If so - How ?!
    Thanks.

    GIF98a images can have a mask (transparent) color set. Otherwise, set the 'alpha' component of pixels that use your chosen mask color.
    http://tutorials.findtutorials.com/read/id/111

  • PSD Rollover Button with image in front stops button from changing state

    I have a wide PSD button that changes state when rolled over. I would like to place a PNG image with transparency in some areas over the top of it so that the rollover button shows through the transparent areas of the PNG.
    How can you get it to do the rollover effect when the user mouses over the bit of the button that the image is in front of? Is ther a way of making the PNG 'invisible' to the mouse?
    I know I could redesign the button so that it includes the image but I'm trying to keep file sizes and load times to a minimum, I use this button a lot on my website with a different on each, and having that number of individual buttons would result in a bloated, slow-loading website.

    Hi Abhishek
    Thanks for your reply. I was able to achieve the effect I wanted by having the PNG and the PSD Button with the same link and then grouping them. This means I can mouse over the PNG and still get the PSD rollover effect, which is perfect.
    However I also have another similar problem. I have some different PSD Rollover Buttons which have some text in front of them (basically it's the button label). On some of these buttons when you roll over the text it prevents the rollover state of the button, and on other buttons the rollover effect occurs as it should, and there doesn't appear to be any consistency about which does what. Grouping or ungrouping doesn't appear to make a difference. Can you help?

  • Replace Buttons with Images.

    Folks,
    I have buttons in my application which perform a certain functions
    by clicking on them.
    I want to replace the buttons by gif/jpg images,so that when the
    user clicks on them,it does the same set of functionality as discussed
    above.
    HOW CAN I REPLACE THE BUTTONS with Gif and implement the actionListener??

    Hello,
    there are several methods to set the icon for the button like setIcon and setRolloverIcon etc. You better setContentAreaFilled(false) if you want an icon-only button. Have a look at [url http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/AbstractButton.html]AbstractButton for further information.
    Regards,
    Tim

  • Button with image in JSP

    In JSP, how could we create a button with an image on it.
    Normally in JSP we use something like :
    <input type="submit" name="ButtonName" value="Submit"> to create a button
    and we use < request.getParameter("ButtonName")> to invoke it.
    How can we create a button with an image? and how to invoke the button. Thanks.

    Not too sure how you are invoking with the request.getParameter() (I'm still fairly new to JSP), but you can certainly create a submit button with an image by using:
    <input type="image" src="buttonimage.gif" height="100" width="100" name="ButtonName" value="Submit" />(Where or course src, width and height are dependant on your image.)
    Hope that helps.

  • Buttons with images in web!!! Please help-me!!!!

    I want to publish mine forms 6i in web. They have buttons with figures. I already converted the figures of .ICO for .GIF. I already read diverse papers on the subject but I did not understand them. What I must make now?
    I need step-by-step that to make now, therefore I have stated period to carry through this task and is if depleting. Who to know, please says which archives to me must edit, where to place the figures, etc.
    Thanks!!!!!

    Joao,
    There is Registry.dat file in which there are two items:
    default.icons.iconpath=
    default.icons.iconextension=
    My Registry.dat contains this:
    default.icons.iconpath=/nis-img/
    default.icons.iconextension=gif
    The url /nis-img/ is defined in httpd.conf (I use Apache).
    kind regards,
    Ivan
    I want to publish mine forms 6i in web. They have buttons with figures. I already converted the figures of .ICO for .GIF. I already read diverse papers on the subject but I did not understand them. What I must make now?
    I need step-by-step that to make now, therefore I have stated period to carry through this task and is if depleting. Who to know, please says which archives to me must edit, where to place the figures, etc.
    Thanks!!!!!

  • Flash button with images

    hi,
    I want to create a flash button,& for the button
    different images should load for press & release events. also I
    want to reuse this button. Please can someone tell me how to do
    that

    you'll need to use server-side scripting to handle part of the file upload and the file name retrieval from the upload folder.  assigning the uploaded files names you'll do from flash.  you'll use another script to retrieve the file names and in flash load and display which ever subset you want.

  • Problems: button with image

    hallo,
    i have the following problem:
    I've written this class:
    import java.awt.*;
    public class ImageButton
    extends Button
         private Image img;
         public ImageButton(String fname)
         img = getToolkit().getImage(getClass().getResource(fname));
              MediaTracker mt = new MediaTracker(this);
              mt.addImage(img, 0);
         try {
              //Warten, bis das Image vollst�ndig geladen ist,
              //damit getWidth() und getHeight() funktionieren
              mt.waitForAll();
              } catch (InterruptedException e) {
              //nothing
         public void paint(Graphics g)
              int a=(this.getWidth()-getPreferredSize().width)/2;
              int b=(this.getHeight()-getPreferredSize().height)/2;
              g.drawImage(img,a,b,this);
              super.paint(g);
         public void update(Graphics g)
              paint(g);
         public Dimension getPreferredSize()
              return new Dimension(
              img.getWidth(this),
              img.getHeight(this)
         public Dimension getMinimumSize()
              return new Dimension(
              img.getWidth(this),
              img.getHeight(this)
    when the frame appears, where the button is shown, the icon is shown. But when I click on the button, the icon is away and i don't know, where is the problem.
    I don't use swing because i don't like the perfomance.
    why is the image away, when i'm clicking on the button or another frame is over the button and disappears.

    just do not call super.paint(g) in paint() implementation

  • Invisible submit button with image rollover

    I have a need to combine a rollover image with a form submit
    button. I need the submit button to not be visible except for those
    that know where to look.
    I have a database query that displays rows of data. Each row
    has a checkbox to select that item, so the data table is in a form;
    the checkbox is a cfinput. In order to pass the parameters of the
    checked items, a submit button must be used to submit the form
    values.
    My need is for the submit button to be the rollover image.
    Only users that know where to find the rollover image will be able
    to submit the list of checked form values. "Regular" users
    shouldn't be in that area of the screen.
    So, a combined rollover image submit button is needed.
    Ideas? Thanks...Rick...

    document.yourformname.submit didn't work.
    But then discovered that the href value needs to be empty (or
    "#") to work. This code works: (rollover images with the submit()
    code):
    <a href="#"
    onClick="javascript:submit()"
    onmouseover="MM_swapImage('Image9','','images/change-meeting-date.png',1)"
    onmouseout="MM_swapImgRestore()">
    <img src="images/blank-hidden-area.png"
    name="Image9"
    width="111"
    height="11"
    border="0"
    id="Image9" />
    </a>
    When, in DW, you add the rollover image, you need to leave
    the href value empty. I suppose that lets the submit button use the
    <cfform action...> value as the results page, letting the
    form values pass to the results page.
    Now, the next step is to have two different rollover images
    with submits() that point to two different result pages, while
    still using one cfform. (Two submits in one form, each submit
    pointing to a different results page.)
    ...Rick...

  • Non rectangular hotspots for image maps

    Hi everyone,
    I've been stuck with this problem for a while. I'm trying to make an image map of sectors in a circle. I have the four coordinates of each sector. How do I determine if the the user has clicked inside a particular sector. Most of the examples for image maps I've seen are for rectangular hotspots. Is there a PointInRegion() method or anything like that??
    Thanks a million for your help!

    Found it out myself!!
    There is a contains() method in the Polygon class that tests if a given point is contained within a polygon

  • Hotspots for non-rectangular buttons

    Does anyone know how to create a button which does not trigger on the image itself as the are always rectangular.  I am trying to create a series of nested hexagonal buttons, when nested the transparent areas of the photoshop or png file is is not visable which is what I want but it the transparent area does trigger the rollover/trigger event.
    I would like to know if you can create a hotspot for a button which is not reliant upon the image file but another shape similar to hotspots in Dreamweaver or is there a work round using other Muse CC features?

    Brad, Thanks for the reply, I assumed that Muse would not allow this as they have simply ignored some basic requirements such as tables, hotspots, dropdown/radio buttons in forms etc. and have concentrated on gimicks like paralax scrolling, dont get me wrong it looks good but they should have got the foundations build first.
    I do appeciate your response however its not really the answer, although I could go out and use Dreamweaver or even write the HTML myself (at a push) the point of Muse according to Adobe is that you dont need to 'write a single line of code'.  From experience this is not true and Muse as a base application is limited creatively.

  • WPF Buttons with Images

    I have the following button design that I'm aiming for:
    http://i.imgur.com/nCymK5L.jpg
    Could someone advise how I'd add an image to the left side of the button?
    Also, if anyone could advise if I can add the thin black border easily?
    My current markup:
    <Button Click="Example_Click" Margin="112,162,214,40">
    <Button.Template>
    <ControlTemplate TargetType="Button">
    <Border Background="#FFF" BorderThickness="4" CornerRadius="20" Width="125" Height="46">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="BorderBrush" Value="#CED58F"/>
    </Trigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <TextBlock Margin="30,6,0,0" FontSize="18" FontWeight="Bold" Foreground="#9EB11C">BUTTON</TextBlock>
    </Border>
    </ControlTemplate>
    </Button.Template>
    </Button>
    Thanks

    >>Could someone advise how I'd add an image to the left side of the button?
    You could just put a Grid with two columns inside the Border element and then put the image in the leftmost column of the Grid:
    <Button Click="Example_Click" Margin="112,162,214,40">
    <Button.Template>
    <ControlTemplate TargetType="Button">
    <Border Background="#FFF" BorderThickness="4" CornerRadius="20" Width="125" Height="46">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="BorderBrush" Value="#CED58F"/>
    </Trigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Image Width="25" Height="25" Grid.Column="0" Source="pic.png" Stretch="Fill" Margin="5 0 0 0"/>
    <TextBlock VerticalAlignment="Center" Margin="3 0 0 0" Grid.Column="1" FontSize="18" FontWeight="Bold" Foreground="#9EB11C">BUTTON</TextBlock>
    </Grid>
    </Border>
    </ControlTemplate>
    </Button.Template>
    </Button>
    >>Also, if anyone could advise if I can add the thin black border easily?
    You could add another inner Border inside the outer one. Something like this:
    <Button Click="Example_Click" Margin="112,162,214,40">
    <Button.Template>
    <ControlTemplate TargetType="Button">
    <Border x:Name="outerBorder" Background="#FFF" BorderThickness="4" CornerRadius="20" Width="125" Height="46">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <Trigger Property="IsMouseOver" Value="True">
    <Setter Property="BorderBrush" Value="#CED58F"/>
    </Trigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <Border BorderThickness="1" CornerRadius="20">
    <Border.Style>
    <Style TargetType="{x:Type Border}">
    <Style.Triggers>
    <DataTrigger Binding="{Binding Path=IsMouseOver, ElementName=outerBorder}" Value="True">
    <Setter Property="BorderBrush" Value="Gray"/>
    </DataTrigger>
    </Style.Triggers>
    </Style>
    </Border.Style>
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Image Width="25" Height="25" Grid.Column="0" Source="pic.png" Stretch="Fill" Margin="5 0 0 0"/>
    <TextBlock VerticalAlignment="Center" Margin="3 0 0 0" Grid.Column="1" FontSize="18" FontWeight="Bold" Foreground="#9EB11C">BUTTON</TextBlock>
    </Grid>
    </Border>
    </Border>
    </ControlTemplate>
    </Button.Template>
    </Button>
    Hope that helps. It should at least get you the idea :)
    Please remember to mark helpful posts as answer and/or helpful.

Maybe you are looking for