Posts

Showing posts with the label button

Spark image button

So skinning spark buttons with images isn't the same as skinning halo (mx) buttons with images. It's a 3 part process. components.ImageButton.as package components { import spark.components.Button; [Style(name="imageSkin",type="*")] [Style(name="imageSkinDisabled",type="*")] [Style(name="imageSkinDown",type="*")] [Style(name="imageSkinOver",type="*")] public class ImageButton extends Button { public function ImageButton() { super(); } } } Script block [Embed('assets/images/btnGoUp.png')] [Bindable] public var btnGo:Class; [Embed('assets/images/btnGoOver.png')] [Bindable] public var btnGoOver:Class; [Embed('assets/images/btnGoDisabled.png')] [Bindable] public var btnGoDisabled:Class; MXML block <components:ImageButton buttonMode="true" imageSkin="{btnGo}" imageSkinDisabled="{btnGoDisabled}" imageSkinDown="{btnG...

Flex Legend Button: Solved!

Thanks to Marcus and his amazing code I can share with you a soultion for my legend button problem . This is more than I asked for. Make sure if you use this, you credit and thank Marcus for his amazing work! Sample with view source enabled

Extending Flex buttons... can you help me?

Image
**Edit - this has been solved thanks to the help of Marcus : view the entry here ** I never claimed to be a Flex expert... and this only proves why. Back story: I am trying to extend a Flex button to be something I'm calling a legend button. Essentially it is a button that also doubles as a legend. When the toggle is on that line is on the chart, when the toggle is off that line is removed from the chart. The button 'color' and the line color have to match. What I am currently trying to do: I am trying to extend the button component and add a Box (10pxx10px). What is happening however, is the box is showing up underneath the button itself, so when the button alpha is 100% (i.e. when toggle is on) you can't see the box. Here's the code: package com.view { import flash.display.DisplayObject; import flash.events.MouseEvent; import flash.text.TextLineMetrics; import mx.containers.Box; import mx.controls.Button; import mx.core.UITextField; public class LegendBut...

Flex Super Tab Navigator

So I have this dashboard project I'm working on. What I am trying to do is have a TabNavigator that is about half the screen, but give it a maximize button, so that if clicked it fills the whole screen. Sounds easy enough, I've done it with a Panel, but unfortunately it seemed a little too tricky for me and my high design : moderate coding skills. So to Google I went. You know what annoys me? People who blog about this kind of thing, show the awesome component they created, and don't share even a bit of code. That's what I found. Ugh. I did however discover that flexLib has something called a SuperTabNavigator. The SuperTabNavigator has a close button on each tab, so I figured, maybe I can extend this, better than starting from scratch. It wasn't even as difficult as extending it. It is actually pretty easy to customize. Yay for flexLib. Here are some actual CODE EXAMPLES of what I did. First you need the flexLib library. http://code.google.com/p/flexlib/downloads/...