http://blog.comtaste.com/2007/06/form_fields_focus_and_keyboard.html
This post is an example of how to create custom style metadata and pass different values into your degrafa skin dynamically.
I would like to give a shout out to John Yanarella, he and I have been working on a project, and he wrote the skin, and then I adapted it to be able to pass custom styles in via a stylesheet.
So the reason I wanted to cover this is because I find myself creating degrafa skins, and then creating them over and over and over to change things just SLIGHTLY, like corner radius, or a stroke here, or a border there, or different highlight colors, but in general the style is the same… and before I know it, I end up with 3 different variations of classes that are relatively simple…
Like flex by default, I would like to pass in styles via mxml or a stylesheet and have it pass through to the degrafa skin… Thats what this post shows you how to do…
lets say you create a style called “customFillColors”
assets/style/styles.css
.myStyledButton
{
customFillColors: #FFFFFF,#0000FF;
}
and you want that to flow into your skin, what you can do is, in your Degrafa skin you have to override updateDisplayList, and get the style in actionscript, and then change the colors accordingly from the style.
override protected function updateDisplayList( unscaledWidth:Number, unscaledHeight:Number ):void
{
super.updateDisplayList( unscaledWidth, unscaledHeight );
var fillColors:Array = getStyle( "customFillColors" );
if ( ( fillColors != null ) && ( fillColors.length == 2 ) )
{
topFillColor = fillColors[ 0 ];
bottomFillColor = fillColors[ 1 ];
}
}
Here is the application, and you can right click to view source
This post is to show how to use custom degrafa states in non button classes… say you want up, down, over states in a class… a button already does that for you, so in degrafa you just use the GraphicBorderSkin and create different states within it… very simple… and a lot of examples out there of how to do… here are a couple of links to some blog posts that show how to do this.
Vixiom Post (actionscript example)
What this post will show you how to do is, get those states in non button classes, like a canvas… say you want a canvas to have different states when you rollover and such… maybe you want to use it as a renderer…
I’m going to give credit where credit is due… all this codes is credited to my friend and co worker John Yanarella, he doesnt have a blog yet, and he just did this awesome stuff, and I wanted to be able to remember it… so I’m blogging on it… I fully asked his permission, and made sure he’s getting the credit… I didnt want to put the time into fixing the issue… so my round about solution was to put the degrafa right into the renderer instead of making it extend GraphicBorderSkin… his solution is far cleaner, and much more elegant than mine…
The key thing to look at is in the BoxItemRenderer, or CanvasItemRenderer, in updateDisplayList is setting the currentState to whatever it needs to be…
here is the code, and example
I tried to find all sorts of google searches on the headerRenderer for the Datagrid, and couldn’t find anything… so here is my two cents.
I was tasked with a simple datagrid header, one that didn’t have the default skin, but just had some link button type look to the headers…
You have to use the headerRenderer attribute of the DataGridColumn, and you can’t pass a button into it, that causes a run time error, so you have to hand it a container.
The next trick is to override set date(value:Object):void in the renderer, and invalidateProperties(), when you do that, the component will call commitProperties() and there you can access your button, wthout it being null.
Please check out the app to see the reference.
I have a project that needs 20 hours a week for the next 4 – 6 weeks.
I need someone advanced, and that lives in the US, and speaks fluent
english. its all remote, and all sub contracting… I need someone
that can possibly work the weekends… (possibly, it all depends on if you can work during the work week or not… )
have a tight deadline by the 15th of Jan. then a release in the beginning of feb.
email me at jensen (dot) axel (at) yahoo.com
The lockedColumnCount in the datagrid is a tricky little flag you have to remember to do a couple things especially if you are using it inside a container:
This post is a quick example of how to show circular progress for something… This is my first venture with Degrafa and I would have to say after the first couple of hours or so it came to me fairly quickly, I’m pretty pleased with the support out there on it, and the examples are all great.
This post posts a snippet of code of how to loop through an objects properties in order to get the key names.
About six months ago we had some convoluted way of doing something on the backend (PHP), and in order to get something back I was give an single object with a ton of properties and I had to loop over them. For the life of me I couldn’t find any snippets of code that let me loop through an objects properties and get the actual key names… its very simple to loop through an object and get the values, thats cake…. but I was like… hmmm how do I get the key names?
So I came across Dictionary, which I always thought was just an expansion of Object, and I could never really figure out what it did that object didn’t except for the fact that as3coreLib has a Dictionary Utility class that makes it so you can loop over an object and get the keys, and its a light weight .swc file, so I used it up, and started using dictionaries for that reason, and haven’t used Generic Objects ever since, because I figured they did the same thing except Dictionary classes gave me the ability to loop through them and get the keys….
The other day I ran across some code, and thought to myself, so I use a DictionaryUtility class, why didn’t I ever think to even look through the ObjectUtil class in as3… so anyway…. there is a function in that class called getClassInfo, that will give you an array of the properties back… I felt pretty stupid after that, but needless to say I found another way to make my life easier coding….
here is a really small snippet.
var classInfoProperties:Array = ObjectUtil.getClassInfo(a[0]).properties as Array;
To the indian recruiters, I can’t understand you when you callll!!!!!!!!!! jeez!! some of the strongest accents I’ve ever heard! my god!
This flex project will talk to salesforce, grab data, be able to save multiple records at the same time, edit and save single records at the same time, and will demonstrate some simple flex charting and data binding.
This blog post got moved to adobe!!! boo yah!!
John wrote up, and used screen shots, and outlined the application better than I did, but I built it, but he’s the one with the contacts at adobe that wanted the example apps of sfdc… glad I could be a part of it.
To view my running application click here to view the source click here
(it takes a minute to load)
This post is directed at people that know the salesforce.com platform, I’m not trying to get away from flex, but this post was actually part of my last assignment at work, and its directed at salesforce developers that don’t know flex.
This blog post has been moved to ADOBE! boo yah!
John’s the one who wrote the documentation and took the screen shots and got the deal with adobe to get the project and example put on adobe.com, so they wanted him to be the author.
but here is the video
To view my running application click here to view the source click here
(it takes a minute to load)
We have a product right now that has a basic shopping cart in it… and one of the options is to save the cart and view it as a pdf… so we send the request to the server, and return a link back with a link to the pdf, and
because we may have many messages come back from this one service we just use a simple alert box to show the user the feedback and that the application has saved successfully… if we need to put a link in there, the user must copy and paste the link in order to use it… WELLL, the small challenge was to make that a clickable link, and in the least amount of time possible… (15 minutes, rather than 2 hours for styling and the component itself) (it actually took longer to write the blog post, and put up the example than it did to fix the issue)
I was asked to create a component that allows for htmlText to be added to it, and the component has to have all the functionality of an Alert box… so why not extend the alert box, and make something like a BaseAlert.as file that extends Alert…
because you still have to use Alert.show in your application to use it… so rather than going to all the work of creating a way to popup the popup from anywhere in the app, and making sure it dispatches CloseEvents like the original Alert box does, I did some digging and found a forum list that gave the greatest tip EVER! I never really use mx_internal… frankly it confuses me a little bit… the syntax is a little wonkey to me… I’ve never used the whole “::” thing and don’t really understand what it does… someone care to explain?
anyway, I thought this persons simple code was absolutely great!
var a:Alert=Alert.show("dump text");
a.mx_internal::alertForm.mx_internal::textField.htmlText =
some HTMl text goes here;
here is a link to the message post
They do neglect to mention that you have to import the internal namespace though, so in my example thats included. This is a very quick and cheap solution to the problem and just provides a way to fancy up the alert box a little bit by adding the “limited” html text that the flash platform supports… maybe flash 10 will add better htmlText support…. I would assume so with all of the text changes to the platform… but I havent looked into it so don’t quote me…
When you have a project that requires a dynamic interface, and you are adding and removing tabs, lets say you need to reset the selectedIndex of the TabNavigator back to 0, because you may be adding tabs that are not relevant to what you originally had on the screen… when you simply do a “tabNav.removeAllChildren()” on the TabNavigator, and change the selectedIndex in the same function, it just simply doesnt work… there is a bug for it… http://bugs.adobe.com/jira/browse/SDK-14157
So the more elegant solution that also pays attention to the flex framework is by using commitProperties() when you use commitProperties it guarantees that things will be done after the initialization is done in the component, it also is guarantees things will only run once per frame I believe… (don’t quote me on that, i’m just to lazy to look up where I read that, because I’ve got to get back to work)
anyway… when you use invalidateProperties() when you want to remove the children, you would simply set the selectedIndex before you invalidate, and then do the work in commitProperties… and it should just work because of the way commitProperties is supposed to work…
when in reality, it doesnt work either…
so what you end up having to do is use callLater( commitProperties )
private var _tabNavChanged:Boolean = false;
public function resetTabNav():void
{
tabNav.selectedIndex = 0;
_tabNavChanged = true;
callLater( commitProperties )
}
override protected function commitProperties():void
{
super.commitProperties():
if( _tabNavChanged )
{
//do your looping and stuff here to create your dynamic tabs...
_tabNavChanged = false;
}
}//end function
Hope this helps someone… didn’t really take long
i suppose I’m just used to using commitProperties
When you use an itemRenderer in your TileList, as well with any of the listBase components, it reuses renderers, there are tons and tons of posts a lot from a colleague Ben Clinkenbeard on renderer issues with data, and one of the things I do normally is override the data setter in the renderer, and bind to a value object…
The problem I recently came across using the TileList, was that we were using the TileList to display a list of products, and there could be a lot… hundrends… when you use the TileList, and you scroll, it reuses the renderer for efficiency…
I currently have a small side project with SocialSecurityValidator, and we are stripping all of the dashes out of the format, and when we passed in just a number to the validator, it screamed bloody murder, because it couldnt use a string function charAt().
so I simply passed the number in with a .toString()
as
//mySSN is a number
ssnV.validate(mySSN.toString() );
mxml:
<mx:SocialSecurityValidator
id = "ssnV"
/>
The easiest way I’ve came across to enforce uppercase is to use the restrict tag…
<mx:TextInput restrict="[A-Z]" />
simple stuff.
I am officially open for consulting, to anyone that reads this, I offer great services, and cheap rates…. please contact me via reply or jensen.axel@yahoo.com
I installed service capture 2 today, and it made my google chrome not work, and Internet Explorer 7 as well…
I thought my internet was down, just by chance, so I reset my router, that didn’t do the trick so I restarted the computer… and figured something was just messed up… I didn’t put 2 and 2 together to realize that it was WHEN I INSTALLED the software is when things stopped working…
After realizing that I uninstalled the software because I figured that may fix it, and that didn’t help either… at the same time I’m battling my laptop with no internet, I am battling not being able to print on another computer… I have no clue why… so I’m working through that… at the same time, the thing I need to print is an upgrade form from etrade which I need to fax in to try to get them to upgrade my account because they won’t let you apply for upgrades more than once in 90 days… so I had to call them, and get that worked out and plead my case for the upgrade… Then I needed to go online to get to salliemae to see how much left is on my school loans, and I couldn’t log into that, and after 3 times of trying to remember my username and password, they locked my account… so because I couldn’t get it unlocked without calling them, I called, and waited 15 minutes on hold, and had an Indian guy who was very scripted tell me my account was locked and that he could reset it to a one time password… I told him the reason I can’t remember my password is because they are so strict on their password rules…
I know that its for my own good, and my account protection, but I only have 3 or 4 passwords that I use that meet certain criteria for a good password… I think 3 or 4 is pretty good… so when a place locks me out for trying the different passwords after 3 times… it pisses me off! especially since I have to call them and wait on hold, then talk to a foreigner that is probably out sourced, that talks like a fucking robot because of the script he has to stay verbatim to…
Seriously SallieMae blows ass when it comes to support as well as password rules to log in, again, I realize that they are just trying to protect me, but when you can’t remember your password, you go to their forgot password, then they email you a link to change the password, and then when you try to change it, it tells you YOU CAN’T CHANGE IT TO ANY OF THE PAST FIVE PASSWORDS YOU’VE USED PREVIOUSLY!!!!! so then you have to make a new one up, that you happen to forget by the time you log in again, and have to go through the whole friggin process again!!!! seriously they should shoot themselves in the head for the head aches they cause…
So what do I do… I put the password on a sticky not and put it on my monitor (which from being an IT guy you hear about all the time) and that just kinda blows their security out of the water… they really piss me off… now they wont consolidate loans either which just adds to the crap load of stuff that is sort of piling on…
At least when I called etrade I only had to push 1 button to talk to someone instaed of 15… (“use your touch tone phone to put in your account number, if you do not know your account number press 1, use your phone to type in your social security number, then your phone number, then your username, then your password… if you are calling for technical support press 1, if your calling for a new account press two… to hear this menu again press #, or *, or to hang on the line press 0….) I’M SO SICK OF PHONE MENU’S THAT ARE ABSOLUTELY HORRIBLE, then after you put in all the information, they have to verify that you are you, and you have to pass a little quiz when you actually get someone on the phone… AGAIN, I UNDERSTAND ITS ALL FOR MY OWN GOOD, but I just want to be able to work, and get info when I need it, I want to be able to call my ISP and get support without dailing 15 numbers to talk to someone, then have them tell me they didnt recognize my number because of the way cell phone towers transmits numbers depending off what tower they bounce off ( I heard that somewhere… dunno if its true… but for one company I call it never recognizes my phone number, and then i have to enter it twice, then i get on the phone and they ask me it again… )
so anyway… service capture… lol
I think service capture turns on a proxy setting in IE and you have to shut it off… either that or I already had it on from some other project or environment setting… but because when i installed service capture it made stuff not work, I’m lead to believe it may have been that….
so go to tools > Internet Options > Connects Tab > in the bottom click on LAN Settings > UNCHECK ‘use a proxy server for your LAN…’
http://www.kevinlangdon.com/serviceCapture/images/ie_settings.jpg
sorry for the bitching… but it makes me feel better…
This post is a video on Cairngorm with UM Extensions and cairngenum. It explains some of the subtle differences between cairngorm, and cairngormUM, and what the extensions allow you to do that cairngorm doesnt allow very easily. The Video is listed at the bottom of the post
This post is a video on Cairngorm with UM Extensions and cairngenum. It explains some of the subtle differences between cairngorm, and cairngormUM, and what the extensions allow you to do that cairngorm doesnt allow very easily. The Video is listed at the bottom of the post
<root>
<users>
<user name="Axel"></user>
<user name="Ben"></user>
<user name="Ryan"></user>
<user name="Tom"></user>
<user name="David"></user>
</users>
</root>
This post has a video that explains how to you use ANT to email your source code and or swf (or .air) file to the client (if you need to). It even involves how to zip the project up using ANT as well.
To use email with ant you need the following 3 jar files installed.
After you download the files you need to put them into your ant directory under your eclipse install “/plugins/org.apache.ant_******/ folder. If you watch the video, I explain how to find the ant folder if you don’t know where it is. For me it is “C:\Program Files\Adobe\Flex Builder 3\plugins\org.apache.ant_1.7.0.v200706080842\lib”. That is where all the ant jar files are held. You need to put the jar’s you downloaded into that folder, and then in eclipse you need to do the following.
Now we are finally ready to get into the ANT part…
Continue reading this post…
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Feb | ||||||
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |