Flash Tutorial: Adding buttons dynamically to the Flash stage using ActionScript

Level: This is an intermeidate lesson, so I will assume that the reader is familiar with the basic use of the Flash software including stage, timeline, drawing tools, property window, etc.

Version: I will be using Flash CS3 and AS2 (athough tut is compatible with earlier versions of Flash) and instructions are for the Mac. Windows users would use the PC counterparts for specific instructions on Flash Menu/Shortcut instuctions.

Source: http://mikestickney.com/wordpress/flash-tutorial-dynamic-buttons/

Description: In this tutorial, I will explain how to add buttons to your Flash movie with dynamic text content using ActionScript:

Demo:

//

Let’s get started!

Note: For this tutorial, I will be using the buttons I created for a previous tutorial titled “Animating a button using a mask effect”.

If you haven’t already, I recommend you start with that tutorial, as I will not be going over the animation process of the button symbols in this tutorial. If you already know how to create button animations, you can use your own button animation symbol, or download the previous tutorial source file here.

—- ads by google —-
// //

Select “File > New” (command-”N”) and select Flash File (ActionScript 2.0) to open a new Flash document file. Save the file, and give it the appropriate name. I will call this “dynamicButton_tutorial.fla”. Feel free to change the document dimensions to whatever you like (”Modify > Document or “command-J”), but for the purpose of this tutorial, I will use 250×100 pixels.

Choose “File > Import > Open External Library” (shift-cmd-O), and navigate to where you placed the source file of our previous tutorial (btnWithMask_tut1.fla) and click “Open”. What this will do is open up just the “Symbol Library” of that source file. Tip: You can also access the symbol library of any .fla file you have open with the dropdown menu in your Symbol Library window (Fig. 1).

Dynamic button tutorial fig. 1

We will be using the symbol called “mc_btn1″ from the Button With Masked Animation source file, so we can simply click and drag this symbol from one library to the other. (Fig. 1). If you notice, when you drag the one symbol, it should also place the symbol “img_highlight” in your current file symbol library. This is because the “img_highlight” symbol is used within the “mc_btn1″ symbol, so Flash knows to import all associated symbols as well.

You can go ahead and close the external symbol library so save space since we don’t need any other symbols from there. In our dynamic button .fla symbol library, double click on our “mc_btn1″ symbol to bring us into symbol editing mode. You should see several layers and animation tweens in your timeline. We are going to leave all of this as is, so go ahead and lock all of these layers. What we need to do is add our text boxes that we will be using as our button labels. Add a new layer above your layer named “mask” and call it “text”. WIth the text tool (T), draw a box roughly the same width of our button, and position it on the center of our button shape. Select your text box, and in the Properties Panel (WIndow > Properties > Properties (cmd-F3)), and give it the settings in Fig. 2.

Dynamic button tutorial fig. 2

Now, select the text box, choose Edit > Copy (cmd-C) and then Edit > Paste in Place (cmd-shift-V), and move it 2 or three pixels up and to the left. In Properties Panel, leave all the settings the same, except change the instance name from “textBlack” to “textWhite”, and change the color to white. What we are doing is simply giving our button label a basic “dropshadow” effect, just to make it more easily legible on all the button states.

We are now done editing our button, but since we are going to be placing our button on the stage using ActionsScript, the final thing we need to do is assign our buttona “Linkage” identifier name. Not to be confused with “symbol name” or “instance name”, an identifier name is used to call our button in ActionScript in order to be place on our stage. To give you button an id, right-click (control-click) on your button symbol in your library, and select “Linkage…” from the menu. This will open the Linkage Properties window (Fig. 3). Click on the “Export for ActionScript” check box and in the “Identifier” field, type “button” and hit OK.

Dynamic button tutorial fig. 3

Now, it’s time for our ActionScript. It may look like a lot, but don’t be too intimidated, it’s not nearly as complicated as it looks, I promise!

On our main timeline, click on the first (and only) layer and give it a name of “actions”. In keyframe one, open the Actions Panel (Window > Actions or alt-F9) and paste the following code:

