Angel Medrano | Web (*) Developer

All sorts of webby goodness!

Great wallpaper source

http://www.smashingmagazine.com/2008/02/12/really-stunning-desktop-wallpapers/

Check um out!

-a

Posted November 28, 2009
// 0 Comments

What Happened to the AIR CMS?

So a while ago, when I first heard about AIR, I thought it would be
fun to build an AIR based CMS. I had a client come to me with a half
built website that some one built with droopal. The guy had left him a
long email with instructions on how to update his website. The client
had no idea what to do and so someone sent him to me. So I thought...
this is the perfect time to work on the AIR CMS! I realized that most
small business owners need to do very little to their site.
For example, service based businesses will do good just adding
pictures to their website and in this case, testimonials.

Anyway, heres my result. Im not gonna paste code, cause its like 17
pages worth.

I used, AS3, Zend PHP to communicate to a database, some PHP for
uploading files.
Also one thing I experimented with was having AIR resize the images,
first creating a Bitmap then exporting and creating a new compressed
file using Adobe's Jpg encoder. Only problems I ran into was encoding
large Bitmaps would lag the app up pretty hardcore... so that was a
debatable function.

The client in the end, disappeared off the face of the earth :( (it
happens) but I did get to build something neat!

Check out the pictures!

-happy coding!

       
Click here to download:
What_Happened_to_the_AIR_CMS.zip (214 KB)

Posted November 5, 2009
// 0 Comments

Just for fun--- AS2 + AS3 TYPEWRITER EFFECT

Here's something I had to do today for client.
The idea is, you see the text type on "as if being typed on a typewriter".
I had to do it in As2 so heres the snippet ( I dont know if Posterous
supports formating so it might all just be jumbled together)

AS2 ----------------------------
Its pretty strait forward so I wont go into any explaination, leave a
comment if you would like some.

var s:String = "http:// www.thenameofareallygreatwebsite.com";

var i:Number = 0;
var interval:Number;

myBtn.onRelease = startType;

function startType ()
{
interval = setInterval(write,90);

}

function write () {
myText.text =s.substr(0,i) + "|";

if(i >= s.length){

myText.text =s;
clearInterval(interval);
}

i++;

}

AS3 ---------------------------------

var s:String = "http:// www.thenameofareallygreatwebsite.com";
var i:Number = 0;
var interval:Timer = new Timer(100, s.length+1);
interval.addEventListener("timer", write);

myBtn.addEventListener(MouseEvent.CLICK, startType);
myBtn.buttonMode = true;

function startType (e:MouseEvent):void
{
interval.start();

}

function write (e:TimerEvent):void
{
myText.text =s.substr(0,i) + "|";
if(i >= s.length){

myText.text =s;

}
i++;

}

Simple and fun!

-happy coding!

(download)

(download)

Posted November 4, 2009
// 0 Comments

Updated Resume Available

Just updated my resume :D

You can find it here:

 

*updated again : Nov 4 2009


http://bit.ly/1i8HUy


-am

Posted November 2, 2009
// 0 Comments

Catching up, Moving on...

Howdy how!
Im considering taking "Flash Developer" off my blog title :D. Lately I've been doing more PHP and CSS than ever. I just finished my first site using the CodeIgniter Framework which I absolutely love. For a while I was getting into RUBY on RAILS but that was fizzled out. CodeIgniter uses the MVC pattern which is was one of the things I liked about RoR. Oh and just in case you are wondering from my last post on CODA, I ended up moving to using TextMate + TextExpander + Cyberduck(ftp). I'm in web developer heaven :D

Check out CodeIgniter sometime.
http://codeigniter.com/

NetTuts did a great series on it.
http://net.tutsplus.com/

Heres the site I just finished, its CodeIgniter based. The site has a custom CMS built into it which allows the client to add pictures and manage testimonials easily. This was a way better solution than having a full blown CMS, since most small businesses don't really need all those features.
http://dfwplasmaguy.com/

I have A.D.D with code. I really want to learn Android but feel like I need to go back and get some Java Training before I can understand it. So off I go... next stop Java?
Here a tute i found that explains bitwise operators really well ( I think you can apply this to FLASH as well, plus its just cool to understand binary :P )

http://www.javavideotutes.com/player/play/id/3

Till we meet again :D

happy coding!

Posted October 31, 2009
// 0 Comments

Coda- Web Dev tool

So, I'm sure this has been out for quite sometime, but I just found it today. Coda- A web editor for mac totally rocks!
I've been wanting to get away from dreamweaver for a while and think Coda totally hit the nail on the head. (sorry Adobe)
I will say there are at least 2 things I miss from dreamweaver. One of them being: If I were to rename a file in my defined site, DW would ask me if i want to update links... Coda does not do this. Also, when uploading files, DW would say something like " Would you like to put the linked files as well..." Well im sure they are more articulate than that :P
Anyways, Check it out if you're on a Mac.http://www.panic.com/coda/
If you're on a pc.... get a mac. http://www.apple.com :D

You can try it out for 14 days... then its $99 bucks. I think its a bargain.

Happy coding!


http://www.panic.com/coda/developer/

Posted September 11, 2009
// 0 Comments

FileReference.upload and some extra _POST variables

So, I'm working on an AIR CMS (personal hobby) and I've spent the day trying to do the following:

- Use AIR to grab an image from the users computer (.browse)
- Upload it using the FileReference.upload method
- Resize it with on the server to the appropriate dimensions
- Also, Im gonna wanna put a reference to the image on a database along with descriptions etc.

So here's what ive come up with

import flash.filesystem.*;

var file:File = new File();

file.addEventListener(Event.SELECT, onChoose); // this listens for when the user chooses a file.

btn.addEventListener(MouseEvent.CLICK, onMClick); // good ole fashioned mouseEvent

function onMClick (e:MouseEvent):void
{
// open the browse dialogue you can also filter as a second param
file.browseForOpen("Open");

// remove the original click handler cause i want to use the same btn for uploading
btn.removeEventListener(MouseEvent.CLICK, onMClick);
}


function onChoose (e:Event):void
{
btn.addEventListener(MouseEvent.CLICK, onUpload);// add the new MouseEvent when the user selects the file
}

function onUpload (e:MouseEvent):void
{

// location of your upload script
var url:URLRequest = new URLRequest("http://localhost:8888/mysite/upload.php");

// set URLRequest.method as POST so you can grab some extra vars with your php script
url.method = URLRequestMethod.POST;

// these are the variables i want to send along with my upload request
var vars:URLVariables = new URLVariables();
vars.tester = "this is a variable"; // you could add a whole slu of these and take those into the db (if you dont know how to do this, just google it.)

// tell the urlRequest to use these vars as well
url.data = vars;

// go ahead and upload
file.upload(url);


// listening to upload events
file.addEventListener(Event.COMPLETE, onComplete);
file.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
file.addEventListener(ProgressEvent.PROGRESS, onUploadProg);

}


function onComplete (e:Event):void
{
trace("completed");
}

function onUploadProg (e:ProgressEvent)
{
trace("Prog");
}


function onIOError (e:IOErrorEvent):void
{
trace(e + "no berries");
}

/////////////////////////////////////////////// Now the PHP script/////////////////////////////////////////////////////////////////////

Im using PHP5(dont know how big of a difference that makes.

<?php

//create the directory if doesn't exists (should have write permissons)
if(!is_dir("./uploads")) mkdir("./uploads", 0755);

//move the uploaded file
$targetPath = 'uploads/';
$newName = $targetPath .basename( $_FILES['Filedata']['name']);
$string = $_POST['tester']; // grabs those extra vars


// actually upload the file with a new name
if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $newName)){

// gives you with of the uploaded file
list($width, $height) = getimagesize($newName);

echo $width . $height;

$im = imagecreatetruecolor(300, 300);
$source = imagecreatefromjpeg($newName);
imagecopyresampled($im, $source, 0, 0, 0, 0, 300, 300, $width, $height);

// Save the image as 'wwhateever.jpg" or in this case just rename it the same.
imagejpeg($im, $newName);

// Free up memory
imagedestroy($im);

// Create a blank image and add some text to see our variable.
$im2 = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im2, 233, 14, 91);
imagestring($im2, 1, 5, 5, $string, $text_color);

