How to un-corrupt a corrupted Flash CS5.5 file.


My Flash file is corrupted, what do I do?

If you used Flash CS5.5 to make a video, game, or app and it is now inaccessible due to corruption then this tutorial is for you. Flash CS5.5 is quite unstable especially with saving. I have lost two of my animations because of Flash but now I have recovered them. It was easy for me and it should be easy for you too. Note: This only works for files made in Flash CS5.5 and this may or may not work. It worked for me but may not work for you.

How do I recover my Flash file?

It’s really easy but before we can get started, you need to have the following:

  • Flash CS5.5
  • A flash file that is corrupted
  • A computer with administrative abilities.

Once you have that, continue with the tutorial.

First, go to the flash update page and download the update for Flash CS5.5. Next, download the .zip file and extract it. Once you have extracted the file, go to the location where you have extracted it, run setup.exe and follow the onscreen instructions. Once the update is complete, open Flash CS5.5 and try to open the file that was “corrupted” and it should now open. All you have to do now is continue where you left off and that’s it. In the output panel, it might say the document is damaged. If it says that, examine the file to make sure everything is there.

You could use the Adobe application manager to update flash instead of the above. It’s probably faster.

What you should do after you recovered your Flash file:

Making a backup is a good idea.

If you have an older version of Flash like Flash CS5, save it as a CS5 file and work on it from there.

Before you assume your file is fully recovered, check your file for any damaged or missing art, symbols, audio, scenes, frames and bitmaps especially if the output panel says “Could not load scene into memory. Your document may be damaged.”

That is all you need to do to recover your Flash file. I hope this helps you recover your lost flash files.

Posted in Adobe, Flash, Tutorials | Tagged | 2 Comments

Sonic Generations comes out today!


Sonic Generations is out today! Buy me a copy.

Sonic Generations
Yes, SEGA refuses to let Sonic the Hedgehog die. That’s a good thing(sort of) because a lot of us love Sonic(Except true Sonic fans, They are a bunch of haters). Over the years, Sonic games have been doing poorly, especially when SEGA entered the 3D era. Not all the Sonic games are bad. Sonic Adventure and Sonic Adventure 2 was good, Sonic Unleashed had its moments and Sonic 06 is okay(I got the game recently so I haven’t played it that long). I do remember playing Sonic Heroes but my memory of it is hazy. Despite all of SEGA’s failed attempts to make Sonic games better(Such as the whole hoverboard thing, the swords, cars, guns, and drugs. Okay there were no drugs), I think they can still make a comeback. Sonic Generations looks promising.

SEGA finally listened to their customers.

I suppose SEGA doesn’t really believe in the “the customer is always right” motto but I guess now they made an exception because Classic Sonic has been requested since the beginning of time. Sonic Generations contains two Sonics, Classic Sonic(Before 3D), and modern Sonic(Now). You get both 2d style platforming and 3D(sometimes 2.5D) style…what do I call it? I personally enjoy modern Sonic because he looks older and more mature. On top of that, he is much faster. Classic Sonic is like the chubby prepubescent Sonic use to be. I played the demo (both versions) and I gotta say, from what I played, the game looks good. The modern Sonic levels are fast as hell. So fast I could barely keep up. The classic Sonic level is a lot like the one from Sonic the Hedgehog because it is. I’m no fan of 2d platformers but It’s still pretty cool.

Buy it, play it and tell me what you think of Sonic Generations.

If you pre-ordered it, get it, play it, and tell me what it’s like. I want to know if it’s worth waiting. Lets hope for SEGA’s sake that this game doesn’t suck. If it does suck, SEGA can always try again.

Since I don’t have any money, I can’t get the game any time soon. By the time I get it, 3 new Sonic games will be made. Looks like I’m getting the game for Christmas.

Before I end this, happy slightly belated Halloween and congratulations SEGA for somehow keeping Sonic alive for 20 years.

And when I mean true Sonic fans I mean TRUE Sonic fans. If you rarely complain about the games then you are not one.

Posted in SEGA, Sonic | Tagged | Leave a comment

YouTube on the Xbox 360? Finally.


YouTube on the Xbox 360? About bloody time.

I just received an email from Xbox saying that they will be updating Xbox Live. The updates will include: HBO GO, Syfy, and YouTube. Yeah I said it, YouTube. I always wanted to watch YouTube on the TV(I’m not rich so I don’t have stuff like Google TV) and now I can thanks to the Xbox. I wonder if the PlayStation 3 has YouTube support as well. Probably, the commercials claims it does everything(It can’t time travel or toast bread or can it?).

Other new features on Xbox Live include, UFC, iHeartRadio(I have that app on my iPhone), and Crackle. Xbox Live will also come a voice search.