onLoad = function(){
var button:Array = [home, about, contact];

var xPosition:Number = 50;
var yPosition:Number = 15;

for(i=0;i<button.length;i++){
_root.attachMovie(”button”,”btn”+i,_root.getNextHighestDepth());

_root[”btn”+i]._x = xPosition;
_root[”btn”+i]._y = yPosition;

yPosition = yPosition + 25;

_root.btn0.textBlack.text = “Home”;
_root.btn1.textBlack.text = “About”;
_root.btn2.textBlack.text = “Contact”;

_root.btn0.textWhite.text = “Home”;
_root.btn1.textWhite.text = “About”;
_root.btn2.textWhite.text = “Contact”;

_root.btn0.link = “http://www.spitshine-design.com”;
_root.btn1.link = “http://www.spitshine-design.com/about.html”;
_root.btn2.link = “http://www.spitshine-design.com/contact.html”;

_root[”btn”+(i)].onRollOver = btnOver;
_root[”btn”+(i)].onRollOut = btnOut;
_root[”btn”+(i)].onRelease = btnRelease;
_root[”btn”+(i)].onPress = btnPress;
}
}

function btnOver(){
this.gotoAndPlay(”over”);
}

function btnOut(){
this.gotoAndPlay(”off”);
}

function btnPress(){
this.gotoAndStop(”down”);
}

function btnRelease() {
this.gotoAndStop(”off”);
getURL(this.link);
}

That’s it! Go ahead and test your movie. You should see 3 buttons appear, stacked, with the top one labled “home”, the middle one labeled “about” and the bottom one labeled “contact”. You should also see the animation on the different rollover states as well.

Since there is a lot of code here, rather than explain it all here, I decided to heavily comment the code in the source file. Since the real objective of any tutorial is for the reader to actually learn WHY things work and not just how, I encourage you to download the source file and read through the comments. The comments also help to explain the different items that need to be edited to customize your menu, such as placement, position and labels.

As always, I hope you found this tutorial helpful, and comments/questions are welcome. Thanks for reading!

Credits: http://vision-media.ca/resources/php/create-a-php-web-crawler-or-scraper-5-minutes

Utilizing the PHP programming language we show you how to create an infinitely extendable web crawler in under 5 minutes, collecting images and links.

The Crawler Framework

First we need to create the crawler class as follows:

<?php

class Crawler {

}

?>

We then will create methods to fetch the web pages markup, and to parse it for data that we are looking at collecting. The only public methods will be getMarkup() and get() as the parsing methods will generally be used privately for the crawler, however the visibility is set to protected since you never know who will want to extend its functionality.

<?php

class Crawler {

protected $markup = ”;

public function __construct($uri) {

}

public function getMarkup() {

}

public function get($type) {

}

protected function _get_images() {

}

protected function _get_links() {

}

}

?>

Fetching Site Markup

