From inspiration to realization
28Jul/100

gitignore template for flex projects

Hi All,

Well, me being an enthusiastic flex developer is no secret, nor me being a GIT fan-boy.

I thought it will be helpful to post my template for the gitignore files in all repositories containing flex projects

this is how it looks like

.DS_Store
.actionScriptProperties
.flexProperties
.project
.settings/*
bin-debug/*

The reason I'm ignoring all the settings files and the properties files is because all of these are environment specific, often not all developers on the team use the same settings and properties and that can break the entire working process.

  • Share/Bookmark
Tagged as: , No Comments
26Jul/100

jQuery colorbox plugin no opacity (overlay) – IE7

today, while checking a website I did heavy client side work on, converting PSD's to html, CSS and JavaScript I checked everything on IE7, one of the most annoying things I encountered was that the colorbox overlay color was pitch black.

On other browsers, everything seemed fine and the overlay was in the correct opacity.

This bug is very easy to fix.

this was my code before:

	$('.guestboox_more').colorbox({
		inline:true,
		href:'.guestbook_more_details',
		innerWidth:'610px',
		opacity: '.2',
		transition: 'elastic'
	});

And this is the code after (this fixed the problem)

	$('.guestboox_more').colorbox({
		inline:true,
		href:'.guestbook_more_details',
		innerWidth:'610px',
		opacity: '0.2',
		transition: 'elastic'
	});

The problem was only that IE7 didn't recognizance .2 as 0.2 and needed to be more specific (as often IE needs).
I hope this will save you some time.

  • Share/Bookmark
25Jul/100

flash media server security hardening

today, while browsing my feed in google reader, I found something very interesting.
this link is a hardening guide for flash media server.

for quite some time now I have been developing and consulting on flash media server advanced topics, I have been teaching students and consulting companies on issues regarding this great peace of software.

Adobe seemed vert silent about this product for some time, not publishing any new materials what so ever, so it was very nice to see this link, I read it and it has some good observations and very well written instructions on how to harden your server.

  • Share/Bookmark
14Jul/101

set button width to text width in flex

Well, I have been working on a very interesting project recently, really stretching flex to the limits :-)
I needed to set buttons, linkButtons, Labels and more component's width to the width of the text inside them.
Usually, flex does it for you but the width was hardcoded in compile time and I needed to change the text and the width in runtime and resize the component according to that.

I have written a nifty helper function for that.

here it is:

/**
* This function will accept the text and the UI component and set the width to the width of the text
* @param text the text or label of the component
* @param container the container casted to a UIComponent
*
*/
public static function measureTextWidthAndResizeComponent(text:String, container:UIComponent):void
{
	var _measuredWidth:Number = 0;
	var  _paddingLeft:uint = 0;
	var _paddingRight:uint = 0;
	var _horizontalGap:uint = 0;
	var _addedToWidth:int;

	if(text == null)
		return;

	if(text.length <= 1)
		return;

	_paddingLeft = container.getStyle("paddingLeft");
	_paddingRight = container.getStyle("paddingRight");
	_horizontalGap = container.getStyle("horizontalGap");

	_addedToWidth = int(_horizontalGap + _paddingLeft + _paddingRight);

	var lineMetrics:TextLineMetrics = container.measureText(text);

	_measuredWidth = (lineMetrics.width + _addedToWidth);
	container.width = _measuredWidth;
}

That's it, enjoy!

  • Share/Bookmark
12Jul/100

jQuery, wait for animation to end then do something

I have been using jQuery for quite some time now, following a question on one of the many forums and discussions group I visit daily I found that not many know that jQuery has a built in way to "listen" for an animation to end and then continue work.

For instance if I am using the slideDown effect, I can create a function that will only execute when the slide is finished.

how?

like this...

		$('div.menuOurHotel').slideDown("slow", function()
		{
			$("div.order_form").hide();
		});

This is a very useful way to create a responsive intuitive user interface.

Good luck

  • Share/Bookmark