One of the things I don’t like about these features is that you have to gave a gold membership to use it. Why should I pay to watch a YouTube video? YouTube is free. I really don’t like that you have to both pay Microsoft and Netflix to watch a movie on Netflix. Well, now I know why Bill Gates is so rich(Hey Bill, can I have some money so I can buy your products?).

All of those features are nice but when will I get to surf the actual internet on the Xbox? How about being able to run Windows 7? They’re both from the same company.

Despite the Xbox’s limitations, It was worth the $20 I payed for it. Yes $20 not $200. You Jelly?

Edit: I actually tried the YouTube feature today and it was really cool. It would be better I I had an HDTV so the edges won’t get cut off.

Posted in Microsoft, Xbox 360 | Leave a comment

How to make stereoscopic 3D in Flash


Stereoscopic 3d in Flash? This is unreal.

While I was drawing in Flash, I discovered an interesting way to stereoscopic 3D in Flash. If you were planing on making a 3D cartoon or picture in Flash then today is your lucky day. All you need for this to work is Flash and a pair of 3D glasses. I own green and magenta grasses from the movie “Coraline”. I don’t have the red and cyan ones. This tutorial will work with both kinds and will not require any 3rd party software or ActionScript skills. This type of 3D is called Anaglyph because it uses colors to separate the image instead of light.

Here is the end result of what we will be making:

3D green and magenta Bob running from explosion

This is the green and magenta(Technically red. I’ll fix it later) version. Here is the the red and cyan version

3D red and cyan Bob running from explosion

There is a little bit of ghosting but I left it like that to show you that it really works. These images were made in Flash, not Photoshop. If it’s not working, it’s probably because these pictures are JPEGs and JPEGs ruin the color. On top of that, I’m using color that are not safe for 3D(red and blue).

Requirements:

  • Flash 8 and up. Earlier versions of Flash may not have the required features.
  • Basic knowledge of Flash.
  • Some drawing skill. Stick men might work but not as well.
  • 3D glasses. Must be colored. Don’t use realD glasses because your screen doesn’t support polarized light. Even if it does, it won’t work.

First step. Open up Flash.

It doesn’t mater what version of Flash you have unless you own something before Flash 8.

Step two. Draw something.

To make your Flash cartoon or picture 3D you need something to work with. So start drawing. If you are drawing a background, Make sure you separate into pieces for depth. I will be using the files from this picture for this tutorial.

Bob running from explosion

Now that you have your picture. Convert each item you want 3D into a MovieClip.

Step 3. Make it 3D.

Making a 3D film requires two videos to be shot at the same time but in slightly different positions. This effect is similar. What we need to do is copy each item and put it on a layer (or layers) above the first one. Now that you have done that, you need to move each one slightly to the left and the copies to the right(Or vise versa). The farther away the image is from the other one, the closer it will seem when you put on the glasses, don’t overdo it or it will kill the effect. This is known as ghosting.

3D guide for Flash

Following this guide should help you make working 3d effects. Even thought red is on the left eye and cyan is on the right, the colors in the picture should be opposite(Sometimes).

If I’m correct, the left eye should be on top of the right eye.

Now that that’s done, time to apply the effects. Select the left side of each object and go to the properties panel. Go down to the color effect section and select “Advanced” and set the following settings:

Set the Green and blue to 255 and red to 0
For green, just set blue to 0.

Now that we have cyan/green, next is the red/magenta.

Select the right side of each object and set the color to the following:

Set the red to 255 and everything else to 0

For magenta, Add 255 for blue.

Now your picture is blue/green and red/magenta but it doesn’t look 3D yet. You need to do one more step.

If you don’t see the color effects dropdown, your Flash is too old.

Step 4. Making it work.

For the 3D to work in Flash, you need to take the left side of each object and set the blending to “Multiply”.

When you’re done, test it. Click CTRL+Enter, put on your glasses and there you go. Stereoscopic 3D in Flash. You probably wouldn’t have believed me if I didn’t show you.

Troubleshooting

If your colors look inverted, try swapping positions or the channel settings.

If there is too much ghosting, try moving your objects closer together.

If it’s not working at all, then you did something wrong.

If your picture or video lacks depth, try making the backgrounds closer to each other and the foreground farther, but not too far.

If you can’t find Flash on your computer, You need to buy it or get the free trial from Adobe.com.

Tips

For best results, it is best if you take your entire picture or animation and nest it inside of a movieclip and layer each object across the z-axis and then do the effect. Flash CS3 and lower do not support z-axis positioning so you need to try something else if you own an old version.

Make sure the 3D object or objects is not cut off by the edge, that ruins the effect.

Try not to use colors in your picture like red or blue because it interferes with the glasses. I obviously did not follow this. Brown is also a bad color to use. It turns cyan green.

When exporting, make sure the file is high resolution. Low resolution ruins the 3D. I did not follow this either. Don’t use JPEG. Use PNG instead

Try not to use blur filters. As fun as it is, It doesn’t work well in 3D especially if it exceeds 5px. If it works for you, go for it. I had to remove some blur from the original picture to make it work.