The constructor will accept a URI so we can instantiate it such as new Crawler(‘http://vision-media.ca’); which then will set our $markup property using PHP’s file_get_contents() function which fetches the sites markup.

<?php

public function __construct($uri) {

$this->markup = $this->getMarkup($uri);

}

public function getMarkup($uri) {

return file_get_contents($uri);

}

?>

Crawling The Markup For Data

Our get() method will accept a $type string which essentially will simply be used to invoke another method actually doing the processing. As you can see below we construct the method name as a string, then make sure it is available so now developers can utilize this simply by invoking $crawl->get(‘images’);

We set visibility for _get_images() and _get_links() to protected so that developers will use our public get() method rather than getting confused and trying to invoke them directly.

Each protected data collection method simply uses the PCRE (Perl Compatible Regular Expressions) function preg_match_all() in order to return all tags within the markup that are accepted using our patterns of /<img([^>]+)\/>/i and /<a([^>]+)\>(.*?)\<\/a\>/i. For more information on regular expressions visit http://en.wikipedia.org/wiki/Regular_expression

<?php

public function get($type) {

$method = “_get_{$type}”;

if (method_exists($this, $method)){

return call_user_method($method, $this);

}

}

protected function _get_images() {

if (!empty($this->markup)){

preg_match_all(‘/<img([^>]+)\/>/i’, $this->markup, $images);

return !empty($images[1]) ? $images[1] : FALSE;

}

}

protected function _get_links() {

if (!empty($this->markup)){

preg_match_all(‘/<a([^>]+)\>(.*?)\<\/a\>/i’, $this->markup, $links);

return !empty($links[1]) ? $links[1] : FALSE;

}

}

?>

Final PHP Web Crawler Code And Usage

<?php

class Crawler {

protected $markup = ”;

public function __construct($uri) {

$this->markup = $this->getMarkup($uri);

}

public function getMarkup($uri) {

return file_get_contents($uri);

}

public function get($type) {

$method = “_get_{$type}”;

if (method_exists($this, $method)){

return call_user_method($method, $this);

}

}

protected function _get_images() {

if (!empty($this->markup)){

preg_match_all(‘/<img([^>]+)\/>/i’, $this->markup, $images);

return !empty($images[1]) ? $images[1] : FALSE;

}

}

protected function _get_links() {

if (!empty($this->markup)){

preg_match_all(‘/<a([^>]+)\>(.*?)\<\/a\>/i’, $this->markup, $links);

return !empty($links[1]) ? $links[1] : FALSE;

}

}

}

a

$crawl = new Crawler(‘http://vision-media.ca’);

$images = $crawl->get(‘images’);

$links = $crawl->get(‘links’);

?>

My Technorati Profile

June 3, 2009

Technorati Profile

Thanks for the support guys for the response and comments.

It has been a long time since I haven’t posted something, but it now time to move and give my site a technorati profile claim.

cheers!

An easy way to parse the query string in your URL to grab certain values.

Get URL Parameters Using Javascript

Most of the server-side programming languages that I know of like PHP, ASP, or JSP give you easy access to parameters in the query string of a URL. Javascript does not give you easy access. With javascript you must write your own function to parse the window.location.href value to get the query string parameters you want. Here is a small function I wrote that will parse the window.location.href value and return the value for the parameter you specify. It does this using javascript’s built in regular expressions. Here is the function:

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

The way that the function is used is fairly simple. Let’s say you have the following URL:

http://www.foo.com/index.html?bob=123&frank=321&tom=213#top

You want to get the value from the frank parameter so you call the javascript function as follows:

var frank_param = gup( ‘frank’ );

Now if you look at the frank_param variable it contains the number 321. The query string was parsed by the regular expression and the value of the frank parameter was retrieved. The function is smart in a couple of ways. For example, if you have an anchor in your URL like our example URL above does (#top) the gup() function knows to stop before the # character. Also, if a requested parameter doesn’t exist in the query string then an empty string is returned instead of a null.

This function has worked very well for my query string parsing needs and should work well for you.

url source: http://www.netlobo.com/url_query_string_javascript.html

20 programming lessons

September 17, 2008

From:http://www.dcs-media.com/desdev/businesslessons/2020-top-20-programming-lessons-ive-learned-in-20-years.aspx

This post could be viewed as hard lessons learned for newly graduated college students, entry-level programmers, or advanced developers who just want a chuckle. I’ve been programming since I was 11 and I’ve loved technology and programming every since. There are some hard and easy lessons I’ve learned over time. As a fellow programmer, you may not have experienced these, but I’m offering them to individuals who are interested in learning more from my experiences.

1. Set a duration of how long you think it should take to solve a problem – C’mon, admit it! I’m just as guilty as the next programmer. I’ve seen programmers sit in front of a monitor for eight hours at a time trying to solve a particular problem. Set a time table for yourself of 1 hour, 30 minutes, or even 15 minutes. If you can’t figure out a solution to your problem within your time frame, ask for help or research your problem on the Internet instead of trying to be super-coder.

2. A language is a language is a language – Over time, once you understand how one language works, you’ll notice similarities between other languages. The language you choose should provide you with a suitable “comfort” level, the ability to produce efficient (and clean) code, and, above all, allow the language to suit the project and vice-versa.

3. Don’t over-”design pattern” applications – Sometimes it’s just easier to write a simple algorithm than it is to incorporate a singleton or facade pattern. For the most part, it even allows for cleaner, understandable code. :-)

4. Always backup your code – I’ve experienced a complete hard drive failue and lost a lot of code when I was younger and felt horrible because of what had happened. The one time you don’t back up your data may be the one time where you have a strict deadline with a client and they need it tomorrow. Source code/version control applies here as well.

5. You are not the best at programming. Live with it. – I always thought that I knew so much about programming, but there is always someone out there better than you. Always. Learn from them.

6.
Learn to learn more – With number five explained, I’ve always had a magazine or book in my hand about computers or programming (ask my friends, they’ll confirm). True, there is a lot of technology out there and keeping up with it is a fulltime job, but if you have a smart way of receiving your news, you’ll learn about new technology every single day.

7. Change is constant – Your knowledge of technology and/or programming should be similar to how you treat stocks: Diversify. Don’t get too comfortable with a particular technology. If there’s not enough support for that language or technology, you might as well start updating your resume now and start your training period. My general rule of thumb that has kept me going? Know at least two or three languages, so if one dies off, you have another one to fall back on while you train for a new technology.

8. Support Junior – Assist and train the junior/entry-level developers on good programming guidelines and techniques. You never know…you may move up in rank and you’ll feel more confident having personally trained and prepared them for their next position.

9. Simplify the algorithm – Code like a fiend, but once you’re done, go back through your code and optimize it. A little code improvement here and there will make support happier in the long run.

10. Document your code – Whether its documenting a Web Service API or documenting a simple class, document as you go. I’ve been accused of over-commenting my code and that’s something I’m proud of. It only takes a second to add an additional comment line for each 3 lines of code. If it’s a harder technique to grasp, don’t be afraid to over-comment. This is one problem most architects, backup coders, and support groups don’t complain about if you’ve done your job right.

11. Test, Test, Test – I’m a fan of Black Box Testing. When your routine is finished, your “stamp of approval” period starts. If you have a Quality Assurance department, you may be talking more to them than your project manager regarding errors in your code. If you don’t test your code thoroughly, you may develop more than code. Possibly a bad reputation.

12. Celebrate every success – I’ve met a lot of programmers who have conquered headache-style problems with a great programming technique and celebrated with a fellow programmer by doing the “shake”, the high-five, or even a “happy dance.” Everyone has enlightening periods in their life and even though that one happy coder asked you to come and see his extraordinary piece of code and you’ve seen that one piece of code over 100 times in your experiences, celebrate the success of a fellow developer for the 101-st time.

13. Have Code Reviews Frequently – On projects and personally. In the company, you will always have code reviews of how well you coded something. Don’t look at it as people crucifying your coding style. Think of it as constructive criticism. On the personal front, review your code and always ask, “How could I have done it better?” This will accelerate your learning and make you a better programmer.

14. Reminisce about your code – There are two ways to looking at old code: “I can’t believe I wrote this code” and “I can’t believe I wrote this code.” The first statement is often of disgust and wondering how you can improve it. You’d be surprised at how old code can be resurrected into a possible and better routine, or maybe even an entire product. The second statement is of amazement and achievement. Developers have their one or two project code achievements that they completed and had everyone standing up and taking notice. Again, based on your excellent coding ability, you could take those past routines or projects and update them into a better product or idea.

15. Humor is necessary – In my 20 years of development, I have never met a programmer who hasn’t had a decent sense of humor. Actually, in this industry, it’s a requirement.

16. Beware the know-it-all, possessive coder, and the inexperienced coder – Humble yourself when you meet these types of coders. The know-it-all tries to upstage you instead of working as a team player, the defensive coder created code that he doesn’t want to share with anyone, and the inexperienced coder constantly asks for assistance every ten minutes where the finished code developed is yours, not theirs.

17. No project is ever simple – I’ve been asked by friends, family, and associates to just “whip something up for me.” To “whip” up a program or web site, it takes planning from both parties to complete something that both sides can appreciate. If someone needs a 3-page web site with Microsoft Access from the start, it winds up becoming a 15-page web site with SQL Server, a forum, and a custom CMS (Content Management System).

18. Never take anything for granted – If you take on a simple project, you may think that a certain section will be easy to complete. Don’t think that even for a moment. Unless you have a class, component, or piece of code already coded…and has been tested thoroughly…and is in production from an existing project, don’t think it will be easy.

19. Software is never finished – A fellow programmer once told me that software is never finished, it’s “temporarily completed.” Sound advice. If the client is still using a program you wrote and has stood the test of time, chances are, you are still updating it, which isn’t a bad thing. It keeps you working. :-)

20. Patience is definitely a virtue – When clients, friends, or family members use a PC, they get frustrated and proceed to hit a component of the PC or storm off. I keep telling everyone, “you are controlling the computer not the other way around.” You need to have a certain level of patience for programming computers. As soon as programmers understand what they did wrong, they look at it from the computers point of view and say, “Oh, that’s why it was doing that.”

I have worked all of these jobs except inside sales. I would never do sales because I may as well just cut myself or go play basketball for the Portland Trailblazers.

The most soul sucking jobs in the world are those that make you do naughty things in order to earn a living. Here’s five of them, based on my experience.

1. Bill collector

Why: It’s your job to call old ladies who are on social security who can barely afford groceries and their pills and convince them to cut you a check for a cell phone bill. Either you’re a heartless bastard or you go home at the end of the day feeling emotionally drained.

2. Call center phone jockey

Why: It’s your job to be a meat socket in between the customer and the information or menial tasks that will fix their problem. You think your job is to help the customer, but your job is really to do what your company tells you to do. You’re in constant emotional conflict between doing what’s right for the customer talking in your ear and doing what’s right for the company that pays your wages.

3. Inside salesman

Why: You do whatever it takes to make a sale or you get fired. You make buddies with guys you would never even look at outside your job. You talk it up, you play it nice, you promise the customer anything and it makes you a selfish, materialistic bastard in your life outside work.

4. Factory laborer

Why: You repeat the same action over and over for eight to twelve hours at a time for low pay. You do this all day every day until you are laid off or fired. Your life is a miasma of waking work and sleeping. Your motions and responses are mechanical like your job. You’re depressed because your life lacks color and feeling. You are a cheap replacement for a machine that could do your job better than you could ever hope to.

5. Temp to hire employee

Why: Your job depends on your going the extra mile. While some people get promotions and bonuses for going above and beyond the call of duty, for you it’s a job requirement. There are easily hundreds of people who could do your job and you could be replaced at any time. The only possible reward you might have coming to you is a full time job. You fantasize about the carrot that’s dangled over your head every waking second. Maybe, someday, if you work extra hard your contract will turn into a real job. But probably not. Your employer knows all about dangling the carrot and they know you’ll push yourself just a little harder if they hint that you might be headed for a conversion.

source from: foxmajik

url: http://foxmajik.livejournal.com/877073.html

Author: Peter Cooper
Link : http://codesnippets.joyent.com/user/therad/tag/javascript#post681

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
var arVersion = navigator.appVersion.split(“MSIE”)
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == “PNG”)
{
var imgID = (img.id) ? “id=’” + img.id + “‘ ” : “”
var imgClass = (img.className) ? “class=’” + img.className + “‘ ” : “”
var imgTitle = (img.title) ? “title=’” + img.title + “‘ ” : “title=’” + img.alt + “‘ “
var imgStyle = “display:inline-block;” + img.style.cssText
if (img.align == “left”) imgStyle = “float:left;” + imgStyle
if (img.align == “right”) imgStyle = “float:right;” + imgStyle
if (img.parentElement.href) imgStyle = “cursor:hand;” + imgStyle
var strNewHTML = “
img.outerHTML = strNewHTML
i = i-1
}
}
}
}
window.attachEvent(“onload”, correctPNG);

