Our Blog

Jeremy Saenz

Jeremy Saenz

9 Comments

  1. Juan Sanchez
    Awesome! I was just about to post a screencast and you beat me to it :-)

    A few things I'd like to mention:

    You don't need the awidth/aheight stuff. Beta 3 brings percent layout and constraints, so you can do width="100%", top="0", bottom="10", etc. Or, if you still wanna use the awidth/aheight implementation, we've baked it in, so you can do width="{skinWidth}" or height="{skinHeight}". Also, you don't need to worry about overriding updateDisplayList.

    Also, they way you work with skin states is new. You can actually implement states just like you can with Flex View States and just override properties, add children etc. using AddChild, RemoveChild, SetProperty, etc. like:

    <states>
    <State name="overSkin">
    <SetProperty target="{color1}" name="alpha" value="1"/>
    </State>
    <State name="downSkin" basedOn="overSkin">
    <SetProperty target="{theFill}" name="angle" value="90"/>
    </State>
    </states>


    You might want to play with some other stuff like filters (which you used in your screencast), transforms, repeaters, decorators, masking, clipping, palette, etc.

    Here's a sample I through together that implements some of this stuff and RasterText/RasterImage: http://www.degrafa.org/source/LayerTextSkin/ButtonLayerText.html

    Nice work!
  2. Jeremy Saenz

    Jeremy Saenz

    Thanks Juan... I didn't even think to check out the beta 3 stuff, It looks like you guys have added some really cool things! I played with rastertext earlier today... It's pretty slick. Looks like I will have to do a couple Beta 3 based screencasts pretty soon!
  3. Steve Good
    Hey Jeremy, great series! What software did you use to get the split screen with your webcam and screen cast?
  4. Scott
    Hi

    Great tutorials, they have been very useful when I have been learning Degrafa.

    However I have a question about states and filters, do you know how you can have different filters set-up for each of the states? I am trying to have only one skin for all states of a button but have come across a problem doing this if using filters.

    I have tried using the newer Flex State View override properties (as mentioned in the comments above) , but this does not appear to work with filters.

    Then I tried adding the states to the GeometryComposition and then including the different filters within each geometry object; but this actually adds to the hit location area. In other words, add a drop shadow to a button geometry the shadow becomes part of the button (extending the hit location) and is clickable.

    After much experimenting I had to fall back to creating three skins, up-over-down, so I could have different filters for each state. Am I just missing something obvious here?

    On a secondary note if in the latest version of Degrafa you can do away with having to use updateDisplayList and simply use {skinWidth} and {skinHeight} instead; if I still wanted to use properties from the CSS within the skin file do I still need to include the getStyle function within a updateDisplayList function or is there another way to do this?

    Thanks for any help?
  5. Jeremy Saenz

    Jeremy Saenz

    @Scott
    Thanks for your questions. Yes, there is a way to add a filter per button state, and it involves using actionscript in the updateDisplayList function. You want to first create an instance of the filter object in your button skin... But be sure not to add it to the filters just yet:
    <mx:GlowFilter
    id="glowFilter"
    color="#FFFFFF"
    alpha="0.5"
    blurX="10"
    blurY="10"/>


    Next thing you want to do is put this snippet in the updateDiplayList method:
    if(this.name == "overSkin")
    {
    var myFilters:Array = new Array;
    myFilters.push(glowFilter);
    this.filters = myFilters;
    }

    For the next question... Yes. For now, you will have to use actionscript for the styles... I always like having a good mix of actionscript and mxml... Degrafa is still in Beta, and I am sure they are working out many of the things you are mentioning... Hope this helps!
  6. Scott
    Cheers Jeremy,

    That has been a great help, makes more sense now.
  7. Juan Rubio

    Juan Rubio

    Although I think it is a great addition to Flex, I think that to create that simple skin is way too complicated. Does it really pay to spend so much time doing all of that just to add a pink color to button? There's got to be a better way!
  8. Jeremy Saenz

    Jeremy Saenz

    @Juan R

    Yes, you are correct in saying that if you want to add a pink color to a Button in Flex, you can just use styles with the default Halo theme that Adobe has provided... But as I show in the next video's, the worth of programmatically creating a skin starts to show benefit when implementing styles. This allows for a more flexible skin where you never have to go back to the skin code to mold it, change it, and make it your own.

    Hope that helps,
    Jeremy