// Save the image as 'new.jpg'
imagejpeg($im2, 'uploads/new.jpg');

// Free up memory
imagedestroy($im2);

}


?>

Thats it!
Hope that helps someone, I owe my whole career to people posting useful snippets to their blogs.
- happy coding

Posted August 19, 2009
// 1 Comment

Prototype AIR CMS

Finally having enough time to work on my AIR CMS again.
FLASH + AIR + ZEND + PHP
Heres a screenshot. ( Im gonna go back and style it real pretty like)
 
-angel

Posted August 17, 2009
// 0 Comments

Getting the MD5 Fingerprint of the SDK Debug Certificate - ANDROID

So... Im going through ANDROID tutorials cause I really really love the whole idea of Android and I think I've said it before, Im a big fan of Google. Anyways, Heres a snag I ran into, perhaps this might help someone in the future.
If your going through the HELLO VIEWS tutorials and you get stuck here http://code.google.com/android/add-ons/google-apis/mapkey.html and you happen to be on a Mac

Heres how I got my certificate. The "keytool" they talk about is in the bin directory of the JDK. Check out the path below which you eventually will plug into Terminal. It might be a little different for you? Maybe not.

USER$ /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/keytool -list -alias androiddebugkey -keystore /Users/USER/.android/debug.keystore -storepass android -keypass android

so, happy coding.

Posted August 8, 2009
// 1 Comment

More Jquery

Since I got my G1 ( i work on macs but like the idea of the ANDROID Platform and I admire Google) I find myself using the internet on my phone more and more. So when developing websites for a client, I thought I'd go ahead and make it all in PHP and JQuery to make it phone friendly.So now Im learning about JQUERY and I'm loving it. Here is a little post I just came across that you might find useful.

http://bit.ly/N6I5v

Well it wont be all Php. Im actually experimenting with an AIR/ZEND CMS I wrote a few months ago. I am aiming on keeping it really really simple.

Ill post about that when the project is rolling.

happy coding!

am

Posted August 5, 2009
// 0 Comments