echo “http://”.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);

The rise and fall of my sloppy love
The smatterings, and splatterings
They’ll get you
I’m not the one you were thinking of
Maybe you thought I’d call
Instead of crashing down your hall
Hold me down, I wanna find out
You know you will never get what you need
Blue Diamond strike ‘em anywhere
First we caffeinate then incinerate
We’ll get you
And sparks will fly in the summer air
Did you pull out of your stall
Maybe I’ll see you after all
Hold me down, I wanna find out
We say no, cause I live my life like a burning man
Like a burning man, a burning man
Like a burning man
And I won’t get enough until my legs are broken
The stars they shine in an empty void
Life is not to fear, life is to enjoy
He’ll get you
Oh, Mr. Death catches all someday
Baby I thought you’d call
Or leave a light on in the hall

Hold me down but I’ll find out
We say no, cause I live my life like a burning man
Like a burning man, a burning man
Like a burning man
Hold me down, I wanna find out
We say no, cause I live my life like a burning man
Like a burning man, a burning man
Like a burning man
And I won’t get enough, until my legs are broken

Overview

FancyForm is a powerful checkbox replacement script used to provide the ultimate flexibility in changing the appearance and function of HTML form elements. It’s accessible, easy to use and degrades gracefully on all older, non-supporting browsers.