Label your layers. It makes life easier.

Try putting your picture/animation in two folders, one for left side and one for right side. That way it’s easier to maintain.

If you can’t draw, try Photoshopping some images and separate the foreground from the background and import it into Flash. Note: I haven’t tested bitmaps so you may get undesired results. Tested. Works.

That is how you make stereoscopic 3D in Flash

If you like this tutorial, tweet, like, digg, blog, email, plus 1, and/or Reddit it to your Flash loving friends.

If there is a problem with the tutorial, post a comment to tell me.

If you are having trouble, post a comment and I’ll try to help you.

Edit: added additional information.

Edit(10/19/2011): Rewritten certain parts, fixed typos and add more information.

Edit(11/17/2011): Resized images so they fit in the post.

Posted in Adobe, Flash, Tutorials | 1 Comment

New comics. Hurrah!


Comics! About bloody time.

It took a while but I now have comics. I made two three one-page comics and I will be making more (Hopefully). I’m in the process of making a third comic and a new cartoon. Lets pray for Flash not to kill my stuff again. It’s annoying.

You can view my new comic here and I will be releasing the second on shortly. The Second comic is here.

Edit: Third comic is now up.

If you like fuuuu comics then you’ll probably like these high quality, fully colored, not made in Microsoft Paint comics. If you don’t know what fuuuu comics are, Google it. You will find a whole collection of fuuuu comics. Some of them are really funny. If you don’t know what fuuuu means, It half of the word fuck.

Don’t you just enjoy internet memes? Well you may not like them but I sure do.

I’m going to post one of the comics here to save you some clicks.

comics

That is all for now. I need to get back to work …..or maybe sleep.

Edit: Fixed broken link and added new comic.

Posted in site updates | Leave a comment

Flash CS5.5 sucks!


After a long week of animating in Flash, my file gets corrupted and I can’t recover it. Thank you Adobe.

Adobe Flash CS5.5 is absolute shit. I can’t believe Adobe would sell people this piece of digital crap. It is buggy and very unstable. If you value your Flash files, do not make or open them in Flash CS5.5. If you do, You are bound to lose them. They will get corrupted can you will not be able to open them again.

I am pissed out of my fucking mind! I just lost another cartoon. How am I supposed to get viewers if all of my cartoons keep getting corrupted? All I did was save the file and closed it so I can open another file without using so much RAM. As soon as I went back to the file, Flash couldn’t open it. This really sucks. I don’t know how anyone can use this shitty excuse for an animation software. Those “programmers” at adobe are lazy as hell when it comes to making Flash. The people who make Dreamweaver and Photoshop do a decent job but the Flash department is too busy counting their cash rather than making a usable program. Instead of making Flash stable and functional, they overhype the shit out of it and watch the money roll in. Apple does the same thing but their products actually work.

Going back to Flash CS5

I can’t stand Flash CS5.5 so until CS5.5 becomes more stable(And it won’t), I’m going back to CS5. Flash CS5.5′s new features aren’t that great anyway. I have an auto-save plugin for CS5 and auto-recovery is useless because you can’t recover a corrupted file. As for the android app development feature, It doesn’t work with the Coby Kyros(That is the only android device I have) because of the lack of AIR(The player, not oxygen).

If you want the auto save plugin too, you can download it here. I got mine from a book.

To all people that is thinking of buying Flash CS5.5:

DO NOT BUY IT! Wait until CS6 or buy an older version if you don’t have one already. Flash cs5.5 is not worth buying. Nobody should pay $700 to get their hard work deleted. All of the other CS5.5 products I have used are fine, It’s just Flash that sucks.

Posted in Adobe, Rants | Tagged , , | 4 Comments

How to use HTML5′s pushState


As I promised, I will write a tutorial on how to use HTML5′s pushState.

If you don’t know what HTML or pushState is, this blog post is not for you. This tutorial is for people who have some experience with HTML and JavaScript. Before I start, I need to make sure you are ready to use pushState and HTML5. Just to let you know, the code is written by me but Github had a page that helped me figure out how to use popState. Last time I used pushState, I had to use iFrames to keep track of the history. You should also know that the code I’m giving you is incomplete. This means you need to use your skill to make it work properly. I didn’t break the code, it’s just that it only works if you have pages to load and that’s too much work for me to do in this tutorial. To test the code I’m about to show you, add alert functions in the “updateSite” function. More on that later.

What is pushState?

Actually it’s history.pushState but I’ll call it pushState to make this tutorial easier to make. PushState is used to change the URL(URI whatever) without refreshing the page. Websites like Github and Facebook use pushState. It’s similar to location.hash but way cooler but I still recommend using location.hash just in case someone with a crappy web browser (*cough* IE) views your website and pushState is not supported. There is more than just pushState, there is also replaceState which changes the URL without adding anything in the browser’s history. This tutorial will be focusing on pushState, not replaceState.

