Design

New Flash Horizontal Menu

Tuesday, March 23rd, 2010


I have another file for sale on ActiveDen and it’s called Flash Horizontal Menu. This flash horizontal menu is great for any site or flash project. It is written in AS3 (Actionscript 3.0) and can be used as the navigation on any website and is super easy to use and setup. This menu supports loading swfs, going to frame labels, frame numbers, external links, and calling functions. If you want to use it in your flash file just drag and drop it. If you don’t know Flash and you are linking to several web pages, use the provided swf and XML file and you don’t even have to open up Flash. Some of the special features are that its customizable by XML, you can easily change the width and height, and a special javascript function handles the resizing in the browser. There is no need to even open the flash file, unless you want to use it in another Flash project then its just drag and drop, easily change the initial font color and the hover font color, easily change the font size and font type, easily change the space between items and navigation padding on the left to easily center it, it handles most html tags for even more customization, and you can add as many items to the menu as you want.Click the image above to view the flash in action.

Cya

HRA105.com Website

Wednesday, March 17th, 2010

I have finished working on another site for work, called HRA105.com. It’s a informational and marketing website for HRAs (Health Reimbursement Arrangements).  The pictures on the left are the redesign and updated site, and the pictures on the right is what it use to look like. As you can see I did a lot of updates to the site. First off, I created all the banner images and made a simple jQuery Rotating banner with a simple fading transition with the jQuery Cycle Plugin. This is a really nice feature because it will show up in all browsers including iPhones. Secondly,  I used Stu Nicholls’ great horizontal navigation called Professional Dropdown #2. I would of created my own navigational menu but it just saves so much time using other’s free stuff and this is just a really  nice and simple menu to use and setup. The problem with the original site was that the navigation was non-existent. You had to click on the flash portion at the top and then click “click here to read more” and then the subpages had tons of white space between paragraphs that made no since and it was hard to find what you wanted. The most important part of any website is that its easy to get around and find what you want, if the user can’t use your site they will leave it in a matter of seconds. Also, I made all the subpages consistent and made the site a standard 1024px by 768px instead of a stretch to fit liquid layout so it looks the same on all computers. Its cross browser compatible as well and I performed my SEO checklist on the site as well.

Cya

Detect Iphone

Thursday, March 11th, 2010


I got inspired and wanted to finish up the iphone version of my website. To do this, first you need to detect the iphone and then redirect the user to another webpage. Here is the script to do that:

1
2
3
4
5
<script type="text/javascript">// <![CDATA[
	if ((navigator.userAgent.indexOf('/iPhone/i') != -1) || (navigator.userAgent.indexOf('/iPod/i') != -1)) {
		document.location = "http://www.scottrockers.com/iphone.html";
	}
// ]]></script>

Add this Javascript inside your <head> tags. and change the document.location to the page you want the user to get redirected to. The reason I have a iPhone version of my website is because my home page is made in Flash and as you know the iPhone can’t display Flash yet. So I created a basic html page that has a div in the body of it that is sized to 300 width by 350 height. And if you put this line of script in the <head> section it will tell Safari that the viewport should be the same size as the iPhone screen. Setting this line of code forces the content to always fit the window.

1
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;">

Now, if someone wants to bookmark your website, they can hit the + sign and then click “Add to Home Screen” and you want to specify what icon to use for the iPhone, then create a 57px by 57px .png formatted image, put it up on your server and put this line of code in to your <head> section as well.

1
<link rel="apple-touch-icon" href="http://www.scottrockers.com/library/images/sriphonelogo.png"/>


Just make sure the href tag is the correct destination to your image. What is cool is that you don’t have to add the corners or shine effect on the webclip because the iPhone will do that for you.

If you want to see all the actual html code, you can just go to scottrockers.com iPhone Version and click view source.

Cya

Free Web Icons Download (wotw)

Monday, March 8th, 2010

Website of the Week (wotw) is a new series I am doing on my blog, featuring one website per week or as often as I find a good one. I was basically doing this before when I would talk about other really useful websites that I use all the time or ones I come across while surfing on the net. Now this will by no means be anything close to thefwa.com in terms of awesomeness but it might be useful to anyway out there who is a surfing trying to find some good stuff.

This first entry in the Website of the week is Free Icons: More than 100,000 Icons in One Place. Its a really great site for all things icons, and if you still can’t find an icon that you need you will surely find something that could help you at least get started. Be careful though, you can spend hours looking at all the different  icons without even realizing the time flying by.

Cya

Workaround Solution to Flash Error #2044, Unhandled SecurityError, and Error #2048, Security Sandbox Violation

Friday, February 26th, 2010

I sell Flash components on ActiveDen, and while working with a client on my Flash News Ticker we ran into the infamous “Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation” when trying to gather information from an external RSS Feed.

This error occurs when your flash file is trying to get data from a different domain and it can’t because of security reasons on their server. The usual fix for this is to create a crossdomain.xml file that allows access from other websites to use the data on yours, but the problem with that is if you don’t host that site you want the data from then how could you create or update the crossdomain.xml file on their server.

I did find a work around for it though! Not sure if its “the right way to do it” but it does work.

Here is the solution, I copy that url of the feed I want the data from, go to my feedburner account and create a feedburner feed of the same feed. If you don’t know what feedburner is then you should definatly check it out. You basically can sign up for feedburner if you have a google account already. Anyway, after you get the feedburner feed of the data you want you can view it. Then if you want to see the xml version of the Feedburner Feed, you can just add  “?format=xml” onto the end of the url they give you, and this is the normal RSS 2.0 feed that we are wanting.

This is the data you want, because its not on the security problematic website. The next thing I ran into was getting the images to display in the news ticker as well. I kept getting the same error but if I dismissed the errors then they still worked. So I used a try-catch clause to get the error and throw it if it gets one. Here is an example of that code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
function imageLoaded(e:Event):void {
	try {
                //make the image into a bitmap and smooth it
		var image:Bitmap = e.target.content as Bitmap;
		image.smoothing = true;
 
		//resizes the image
		e.target.content.width = 55;
		e.target.content.height = 35;
 
	} catch(error:Error) {
		trace("Error catch: " + error);
	}
}

This is called from an event listener when loading it in using a loader object, that looks like this:

imageLoader.contentLoaderInfo.addEventListener(Event.INIT, imageLoaded);

So basically it worked after this, and the images even showed up without showing the error. The only problem is that the images don’t get resized because they can’t be loaded into the swf memory. Here are the examples: the one on the left is the broken example, it can’t get the information it wants to so it just keeps trying to load it. The example on the right shows the fix. (You have to view them in IE so the error warnings appear, another thing to hate about IE. :/ )

Any thoughts or comments are encouraged,
Cya