At a glance

  • Quick Setup: Only two lines of markup needed
  • Completely Extendible: Numerous customization options
  • Degrades Gracefully: Forms still work on older browsers

Cebu Sky Cable Misery

June 11, 2008

I was channel surfing last night, tuning on the sports channels on SkyCable. ESPN was showing NCCA basketball, Balls Channel, the new sports channel that Sky replaced  Basketball TV was also showing NCCA basketball. Not just any other basketball game, but the SAME game that was shown on ESPN, but a few seconds ahead!

If this is their idea of “offering our subscibers a new better channel lineup and programming for the new year” (or something to this note according to the December billing which also informed that JACK TV, Basketball TV, Solar Sports, ETC, 2nd Avenue, Crime/Suspense will no longer be offered starting January 1), then hats off to SkyCable! They must have invented a time machine that broadcasts games ahead of schedule!

So far, my viewing experience content wise with this new and improved channel lineup is an abhorrent one. Here are my personal basis of comparison.

JACK TV vs. MAXXX – JACK TV shows WWE matches that’s a few weeks late, with the current channel MAXXX, it only shows OLD WWE reruns! For those who knows a little of wrestling history, the matches shown was way back when WWE was known as WWF! Think of these other shows thats not aired in MAXXX, That 70s Show, Everybody Hates Chris, Family Guy, Beat the Geeks, My Name is Earl, etc.