What’s the point of pushState?

PushState is awesome and any site that uses pushState is awesome. PushState is great for people with slow internet or have limited bandwidth. Only loading essential parts of a page makes surfing the web faster and faster is better.

Compatibility notice for history.pushState(or just pushState).

PushState works in Google Chrome, Firefox 4 and up(doesn’t work in Firefox 3 or lower) and Safari. PushState does not work in Internet Explorer 9 or lower nor does it work on iPhones.

What you’ll need to use pushState:

  • A text editor like Dreamweaver or notepad++. Notepad or wordpad works fine.
  • A good web browser. Don’t use Internet Explorer. IE doesn’t support pushState.
  • JQuery library. This is required or some of the code wont work.
  • Some programming experience.
  • Patience because it may take a while to understand what I’m saying. Some of this stuff may not be in laymen’s terms.
  • .HTACCESS and PHP. This is not needed to use pushState but if someone refreshes the page, they may get a 404 error if you don’t have the page. PHP can be used to have a dynamic page and .HTACCESS can be used to redirect the user to that dynamic part of the page.
  • An actual webpage to test it. It doesn’t have to be pretty.

Now that you’ve gotten everything, Lets get started. First, make sure you have a webpage. If not, create one. Here is some code to start you off:

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<a href="link1">Link 1</a> <a href="link2">Link 2</a>
</body>
</html>

It’s pretty basic code so don’t expect it to look sexy. Second, we include the JQuery library. Place the code in the head tag:

<script src="path/to/your/jquery.js" type="text/javascript"></script>

Third, we start adding some JavaScript code. I’ll explain what each line does. What we want to do is take the links and hijack them. If you don’t know what I’m taking about visit this page and read the part about hijacking links because I’m not repeating myself. Here is the code:

<script language="javascript" type="text/javascript">
<!--
// The following script was created by Dakota Wyatt from Dcoinc.net.
$(document).ready(function(e) {
    $("#nav a").click(function(e){
		e.preventDefault();
		var url = $(this).attr("href");
		history.pushState({page:url}, url, url);
		updateSite(url);
	});
});
-->
</script>

Don’t worry about the “updateSite()” function. We’ll get to that later.

Now to explain the code. Everything in bold requires JQuery.

$(document).ready(function(){...}); is a JQuery event that fires when the DOM is ready. Without this, the code will most likely not run.

$("a").click(function(e){..}); is a function(or something. I don’t know the names to everything.) that is called when a link is clicked. When a link is clicked, we call the pushState event.

e.preventDefault(); is a JQuery event used to override the links’ original destination and change it or do nothing. In this case we prevent the user from leaving the page and use pushState to change the URL.

var url = $(this).attr("href"); is used to obtain the URL the the link you clicked. This is needed so we can tell pushState the URL we want to change to.

history.pushState(state object, title(useless), url); is used to change the URL in the address bar without refreshing the page. The first parameter is the state object. When I wrote this tutorial I didn’t know how to use it. Now I do so I’m going to show you how to use it. The title parameter in history.pushState is useless and as far as I know, it doesn’t do anything. I don’t think any of the browsers read the title parameter. The third parameter is needed however because that actually changes the URL.

updateSite(); is a custom function that changes the content whenever it’s fired. As you can see, we haven’t written it yet.

Using popState.

PopState is an event that is fired everytime the browser history changes. Without popState, pushState is pointless. You can detect the change in history using the code below:

$(window).bind("popstate", function(e){
	var state = = event.state;
	if(state){
		updateSite(state.page);
	}else{
		updateSite("home");
	}
	});

This code checks the popState using JQuery’s bind event.

Now to explain this code.

This code has been modified to take advantage of pushState’s state object parameter. When I published this tutorial, it didn’t use object state, it obtained the page info by taking it from the URL.

$(window).bind("popstate", function(e){..}); is used to detect change in history.

var state = event.state; is used to read the object state created by pushState.

if(state){..}else{…} The if else condition is used to check if there is a object state. Without this, you will get an error.

updateSite(state.page); is a custom function I have not created yet. The state.page part obtatins the page object from the state variable. If you look at the first parameter in the pushState function, you will see that we set an object as the link URL we clicked which was called “page”. State being the variable and page being the object we defined in pushState. Just making sure you understood because it may not be easy to comprehend.
It’s simple once you figure it out. Next, we will write the updateSite function. I noticed that popState doesn’t fire when pushState is called but it does work if you click the back and forward buttons. That is why I call the updateSite function when the link is clicked.

function updateSite(currentPage){
	// load your pages using the currentPage variable. To test it first, add an alert function like:
        // alert(currentPage);
}

This code is super simple depending on your needs. As you see, I put nothing in the function. You need to write your own content changing code. I might help you. In the meantime, If you want to test it. add an alert function like this: alert(currentPage);