Basketball TV vs. Balls – This is a no-brainer. Basketball TV shows NBA games live EVERYDAY! What does BALLS boast of? NCCA PAC 10 conference games. The channel promo for their basketball games possesses anemic wit. The main message is that before the NBA stars achieved their status, they first played college hoops. SO? Show us these NBA stars who are currently playing, not these college kids who MAY become stars of tomorrow!

Solar Sports vs. Discovery Channel – No basis of comparison here, replacing a sports channel with a documentary channel. Discovery is the only channel that’s been a good addition for me. HOWEVER, Solar shows NFL games, soccer, UFC, boxing among others. I missed the NFL playoffs, and I still don’t know if the Superbowl will be shown on ESPN.

ETC/2nd Avenue vs. Velvet – Before, I used to wait for JEOPARDY in 2nd avenue, I watched Tyra Banks Show just for the fun of watching her trying so hard to be like Oprah. The title of the shows on VELVET doesn’t register in my brain. Not even for my seven seconds, which they say is the amount of time for the brain retains short memory.

There are other shows worth comparing with the old and new channel lineups but I’m tired of typing.

SkyCable monopolized the cable TV service in Metro Cebu for a long time now. They bought out Cebu Cable and Moonsat in Minglanilla. I’m not 100% accurate with this but in areas in Mandaue and Mactan, customers have the option of subscribing to other cable providers. And, the other providers still carry the old channels that Sky has discontinued. So, is the reason than Sky “offered” us this channel is for our viewing pleasure?

If what I heard from a friend is true, you would be mad with Sky also. His version from a reuptable source is that Sky dropped these channels because of MANNY PACQIUAO. The parent company of Sky, ABS-CBN offered a contract to Manny to air his fights. GMA counter-offered with a higher amount. But to come out with the money, GMA needed monetary help. They came to an agreement with SOLAR SPORTS, who has rights to air NBA WWE and NFL games and is the parent company of the discontinued Sky channels to share the amount that they offered to Manny. This made the Lopezes faces turn red as a beet. As a form of retribution, they discontinued these channel. FOR OUR VIEWING PLEASURE!

Solve Compaq Presario Serial ATA (SATA) controller

INSTRUCTONS BLOG: Instructions

LINK TO DRIVER:

Compaq V3000 – Presario Driver Download Page

SATA hard drives have become more and more appreciated tending to substitute the IDE drives due to the increasing speed they offer. Motherboard manufacturers started to implement the new standard years ago, when the technology was young and expensive. Now, as the SATA HDD prices have lowered to a level where anybody can afford to choose a SATA enabled HDD instead of an IDE one, a great migration has been observed among the common computer users.

They choose to install Windows and applications on SATA drives because they provide more speed which determines the system to run smoother. Thus, for those owning older mainboards with SATA support an extra step is required while attempting to install Windows XP. Windows XP does not provide drivers for all the SATA controllers, therefore, during the installation procedure, the user must insert a floppy with the drivers that came in the package along with the motherboard.

Not a big deal, not much effort, but the funny thing is that a great number of people passed on their floppy drives. Under these circumstances, no floppy means the impossibility to install Windows XP on SATA (on some mainboards). The result? The installation guide simply won’t detect the SATA HDD.

People that were happy they got rid of the old removable drive have now motives to worry. Some may reconsider buying new floppy drives for their computers. Even if I wrote in a precedent article about the utility of the floppy drive, I do not encourage spending your money buying back an obsolete piece of hardware. I will present you a method to avoid this inconvenient by doing a software trick.

Let’s take it slow. Where is the problem? We have a driver problem strictly because the SATA driver we need does not come embedded in the Windows XP installation package. What if we add the driver by ourselves before installing Windows?

What ingredients are involved in this operation? The original Windows XP Installation CD, a freeware application named NLite and a blank CD. Moreover, we need the drivers for the SATA controller provided by the manufacturer. In case you did not find any floppy inside the motherboard package or you cannot locate them on the mainboard installation CD, you can consult the manufacturer’s website to download the latest versions. To do the trick I have been talking about, it is assumed that you already have a Windows installed on an IDE drive. In case you don’t, pay a visit to a friend and ask him to let you use his computer. It won’t take too much time, I guarantee.

So, download the drivers and unzip them (in case they come archived) in a desired location. Then download and install the Nlite application. When you start the Nlite application, you will be asked to provide the location for the Windows installation package. Insert the genuine Windows Installation CD into the CD drive and, inside the application, select the CD drive letter.

To insert the SATA drivers within the installation package, you need to have it saved on the HDD. Hence, when the warning window appears click OK and select the destination folder for the files to be saved. Make sure that the destination partition / HDD has enough space to store the contents of the installation CD.

I tested a Windows XP Home Edition and it seems that it required about 566 MB. Immediately after you have chosen the destination folder, the application will start copying the Windows installation files. When finished, it will display some version information regarding the newly copied Windows Installation Package.

Now, click next twice until you get to a screen where you get options sorted in 4 categories: Integrate, Remove, Setup, Create. We are interested in the integration procedure, therefore select the Drivers button and click next. From the next menu window, click Import and select multiple drive folder option from the drop down menu. This option permits you to browse to the location where the downloaded drivers are found.

Select the containing directory and click next. You will get a list with the available drivers (in case there are more than one) or simply one driver. Select it (them) and click next. Now the application will ask for the permission to start the integration procedure. Choose Yes and wait for the drivers to be inserted into the installation package.

Review image Review image Review image
Review image Review image Review image
Review image Review image Review image

With problematic driver being included in the installation package you can install Windows XP on your SATA HDD…but…the installation package is on the HDD. You need a bootable CD in order to start an installation. Don’t worry, once the installation package has been adorned with additional user selected drivers it can be transformed into a bootable disk image and later burned on a CD. To encapsulate the installation into a ISO image use the same Nlite application.

Open it, make sure the HDD installation folder is selected and click next. Select “Last session” preset and click next again. Now from the options menu choose Bootable ISO and click next. In the following window, make sure that the mode is set to “Create Image” and click Make ISO. A destination folder is required where the resulting ISO image will be saved. Once the image saving process finished you have the freedom to burn it on a blank CD with whatever you favorite CD burner software may be.

Review image Review image

The new CD will be the twin copy of the Windows Installation CD but with one difference, it includes the SATA driver.

MAC OS THEME
Make your linux ubuntu look like a mac – hardy heron

source : http://linuxondesktop.blogspot.com/2008/05/transforming-your-ubuntu-804-desktop-to.html
MAC OS has been traditionally known for their impressive graphical interface and stability. Now even though i have been an avid Linux follower over the past 9 years I have been using Linux still i find my self attracted to MAC OS .Now even though these days it’s possible to run Hackintosh on normal Intel hardware but it’s not stable and well there are hardware compatibility issues . So well other alternative to using MAC OS is either to purchase MAC hardware(which would be naturally expensive) and run full fledged MAC OS or you could tweak and customize your Ubuntu desktop to look more like MAC OS X .

In this tutorial i describe step by step how to make your Ubuntu 8.04 desktop look more like MAC OS X Leopard :) .
Installing Cursor , GTK and Icon Theme

To install cursor,gtk and icon theme first download the package from the link given below :

http://rapidshare.de/files/38210507/MyTheme.tar.gz.html

Now to install the theme package we have created in the above step , go to (System -> Preferences -> Appearance) and click Install and point to our newly downloaded Mytheme.tar.gz archive.



This should start installing the theme package (Cursors/Icons/Theme) once installation is completed . Chose Customize in theme and click on Customize .

You will find a window like this:

Customize Dialog Box

In this window in Icons chose LeopardX , in Controls Mac4Lin_GTK_Aqua_v0.3 , in Window Border Mac4Lin_GTK_Aqua_v0.3 and in Pointers White Cursor .

If you have followed the steps properly the theme and icons should have been installed , and you should be able to see the new theme applied to your default desktop .

Enabling Compiz Graphic Effects and installing Mac4Lin Theme

Ubuntu 8.04 comes with Compiz Fusion pre-installed and on supported hardware offers a wide array of Visual Effect . Now depending on graphic hardware of computer one could chose from three level of Visual Effect (From
System -> Preferences -> Appearance )

None : – This mode causes Ubuntu to use Metacity instead of Compiz Fusion , with no visual effect