That is all you need to use pushState.

Seriously, that’s all the code you need to use pushState. Easy right? Facebook makes it look so hard. Congratulations, you now know how Facebook does that fancy no refresh thing. It’s not magic, it’s the power of pushState and popState. Before I end this, let me show the whole code:

 

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="path/to/your/jquery.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
<!--
// The following script was created by Dakota Wyatt from Dcoinc.net.
$(document).ready(function(e) {
    $("#nav a").click(function(e){
		e.preventDefault();
		var url = $(this).attr("href");
		history.pushState({page:url}, url, url);
		updateSite(url);
	});
});
$(window).bind("popstate", function(e){
	var state = event.state;
	if(state){
		updateSite(state.page);
	}else{
		updateSite("home");
	}
	});
function updateSite(currentPage){
	// load your pages using the currentPage variable. To test it first, add an alert function like:
        // alert(currentPage);
}
-->
</script>
</head>

<body>
<a href="link1">Link 1</a> <a href="link2">Link 2</a>
</body>
</html>

Copy the code, paste it in a text editor, edit it, save it as an HTML file and test it.

I hope my tutorial is helpful to you. If it is, please spread the word to all of your programming friends by tweeting and liking this on Facebook and all of the other options at the bottom of this blog post. I will be writing more tutorials covering things that haven’t been covered before or write a tutorial that’s been written to death.

If you have any problems or suggestions, please write a comment below.

Edit: Edited the code to take advantage of state object and fixed typos.

Posted in HTML5, JavaScript/JQuery, Programming | 7 Comments

Cleaning up the site and removing the crap.

I’ve had my blog for a few months now and only some of my blogs are interesting. What I will be doing is deleting all of the blogs that would be considered uninteresting. The rest of the blogs may either be edited or left alone. I will be writing more tutorials and working on more cartoons and artworks. I will also try to make a few comics because everyone love comics at least the cool people.

That is all.

Posted in site updates | Tagged , , | Leave a comment

How Adobe Flash can be improved


Flash is a great animation software but it can be better.

I like Flash. I use it for mostly animation. Flash, if used right, can be great animation tool. Even though the software is good, there is a lot of room for improvement. Sometimes I need a specific feature that Flash doesn’t have and it’s kind of annoying to have to use a different software or deal with the limitation. I have a list of features that I would like to see in Flash and maybe one day, Adobe will add some of these features. There are probably more features I want to list but I can’t think of any more at the moment. If you have any feature ideas, feel free to post a comment.

List of features that would make Flash better.

Camera

Every other animation software has cameras. Why not Flash? It would be really cool to move and animate a camera rather than moving everything to simulate a camera movement. I tried using v-cams but they don’t work in fullscreen or when I’m converting the video to HD.

3D or 3D like space

Toon Boom has a 3d environment where you can move your drawings and layer them across the Z axis to give it a real 3D effect. Simulating that in Flash is a pain in the ass. Flash would be way better if there was a 3D space to work in.

Filters on graphics

I was a little pissed when I found out that you can apply filters like blur and drop shadow to your drawing but only if they are MovieClips. MovieClips? How come I can put filters on MovieClips, buttons and text but not on graphics? I don’t like using MovieClips for cartoons because they play even when the video is paused and it’s hard to sync it to any animation on the timeline. If Flash adds the ability to add filter to graphics, that would be awesome.

Bending gradients

This isn’t really an important feature but I do need it sometimes. It would be really cool if I could bend a gradient like if I had a crooked pipe or pole and have the gradient bend along the pole. Here is picture to show what I’m talking about:

Flash

The ability to bend gradients would be very helpful.

Native 3D integration

Using Swift 3d’s Flash exporter is lame(No offense Erain). Why can’t I just take the 3D object and move and rotate it in Flash itself like Toon Boom(I think that feature is only in Toon Boom Harmony). Using multiple 3rd party softwares to do one simple task is stupid. Obviously I would model using a 3D program like Blender or 3DS Max but it would be awesome if I can drag and drop the 3d file and manipulate it in Flash.

Better shadow support

Shadows play an important role in ..well…everything. Cartoons, games, 3D animated films, and life. Shadows give the object a sense of depth when basic object representation is not enough. Flash needs better ways of making shadows. Drop shadow is useless and all the best ways of making shadows require the objects to be MovieClips. As I stated above in the “Filters on graphics” section, adding the ability to give graphics filters would make making shadows easier. Drawing the shadow is sometimes good but it works best in certain lighting conditions.

Warping for bitmaps, graphics, MovieClips, etc.

In Photoshop, you can warp images using the liquify tool. You can do something similar in Flash but it doesn’t work on bitmaps, graphics, MovieClips, buttons, groups or text. Look at the picture below:


In the picture above, you can see that I can warp the drawing if it’s not a graphic or MovieClip. If it is a graphic or MovieClip, I can double-click it and then warp it but that effects all the scenes that have that symbol. Sometimes I want to warp a symbol but I don’t want it to effect the other scenes that contain that symbol. I could duplicate the symbol but I have a tendency to edit things and having a shaded object and an unshaded warped object would ruin whatever effect I’m trying to achieve.

Better alpha settings

Flash needs better settings for applying alpha to my symbols. Lets say I want to make a character transparent, as if he/she was a ghost. If my character is one drawing, it’s easy to do but if my character is separated by symbols or layers, all of the part that overlap look weird. The same problem would occur if I were to give that character a shadow. Here is an example:


I want to be able to choose if the objects inside the symbol should overlap or not.

edit(12/23/11): If you have a symbol that is is made of multiple layers you can set the blending to “layer” and the symbol won’t overlap. This only works with MovieClips and buttons. I wish it would work for graphics.

Better blur settings

I been using the blur filter ever since I first discovered it. Even though the blur filter provides a decent blur effect, it would be nice if I could control the angle. Adjusting the blur angle would come in handy for motion blur effects.

Better video converter

I absolutely hate Flash’s video converter. One time, I converted a cartoon I made a few years ago into an AVI and the file was over 2 Gigabytes. Gigabytes, not Megabytes. The cartoon was pretty cheap, low resolution and about 3 minutes long. I now use the Sothink swf to video converter to convert my videos to High Definition. The files converted using the video converter are about 8-15MB, much smaller than the one made by Flash.

Multiple color effects on one object

Color effects are useful in Flash if you want to tint a symbol or make it transparent. However, you can only apply one color effect at a time on one symbol. It would be better if I could apply 2 or 3 color effects to a symbol.

Support for stereoscopic 3D

3D is the future of entertainment believe it or not. Almost every new movie is in 3D and everyday, more 3D videos are becoming available on YouTube. People with Toon Boom animate pro 2 have the ability to make 3D cartoons while us Flash users are stuck with 2D. Some people say 3D is a stupid gimmick. Gimmick or not, I would love to make a 3D animated film using Flash.

Edit(12/23/11): Even though there is no 3d support, You can still make a 3d flash cartoon by following this tutorial.

List of bugs in Flash CS5.5(current)

I should also list the bugs that are in Flash. If Adobe eliminates some of these bugs, it will make Flash much more stable and not so annoying.

Glitch with onion skin

Onion skin is very useful for frame-by-frame animation. There is, however a minor glitch with it. The glitch does not affect the workflow much but it should be fixed. Normally, Onion skin only works on unlocked layers but whenever there is a tween present, the object that’s tweened become see-through regardless of the layers lock state. Like I said, it’s minor and it doesn’t affect the file or the workflow but it can be a bit annoying when I’m scrubbing the timeline. Both CS5 and CS5.5 have this problem.

Out of memory error

I hate it when I get this error. Sometimes I’m working on a Flash file and I have a few windows open, when I save my file or convert something fairly complex into a symbol, I get the stupid “Not enough memory” error. When the error occurs, It screws up almost everything in the file and I get pissed out of my mind. Both CS5 and CS5.5 have this problem.

Sudden crash when I convert to symbol twice

There is a weird bug when you open Flash and open a new Flash file, draw or import something, convert to symbol, and convert to symbol again, Flash crashes. That seriously needs to be fixed Adobe.

Occasional corrupted file

A while ago, I was working on a 4th of July cartoon in Flash and the file became corrupted. I don’t know what happened but I can’t open it anymore. That was a week well wasted.

Edit:(12/23/11): I have actually recovered the file and I will probably finish it later. If you have a corrupted Flash CS5.5 file, You can follow this simple tutorial to recover it.

Constant sound issue

When I’m working on a cartoon, I do the voices before I do the animation. Sometimes when I record some dialog and import it to Flash, Flash doesn’t play it right. Part of the audio gets cut off and I would try everything from editing to rerecording to fix it. Sometimes I can fix it, sometimes I can’t.

Well, That’s all I have to say about Flash. The list of bugs only apply to Flash CS5.5 and for some, CS5. Older version may not have these problems.

Posted in Adobe, Flash | Tagged , , | Leave a comment

How to use location.hash


What is location.hash?

Location.hash is something in JavaScript that helps people make dynamic or history compatible one-page websites. Still don’t understand? Let me properly explain. This is my first tutorial so bear with me. Lets say you have a website and you need to make 20 or so pages for it but what if you don’t want to make 20 pages or maybe you don’t have enough space on your hosting to have that many pages? What if you just want one page to dynamically load any specific page and have the ability to go back and forward. What if you’re building a web-app? If the app refreshes, It screws up the app-like feel. This is where location.hash comes in handy.

To build build a dynamic one-page website, you need to use JavaScript to read the hash value in the URL to determine what page to load and then use JavaScript to load it.

What is a hash value?