Basic : – Has only simple visual effects like shadows , fading windows-menus etc

Advanced : – Recommended for PC with descent graphic hardware , enables effects like wobbly windows, transparency , animated workspace switching etc

Visual Effect Dialog Box


However , compiz-fusion is capable of much more and you can enable more desktop effects /customize compiz by typing the following command in the terminal window : -

sudo apt-get install compizconfig-settings-manager

After completing above step , you can customize compiz by going to System > Preferences > Advanced Desktop Effects Settings .
After installation is over , open Terminal from (Applications -> Accessories -> Terminal ) and issue the following command to install emerald which is necessary for using themes in compiz .

sudo apt-get install emerald

After installation is over download MacOS X Emerald theme from this link : http://gnome-look.org/content/show.php/Mac4Lin+Leopard+Emerald+Theme?content=68409

Now open (System -> Preferences -> Emerald Theme Manager )

After Emerald theme manager opens click on import and point to the downloaded theme package from withing the Theme Manager , you will find Mac4Lin Theme listed select the theme , click on refresh and quit the application .

Emerald Theme Manager


Mac like Dock with Avant Window Navigator

IMPORTANT : – To use AWN Compiz-Fusion should be up and running as mentioned in the step above

Avant Windows Navigator is cool little tool that allows you to have a cute looking dock at the bottom of the screen . Even though AWN is still very buggy, still because it is so feature rich and cool looking you could install it .

To install AWN you need to add extra repositories, now adding any additional repository carries certain amount of risk of screwing up your system so follow these step at your own risk :

To add repository :

echo “deb http://ppa.launchpad.net/awn-testing/ubuntu hardy main” | sudo tee -a /etc/apt/sources.list

and

echo “deb-src http://ppa.launchpad.net/awn-testing/ubuntu hardy main” | sudo tee -a /etc/apt/sources.list

After issuing above command type the following command to update your repositories :

sudo apt-get update

anf finally to install AWN issue the following command in the terminal window :

sudo apt-get install awn-manager-trunk awn-extras-applets-trunk

Now after completing above mentioned steps AWN should be properly installed , To Launch AWN go to (Applications -> Accessories -> Avant Window Navigator )

Now you could customize AWN by choosing to add more applets , configuring 3D effects for AWN etc by going to AWN Manager ( System -> Preferences -> Awn Manager )


Three ScreenShots of AWN Manager

Though the theme which AWN comes with preinstalled is also good , you might like to try this it’s cool and very Mac like

http://rapidshare.com/files/71511920/Transparent.tgz.html

you could install this theme through AWN Manager go to (System->Preferences->AWN manager) and go to themes there and click on “Add” and point it to the downloaded theme.

You will see a confirmation dialog box that theme has been added properly. Close AWN Manager and start it again and chose the theme just installed and press apply button to make this theme default theme of AWN.


This is how my AWN Dock looks(with the above theme installed) like : -

AWN-DOCK

Desktop Widgets with Screenlets
Screenlets gives user a collection of impressive widgets that can be placed on desktop this is similar to feature available on Windows Vista and Mac OS X Dashboard , it gives impressive look to the desktop.

To install Screenlets type in the following command in the terminal window :

sudo apt-get install screenlets

Now , After the installation is over you can add Widgets/Screenlets on your desktop by going to (System -> Preferences -> Screenlets ) , you will find a dialog box like this from where you could add Screenlets onto the desktop .Also you might like to tick the checkbox “Autostart on login” so screenlets starts automatically when Gnome starts.

Changing the Log In Screen / GDM Theme

To change the Log In Screen/GDM Theme download the package from website listed below : http://gnome-look.org/content/show.php/OSX+Session+Login?content=68346

After downloading the package , open (System -> Administration -> Log in Window ) and there go to Local and click on Add and point to the downloaded theme package (osx-login.tar.gz) . Now you would find OSX-Login theme listed in the window , select OSX-Login and close the window . Logout and Login again you should find the new theme installed .

Log-in Window allows easy changing of the Login Screen Theme


Getting MAC OS X Leopard Wallpaper
Finally you can get MAC OS X Leopard wallpaper from the following website :

http://appleology.com/images/space-desktop.png

This is how my desktop looks after following all the above steps :

Article Written by : Ambuj Varshney (blogambuj@gmail.com)
For Desktop on Linux Blog , http://linuxondesktop.blogspot.com
(C) 2008 , Ambuj Varshney

/usr/bin/bluefish