I don’t know if it’s called a hash value. I just call it that. A hash value is the string of text in the URL after the hash(pound if you’re American) symbol. For example, http://www.mywebsite.com/#hashvalue. If I had a dynamic one-page business website and you click the “About” button, the URL will go from http://www.bizsite.com to http://www.bizsite.com/#about. That will tell the website what page to load.

How to actually use location.hash?

Don’t rush me. I just need to make you you understand everything before we start. Before we actually start coding(or steal my code) you need a few things. First, you need an html editor like Dreamweaver or notepad++. You could also use notepad or wordpad or whatever Macs come with and save the file as an html file. Next, you also need the JQuery library. It’s not necessary to have it but some of the code I write will require JQuery. You can download the JQuery library from jquery.com. The last thing you’ll need is some programming experience with HTML, CSS, and JavaScript. This is necessary if you want a good looking website and to understand what the hell I’m saying.

One more thing before we start. This tutorial tells you how to use location.hash. I do not show you how to build a complete website. If you want to know how to make a website, then you’re in the wrong place. Also I am showing you my method of doing this. There are other ways of doing this.

Compatibility note: This works in all browsers except iPhone. onHashChange is not supported on mobile safari. It probably works on the newer iPhones but not the original. If you are building a web-app you need to replace the onHashChange code to something iPhone compatible. I don’t know much about web-app development so I can’t help you.

Got everything? Good. Lets get started.

First I’m going to show you how to create a link with a hash value. Create a link and in the href attribute, put “#whateveryouwanttoput”. It should look something like this: <a href="#myhash">Link</a>. Now save your file as a .html file and test it in the browser.

You should see a link like this: Link. When you click it, the only thing that changes is the URL. Awesome right? Now lets get to the real coding. In the tutorial, you will be using relative links not hash links. Continue reading for more information.

Actually using location.hash.

To build a proper one-page website using location.hash, you should do a check when the page first loads to see if there is a hash value available. This will come in handy if someone bookmarks a specific page or links directly to that page. What you need to do is check if a hash value is available or not. You do the check once on the onLoad event or JQuery’s ready event.

Here’s the code I created:

<script src="path/to/your/jquery.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// The following script was created by Dakota Wyatt from Dcoinc.net.
$(document).ready(function(e){
	if(location.hash){
                // We got a hash value! Lets take off the hash and smoke it.
		var newhash = window.location.hash.substring(1);
                // place your code here to change the content.
                // alert(newhash);
                // uncomment the above code to see if it works.
        }else{
              // no hash value
              // alert("No hash available.");
        }
});
</script>

This code checks if there is a hash value present during it’s first run. If there is, we can change the content on the page to it’s proper page content. If not, either do nothing or load the home page. I use substring to remove the hash symbol from the location.hash for proper reading so if I go to the store page directly, it will find the hash value and remove the hash symbol and it will come out as just “store” instead of “#store”. If you need the hash symbol for some reason, Just remove the “.substring(1)” part. You can test it by uncommenting the alerts and opening the file in a web browser and at the end of the URL, add a hash symbol and type in some text and press enter. If it does nothing, refresh the page. If it still does nothing, check the code to make sure there are no errors.

Time to explain the code.

The $(document).ready(…); is to tell the code not to run until the DOM is ready. Without this, the code will run before anything is ready and the code won’t work. This requires JQuery to run. If you don’t wan’t to use JQuery, Replace $(document).ready(…); with

document.onLoad = function(){
     // The code in the middle goes here.
}

I think that’s how it’s supposed to be.

if(location.hash){…} checks if there is a hash value. If there is, you can run a function or any code you want.

var newhash = window.location.hash.substring(1);

The code above is the variable so you can easily load a page dynamically by using the load function or call a function that places specific text in the content area.

Next is to hijack the links.

Hijacking links means to stop the link(or links) from going to it’s original destination and make it go somewhere else or nowhere. Why do we need to do this? Simple. What if you want to make a dynamic one-page website and some asshole with JavaScript disabled comes to your website and is pissed off because your website doesn’t work. The URL might change if you add a hash symbol in your links but it won’t do anything else. We want to have static webpages for losers people without JavaScript and still have our fancy site for the people who kept JavaScript enabled. If you had a link like http://www.myfancysite.com/about with JavaScript we can redirect the user to http://www.myfancysite.com/#about. That way the page wont refresh and Anti-JavaScripters can still somewhat enjoy your site. The code I’m about to show you only works with relative links without extensions. Examples of proper links:”home, about, donate, etc”. Examples of improper links: “home.php, about.html, http://www.mysite.com/donate”

To do that is simple. Here is the code. Place this inside your onLoad or ready event

$("a").click(function(e){
		e.preventDefault();
		window.location.hash = $(this).attr("href");
	});

With this code, it takes all of the links and prevents them from leaving the page. The only thing it will do is change the hash value of the page you want to go to. But what if you only want certain links to be hijacked? Easy. If you only wanted navigation links for example to be dynamic then put all of the link in a div or span and give it an id of nav or whatever you want and replace “$(“a”)” with “$(“#nav a”)”. So now all of the links the the nav element will be hijacked.

Now to explain this piece of code:

$(“a”).click(function(e){…}); is used to run a piece code when a link is clicked. In this case, when you click a link, it doesn’t go to its original location. It stays on the same page and adds a hash value in the URL. The part that is bolded requires JQuery. If you don’t want to use JQuery, you can replace $(“a”) with something like document.getElementById("div") or something like that I don’t know, I’m not a JavaScript expert.

e.preventDefault(); is a JQuery event and it’s used to stop the link from going to its set destination. That way it won’t leave the page when you click a link. This is a JQuery event meaning you need JQuery and I don’t know the JavaScript equivalent except maybe adding “return false” in the onclick attribute on the link like “<a href=”http://www.website.com/epicwebpage” onclick=”return false”>Epic page</a>”. People without JavaScript enabled don’t have to worry about it because “return false” will be ignored. Here is more info for preventDefault.

window.location.hash = $(this).attr(“href”); changes the URL by adding a hash symbol and adding the URL from the link. If a hash value is already in the URL(The URL, not the link), it will be overwritten with the new one. This code only works with relative links. If you have full links or links with extensions, You need to either change them or add some code to separate the URL. I might show that later. The part in bold requires JQuery and I don’t know the JavaScript equivalent.

Detecting hash changes from location.hash using onHashChange.

Now all we have to do is to detect whenever the hash changes. When it does, we change the content. To do that, we use JavaScript’s onHashChange event to do that. Before onHashChange was created, People like Google had to use iFrames to keep track of hash change. Now we can detect hash change without iFrames. Using onHashChange is good for keeping track of history. If someone clicks the back button, the user expects to go back to the page before. If it doesn’t do that then your website sucks(no offense). To detect hash change, type or copy and paste this anywhere in your script tag:

window.onhashchange = function(){
        // hash changed. Do something cool.
        if(location.hash){
             var hash = location.hash.substring(1);
             // load page
             // alert(hash);
        }else{
             // load home page
             // alert("home");
        }
}

In the onHashChange event, you can call a function to change the content or change from there. You can use the hash variable to know what page you are on. To test it, uncomment the alerts and add a few link in you webpage and click on them and go back and forth. When you do that you get a popup saying what the hash value is. If there is no hash value, It will alert “home”.

In case you didn’t read the compatibility note above, onHashChange does not work on iPhones. Well at least not old iPhones. Since I don’t have an iPhone 4 or the eventually upcoming iPhone 5, I can’t test it.

Time to explain how this works:

window.onHashChange = function(){…} is used to detect when ever the hash changes like for example, if you click a link or go back and forward.

if(location.hash){…} checks if there is a hash value. This is necessary. If you don’t add it you will get errors when the user tries to go back to the homepage by clicking back.

That is the basics of location.hash take this code and knowledge and build awesome sites with it. I did not do all of the work for you, I just showed you how to detect hash change and react to it. Everything else you must do on your own. If you need help, Leave a comment and I will try to help you.

Before I forget, here is the full code:

<script src="path/to/your/jquery.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
// The following script was created by Dakota Wyatt from Dcoinc.net.
$(document).ready(function(e){
	if(location.hash){
                // We got a hash value! Lets take off the hash and smoke it.
		var newhash = window.location.hash.substring(1);
                // place your code here to change the content.
                // alert(newhash);
                // uncomment the above code to see if it works.
        }else{
               // alert("No hash available.");
              // no hash value
        }
        $("a").click(function(e){
		e.preventDefault();
		window.location.hash = $(this).attr("href");
	});
});
window.onhashchange = function(){
        // hash changed. Do something cool.
        if(location.hash){
             var hash = location.hash.substring(1);
             // load page
             // alert(hash);
        }else{
             // load home page
             // alert("home");
        }
}
</script>

This code will not work by itself. You need to adapt it to your website. If you want to test it first, try uncommenting the alerts on the onHashChange event and one-time check in the beginning.

Should I use location.hash on my site?

You should use it but you should also make sure your website works for people without JavaScript. Why? Because 20% of all Internet users disable JavaScript. Did you know websites like Google, Facebook and Twitter use location.hash but also have support for non-JavaScript users? I don’t know if they use location.hash in particular but I do know they use something similar.

If you want to know how to change the URL itself and not just the hash value, then you need to use HTML5′s pushState. I’ll make a tutorial on how to do that later.

I hope you enjoyed this tutorial an I hope you learned a lot. I tried to make this tutorial as simple yet informative as possible. Later on I’ll make a test page so you guys can see the code in action.

Posted in JavaScript/JQuery, Programming | 3 Comments